/* Tima Daily — тёмное оформление с плитками */
:root {
  --bg: #12151a; --card: #1a1f27; --card2: #212732; --line: #2a313c;
  --text: #e8eaed; --muted: #8a93a0; --accent: #5dcaa5; --accent-bg: #04342c; --accent-text: #9fe1cb;
  --bad: #f09595; --bad-bg: #501313; --warn: #ef9f27; --warn-bg: #412402;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
h1 { font-size: 22px; font-weight: 600; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; width: 100%; min-height: 40px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); padding: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 4px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
label.check input { margin: 0; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; }
.bad { color: var(--bad) !important; }
.good { color: var(--accent) !important; }
.error { color: var(--bad); font-size: 14px; margin-bottom: 10px; }
.grow { flex: 1; }
.ico { width: 20px; height: 20px; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); white-space: nowrap; }
.btn:hover { background: var(--card2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04342c; font-weight: 600; }
.btn.primary:hover { background: #7ad6b6; }
.btn.danger { color: var(--bad); }
.btn.icon { padding: 0; width: 40px; }
.btn.icon.live { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.btn.wide { width: 100%; margin-top: 16px; }
.link { color: var(--accent); font-size: 13px; font-weight: 400; }
.link.more { display: block; padding: 10px 0 12px; }

/* вход */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 340px; background: var(--card); border-radius: 16px; padding: 24px; }
.login-box h1 { margin-bottom: 20px; }
.login-box .btn { width: 100%; margin-top: 4px; }

/* каркас */
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 12px; border-right: 1px solid var(--line); display: flex;
  flex-direction: column; gap: 2px; }
.brand { font-size: 17px; font-weight: 600; padding: 0 10px 18px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--muted); }
.nav:hover { background: var(--card); color: var(--text); }
.nav.on { background: var(--card); color: var(--text); }
.nav.on .ico { color: var(--accent); }
.main { padding: 24px 28px 60px; max-width: 1180px; width: 100%; }
.tabs { display: none; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sec { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted);
  margin: 22px 0 8px; }
.sec.first { margin-top: 0; }
.sec .link { margin-left: auto; }
button.sec { width: 100%; }
.empty { color: var(--muted); font-size: 14px; padding: 4px 0; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.tile-l { font-size: 12px; color: var(--muted); }
.tile-v { font-size: 26px; font-weight: 600; line-height: 1.25; }
.tile-v.sm { font-size: 18px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card { background: var(--card); border-radius: 12px; padding: 2px 14px; }
.card.pad { padding: 14px; }
.card + .card { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 46px; width: 100%; }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.row-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.row.done .row-title { color: var(--muted); text-decoration: line-through; }
.navrow .ico { color: var(--accent); }
.cb { width: 22px; height: 22px; border: 1.5px solid #5b6470; border-radius: 7px; flex: none; position: relative; }
.cb::before { content: ''; position: absolute; inset: -10px; }
.cb.on { background: var(--accent); border-color: var(--accent); }
.cb.on::after { content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #04342c;
  border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--accent-bg); color: var(--accent-text); white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.due { font-size: 13px; color: var(--muted); white-space: nowrap; }
.due.late { color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--accent); }
.dot.bad { background: var(--bad); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 12px; border-radius: 17px;
  background: var(--card); color: var(--muted); font-size: 14px; }
.chip.on { background: var(--accent-bg); color: var(--accent-text); }
.chip.add .ico { width: 16px; height: 16px; }

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: #161a20; border-radius: 12px; padding: 10px; min-height: 120px; }
.col-h { font-size: 13px; color: var(--muted); padding: 2px 4px 10px; }
.kard { background: var(--card); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.kard:hover { background: var(--card2); }
.kard-t { overflow-wrap: anywhere; }
.kard-m { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 28px; flex-wrap: wrap; }
.kard-move { margin-left: auto; display: flex; gap: 4px; }
.kard-move button { width: 30px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 7px;
  color: var(--muted); background: var(--bg); }
.kard-move button:hover { color: var(--accent); }
.kard-move .ico { width: 16px; height: 16px; }

.habits { padding: 8px 14px; overflow-x: auto; }
.hrow { display: grid; grid-template-columns: minmax(110px, 1fr) repeat(7, 38px) 34px; align-items: center; gap: 4px;
  padding: 8px 0; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.hday { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); }
.hday b { font-weight: 500; color: var(--text); }
.hday.now b { color: var(--accent); }
.hname { overflow-wrap: anywhere; }
.hstreak { text-align: right; color: var(--accent); font-size: 13px; }

.goal { padding: 14px; }
.goal.done { opacity: .6; }
.goal-h { cursor: pointer; }
.goal-t { font-weight: 600; }
.bar { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.over i { background: var(--bad); }
.step-add { display: flex; gap: 8px; margin-top: 10px; }

.monthbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.monthbar span { min-width: 130px; text-align: center; font-weight: 500; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.cols2 > div > .sec:first-child { margin-top: 22px; }
.cols2 > div > .sec.first:first-child { margin-top: 0; }
.cat { padding: 10px 0 4px; border-bottom: 1px solid var(--line); }
.cat:last-child { border-bottom: 0; }
.cat-h { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.row b { font-weight: 500; white-space: nowrap; }

.srv { padding: 14px; }
.srv-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.srv-h .muted { margin-left: auto; }
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 6px; }

.veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 20; }
.modal { background: var(--card); border-radius: 16px; padding: 18px; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; }
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-f { display: flex; gap: 8px; margin-top: 6px; }

/* телефон */
@media (max-width: 760px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: #161a20; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px;
    color: var(--muted); position: relative; }
  .tab.on { color: var(--accent); }
  .tab .dot { position: absolute; top: 6px; left: calc(50% + 8px); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cols2 > div > .sec.first:first-child { margin-top: 22px; }
  .cols2 > div:first-child > .sec.first:first-child { margin-top: 0; }
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 8px; }
  .col { flex: 0 0 82%; scroll-snap-align: center; }
  .head { flex-wrap: wrap; }
  .hrow { grid-template-columns: minmax(70px, 1fr) repeat(7, 30px) 22px; gap: 2px; }
  .habits { padding: 8px 10px; }
  .veil { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-width: none; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .meters { gap: 10px; }
}
