/* ── Layouts ────────────────────────────────────────────────────────────────
   Four ways to read the same data. `grid` is the original springboard; `today`,
   `board` and `list` are work views, driven by views.js. The body carries a
   layout-<name> class, and the chrome that only makes sense for one layout is
   shown/hidden from here rather than in JS.
   ------------------------------------------------------------------------- */
.view-root { display: none; animation: fadeDown 0.5s ease-out both; padding-bottom: 2rem; }
body:not(.layout-grid) #grid,
body:not(.layout-grid) #camp-area,
body:not(.layout-grid) #hidden-bar,
body:not(.layout-grid) #activity,
body:not(.layout-grid) #completion { display: none !important; }
body:not(.layout-grid) .view-root { display: block; }

/* Sorting only means something where every app is on screen at once. */
body.layout-today .sort-pills,
body.layout-board .sort-pills,
body.layout-today #search,
body.layout-board #search { display: none; }

.layout-pills { display: flex; gap: 0.35rem; background: rgba(10,15,30,0.4); padding: 0.25rem; border-radius: 14px; }
.layout-pills .pill.active { background: #6366f1; box-shadow: 0 3px 12px rgba(99,102,241,0.4); }

/* ── Shared view furniture ──────────────────────────────────────────────── */
.view-section { margin-bottom: 1.6rem; }
.view-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 0.75rem; }
.view-section-head h2 { font-family: 'Sora', sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.view-section-head .count { font-size: 0.75rem; font-weight: 700; color: var(--subtext); background: rgba(255,255,255,0.07); padding: 2px 9px; border-radius: 20px; }
.view-section-head .sub { font-size: 0.76rem; color: #64748b; margin-left: auto; }
.view-empty { color: #475569; font-size: 0.82rem; padding: 0.9rem 1rem; background: var(--glass); border: 1px dashed var(--glass-border); border-radius: 14px; }

.panel { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--glass-border); border-radius: 18px; box-shadow: 0 8px 32px rgba(0,0,0,0.25); }

/* Small square app chip, reused by every view. */
.mini-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 800; color: #fff; flex-shrink: 0; letter-spacing: 0.02em; box-shadow: 0 3px 10px rgba(0,0,0,0.35); }
.mini-icon.color-1 { background: var(--c1); } .mini-icon.color-2 { background: var(--c2); }
.mini-icon.color-3 { background: var(--c3); } .mini-icon.color-4 { background: var(--c4); }
.mini-icon.color-5 { background: var(--c5); }
.mini-icon.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 0.58rem; }

/* ── Today: hero ────────────────────────────────────────────────────────── */
.today-hero { padding: 1.3rem 1.5rem; margin-bottom: 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.today-greet { flex: 1 1 240px; }
.today-greet h2 { font-family: 'Sora', sans-serif; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 3px; }
.today-date { font-size: 0.8rem; color: var(--subtext); }
.today-stats { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.today-stat { text-align: center; min-width: 62px; }
.today-stat .n { font-family: 'Sora', sans-serif; font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.today-stat .l { font-size: 0.66rem; color: var(--subtext); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; margin-top: 2px; }
.today-stat.warn .n { color: #fbbf24; }
.today-stat.bad  .n { color: #f87171; }
.today-stat.good .n { color: #4ade80; }

/* Honest about where open items come from: they only exist on localhost. */
.local-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.78rem; color: #94a3b8; background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.25); border-radius: 14px; padding: 0.7rem 1rem; margin-bottom: 1.6rem; }
.local-note code { background: rgba(10,15,30,0.7); padding: 2px 7px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.74rem; color: #93c5fd; }

.today-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.6rem; align-items: start; }
@media (max-width: 900px) { .today-cols { grid-template-columns: minmax(0, 1fr); } }

/* ── Test queue ─────────────────────────────────────────────────────────── */
.test-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0.8rem; }
.test-card { padding: 0.9rem 1rem; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); transition: transform 0.18s, border-color 0.18s; }
.test-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.2); }
.test-card.fresh { border-color: rgba(251,191,36,0.4); background: linear-gradient(180deg, rgba(251,191,36,0.07), var(--glass)); }
.test-card-top { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.test-card-name { font-weight: 700; font-size: 0.92rem; }
.test-card-why { font-size: 0.71rem; color: var(--subtext); margin-top: 1px; }
.test-card-why.fresh { color: #fbbf24; font-weight: 600; }
.test-card-commit { font-size: 0.74rem; color: #94a3b8; margin: 0.6rem 0 0.7rem; line-height: 1.45; border-left: 2px solid rgba(255,255,255,0.12); padding-left: 8px; }
.test-card-acts { display: flex; gap: 6px; }
.tiny-btn { flex: 1; background: rgba(255,255,255,0.07); border: 1px solid var(--glass-border); color: var(--subtext); font-size: 0.72rem; font-weight: 700; padding: 6px 8px; border-radius: 9px; cursor: pointer; text-align: center; text-decoration: none; transition: background 0.18s, color 0.18s; white-space: nowrap; }
.tiny-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.tiny-btn.primary { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.35); color: #4ade80; }
.tiny-btn.primary:hover { background: rgba(74,222,128,0.28); color: #bbf7d0; }
.tiny-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.more-btn { margin-top: 0.7rem; background: none; border: none; color: var(--accent); font-size: 0.76rem; font-weight: 700; cursor: pointer; padding: 4px 0; }
.more-btn:hover { text-decoration: underline; }

/* ── Item rows (Now / Next / Blocked) ───────────────────────────────────── */
.item-list { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: flex; align-items: flex-start; gap: 10px; padding: 0.65rem 0.85rem; border-radius: 13px; background: var(--glass); border: 1px solid var(--glass-border); cursor: pointer; transition: background 0.18s, transform 0.18s; }
.item-row:hover { background: rgba(255,255,255,0.09); transform: translateX(2px); }
.item-row .mini-icon { margin-top: 1px; }
.item-body { min-width: 0; flex: 1; }
.item-app { font-size: 0.68rem; font-weight: 800; color: var(--subtext); text-transform: uppercase; letter-spacing: 0.05em; }
/* A few real items are a full paragraph (a blocked item names its await in prose).
   Clamp them so one item can't own the column; the row's title has the full text. */
.item-text { font-size: 0.84rem; line-height: 1.45; margin-top: 1px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-note { font-size: 0.73rem; color: #64748b; margin-top: 3px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-row.blocked { border-left: 3px solid #f87171; }
.item-row.now     { border-left: 3px solid #fbbf24; }
.item-row.next    { border-left: 3px solid #38bdf8; }

/* ── Aside: notes + hygiene ─────────────────────────────────────────────── */
.aside-panel { padding: 1rem 1.1rem; margin-bottom: 1.2rem; }
.aside-panel h3 { font-family: 'Sora', sans-serif; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; }
.aside-add { display: flex; gap: 6px; margin-bottom: 0.7rem; }
.aside-add input { flex: 1; min-width: 0; background: rgba(10,15,30,0.6); border: 1px solid rgba(255,255,255,0.15); color: #fff; padding: 0.45rem 0.7rem; border-radius: 10px; outline: none; font-size: 0.8rem; }
.aside-add input:focus { border-color: var(--accent); }
.aside-add button { background: var(--accent); border: none; color: #fff; font-weight: 800; padding: 0 12px; border-radius: 10px; cursor: pointer; font-size: 0.85rem; }
.aside-notes { list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.aside-notes li { display: flex; align-items: flex-start; gap: 8px; font-size: 0.82rem; line-height: 1.4; padding: 5px 2px; }
.aside-notes li.done span { text-decoration: line-through; color: #475569; }
.aside-notes input[type=checkbox] { margin-top: 3px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.aside-notes .del { margin-left: auto; background: none; border: none; color: #475569; cursor: pointer; font-size: 0.8rem; opacity: 0; }
.aside-notes li:hover .del { opacity: 1; }
.aside-notes .del:hover { color: #f87171; }

.hygiene-row { display: flex; align-items: center; gap: 8px; font-size: 0.79rem; padding: 5px 0; cursor: pointer; border-radius: 8px; }
.hygiene-row:hover { color: #fff; }
.hygiene-row .tagline { color: #64748b; font-size: 0.71rem; margin-left: auto; white-space: nowrap; }

/* ── Board ──────────────────────────────────────────────────────────────── */
.board-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
@media (max-width: 1000px) { .board-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .board-cols { grid-template-columns: minmax(0, 1fr); } }
.board-col { padding: 0.85rem; display: flex; flex-direction: column; min-height: 160px; }
.board-col-head { display: flex; align-items: center; gap: 7px; margin-bottom: 0.75rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--glass-border); }
.board-col-head .t { font-weight: 800; font-size: 0.82rem; letter-spacing: -0.01em; }
.board-col-head .c { margin-left: auto; font-size: 0.7rem; font-weight: 800; color: var(--subtext); background: rgba(255,255,255,0.08); padding: 1px 8px; border-radius: 20px; }
.board-col .item-list { max-height: 62vh; overflow-y: auto; padding-right: 2px; }
.board-col .item-row { background: rgba(10,15,30,0.45); }
.board-col .item-text { font-size: 0.79rem; }

/* ── List ───────────────────────────────────────────────────────────────── */
.list-wrap { overflow-x: auto; border-radius: 18px; }
table.app-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.app-table thead th { text-align: left; font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.07em; color: #64748b; font-weight: 800; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
.app-table td { padding: 0.55rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.05); white-space: nowrap; }
.app-table tbody tr { cursor: pointer; transition: background 0.15s; }
.app-table tbody tr:hover { background: rgba(255,255,255,0.06); }
.app-table .c-name { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.app-table .c-desc { color: #64748b; font-size: 0.76rem; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--subtext); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot.live { background: #4ade80; box-shadow: 0 0 7px rgba(74,222,128,0.7); }
.dot.dead { background: #475569; }
.chip { display: inline-block; font-size: 0.67rem; font-weight: 800; padding: 2px 8px; border-radius: 20px; letter-spacing: 0.02em; }
.chip.test { background: rgba(251,191,36,0.16); color: #fbbf24; }
.chip.ok   { background: rgba(74,222,128,0.14); color: #4ade80; }
.chip.idle { background: rgba(255,255,255,0.06); color: #64748b; }
