:root {
  --bg: #07111f;
  --bg-soft: #0b1728;
  --surface: #0f1d30;
  --surface-2: #13243a;
  --surface-3: #162a43;
  --line: rgba(147, 170, 201, .16);
  --line-strong: rgba(147, 170, 201, .28);
  --text: #edf5ff;
  --muted: #8fa5bf;
  --blue: #2f80ed;
  --blue-2: #4ea1ff;
  --orange: #f59e0b;
  --orange-2: #ffb238;
  --red: #ef4444;
  --green: #22c55e;
  --shadow: 0 18px 55px rgba(0,0,0,.25);
  --radius: 18px;
  --sidebar: 240px;
}

[data-theme="light"] {
  --bg: #edf3f9;
  --bg-soft: #f5f8fc;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef4fa;
  --line: rgba(15, 42, 70, .10);
  --line-strong: rgba(15, 42, 70, .18);
  --text: #102238;
  --muted: #62748b;
  --shadow: 0 18px 45px rgba(28, 55, 85, .09);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, .task-card, .calendar-day { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; overflow: hidden; position: relative; background: radial-gradient(circle at 15% 10%, rgba(47,128,237,.17), transparent 32%), radial-gradient(circle at 90% 85%, rgba(245,158,11,.13), transparent 30%), var(--bg); }
.login-orb { position: absolute; border-radius: 50%; filter: blur(4px); opacity: .65; }
.orb-one { width: 340px; height: 340px; background: radial-gradient(circle, rgba(47,128,237,.25), transparent 68%); left: -80px; top: -70px; }
.orb-two { width: 300px; height: 300px; background: radial-gradient(circle, rgba(245,158,11,.18), transparent 68%); right: -70px; bottom: -50px; }
.glass { backdrop-filter: blur(18px); background: color-mix(in srgb, var(--surface) 92%, transparent); }
.login-card { position: relative; width: min(460px, 100%); border: 1px solid var(--line-strong); border-radius: 28px; padding: 38px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 11px; min-height: 42px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; font-weight: 900; font-size: 21px; background: linear-gradient(145deg, var(--blue), #1f5bb5 56%, var(--orange)); color: white; box-shadow: 0 8px 25px rgba(47,128,237,.28); }
.brand strong, .brand span { display: block; line-height: 1; letter-spacing: .08em; }
.brand strong { font-size: 15px; }
.brand span { margin-top: 5px; font-size: 11px; color: var(--orange); font-weight: 800; }
.brand-login { margin-bottom: 42px; }
.eyebrow { margin: 0 0 7px; color: var(--blue-2); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.login-card h1 { margin: 0; max-width: 380px; font-size: clamp(30px, 6vw, 44px); line-height: 1.05; letter-spacing: -.04em; }
.login-copy { margin: 16px 0 28px; color: var(--muted); line-height: 1.6; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; background: #081525; border-right: 1px solid rgba(147,170,201,.12); z-index: 30; }
[data-theme="light"] .sidebar { background: #0b1a2e; color: #edf5ff; }
.sidebar .brand { padding: 0 10px 25px; }
.nav-list { display: grid; gap: 7px; margin-top: 16px; }
.nav-item { border: 0; background: transparent; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 13px; border-radius: 12px; color: #8fa5bf; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-align: left; transition: .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.04); color: #d8e8fa; }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(47,128,237,.20), rgba(47,128,237,.06)); box-shadow: inset 3px 0 0 var(--blue); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; font-size: 17px; color: var(--blue-2); }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.mini-tip { border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.025); border-radius: 14px; padding: 13px; display: flex; gap: 9px; color: #8fa5bf; font-size: 11px; line-height: 1.5; }
.mini-tip span { width: 8px; height: 8px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px rgba(245,158,11,.6); }
.mini-tip p { margin: 0; }
.mini-tip strong { color: #dceafb; }

.main-area { min-width: 0; background: radial-gradient(circle at 95% 0%, rgba(47,128,237,.05), transparent 25%), var(--bg); }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 28px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, var(--blue), #1f5bb5); color: white; font-weight: 900; }
.user-chip small, .user-chip strong { display: block; line-height: 1.1; }
.user-chip small { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.user-chip strong { margin-top: 4px; font-size: 11px; }

.content-wrap { padding: 22px 28px 42px; max-width: 1680px; margin: 0 auto; }
.filters-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.period-pills, .filter-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pill, .btn, .icon-btn, .text-btn { border: 0; cursor: pointer; transition: .18s ease; }
.pill { padding: 8px 12px; border-radius: 999px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; border: 1px solid transparent; }
.pill:hover { color: var(--text); }
.pill.active { color: #fff; border-color: rgba(47,128,237,.36); background: rgba(47,128,237,.16); }
.search-box { display: flex; align-items: center; gap: 7px; min-width: 250px; height: 37px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.search-box span { color: var(--muted); }
.search-box input { border: 0; outline: 0; background: transparent; color: var(--text); width: 100%; font-size: 12px; }
select, input, textarea { border: 1px solid var(--line); outline: 0; border-radius: 11px; background: var(--surface-2); color: var(--text); }
select:focus, input:focus, textarea:focus { border-color: rgba(47,128,237,.7); box-shadow: 0 0 0 3px rgba(47,128,237,.09); }
.filter-tools select { height: 37px; padding: 0 10px; font-size: 10px; font-weight: 700; letter-spacing: .04em; }

.btn { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue), #246ac8); box-shadow: 0 8px 20px rgba(47,128,237,.18); }
.btn-primary span { font-size: 17px; margin-right: 3px; }
.btn-secondary { color: #151515; background: linear-gradient(135deg, var(--orange), var(--orange-2)); }
.btn-ghost { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.btn-danger { background: rgba(239,68,68,.11); color: #ff8f8f; border: 1px solid rgba(239,68,68,.24); }
.btn-wide { width: 100%; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 18px; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.text-btn { background: transparent; color: var(--blue-2); font-size: 10px; font-weight: 900; letter-spacing: .06em; }

.view { display: none; }
.view.active { display: block; animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: .25; transform: translateY(4px); } }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 13px; }
.kpi-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); box-shadow: 0 10px 35px rgba(0,0,0,.06); position: relative; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; inset: auto -30px -45px auto; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(47,128,237,.11), transparent 67%); }
.kpi-card.orange::after { background: radial-gradient(circle, rgba(245,158,11,.13), transparent 67%); }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.kpi-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--blue-2); background: rgba(47,128,237,.10); }
.orange .kpi-icon { color: var(--orange-2); background: rgba(245,158,11,.10); }
.kpi-value { margin: 13px 0 1px; font-size: 31px; line-height: 1; font-weight: 850; letter-spacing: -.04em; }
.kpi-foot { color: var(--muted); font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: 0 10px 35px rgba(0,0,0,.05); }
.panel-plain { padding: 4px 0 18px; }
.span-2 { grid-column: span 2; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel h3, .section-intro h3, .calendar-toolbar h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.metric-chip { padding: 6px 9px; border-radius: 999px; background: rgba(34,197,94,.10); color: #78dc99; font-size: 9px; font-weight: 900; }

.bar-chart { min-height: 205px; display: grid; grid-template-columns: repeat(14, minmax(8px,1fr)); align-items: end; gap: 6px; padding: 16px 4px 0; border-bottom: 1px solid var(--line); }
.bar-wrap { height: 185px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; position: relative; }
.bar { width: min(24px, 65%); min-height: 3px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--blue-2), var(--blue)); opacity: .9; transition: .2s; }
.bar:hover { opacity: 1; filter: brightness(1.1); }
.bar-label { color: var(--muted); font-size: 8px; white-space: nowrap; }
.bar-count { position: absolute; top: 0; font-size: 9px; color: var(--muted); }
.status-chart { display: grid; gap: 11px; }
.status-row { display: grid; grid-template-columns: 94px 1fr 26px; align-items: center; gap: 9px; font-size: 9px; font-weight: 800; }
.status-track { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.status-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.status-row:nth-child(4) .status-fill { background: var(--orange); }
.status-row:nth-child(5) .status-fill { background: var(--green); }
.status-row span:last-child { text-align: right; color: var(--muted); }
.priority-chart { display: grid; gap: 10px; }
.priority-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border-radius: 11px; background: var(--surface-2); }
.priority-item div { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 800; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.urgent { background: var(--red); }
.dot.high { background: var(--orange); }
.dot.medium { background: var(--blue); }
.dot.low { background: #70b6ae; }
.priority-item strong { font-size: 18px; }

.upcoming-list { display: grid; gap: 7px; }
.upcoming-item { display: grid; grid-template-columns: 50px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px 11px; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.upcoming-item:hover { border-color: var(--line-strong); }
.date-box { text-align: center; border-right: 1px solid var(--line); padding-right: 10px; }
.date-box strong, .date-box small { display: block; }
.date-box strong { font-size: 17px; }
.date-box small { color: var(--muted); font-size: 8px; font-weight: 800; }
.upcoming-main strong { display: block; font-size: 11px; }
.upcoming-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 18px; }
.section-intro p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.kanban-board { display: grid; grid-template-columns: repeat(5, minmax(235px, 1fr)); gap: 11px; overflow-x: auto; padding-bottom: 14px; }
.kanban-col { min-height: 520px; background: color-mix(in srgb, var(--surface) 76%, transparent); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.kanban-col.drag-over { border-color: rgba(47,128,237,.75); background: rgba(47,128,237,.05); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 5px 12px; }
.kanban-head strong { font-size: 10px; letter-spacing: .08em; }
.count-badge { min-width: 24px; height: 22px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 9px; font-weight: 800; }
.kanban-cards { display: grid; gap: 8px; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px; cursor: grab; box-shadow: 0 7px 22px rgba(0,0,0,.06); }
.task-card:active { cursor: grabbing; }
.task-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.task-card.dragging { opacity: .45; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.type-badge, .priority-badge, .member-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 21px; padding: 0 7px; border-radius: 999px; font-size: 8px; font-weight: 900; letter-spacing: .05em; }
.type-badge { color: var(--blue-2); background: rgba(47,128,237,.09); }
.type-badge.appointment { color: var(--orange-2); background: rgba(245,158,11,.09); }
.type-badge.reminder { color: #c59cff; background: rgba(156,98,255,.09); }
.priority-badge.urgent { color: #ff8f8f; background: rgba(239,68,68,.10); }
.priority-badge.high { color: var(--orange-2); background: rgba(245,158,11,.10); }
.priority-badge.medium { color: var(--blue-2); background: rgba(47,128,237,.10); }
.priority-badge.low { color: #70c7bd; background: rgba(55,181,167,.10); }
.task-card h4 { margin: 0; font-size: 12px; line-height: 1.35; }
.task-card p { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.due-text { color: var(--muted); font-size: 8px; font-weight: 750; }
.due-text.overdue { color: #ff8585; }
.member-badge { color: var(--text); background: var(--surface-3); }
.member-dot { width: 6px; height: 6px; border-radius: 50%; }
.empty-state { padding: 25px 12px; border: 1px dashed var(--line); border-radius: 13px; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.5; }

.agenda-list { display: grid; gap: 16px; }
.agenda-group h4 { margin: 0 0 8px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.agenda-items { display: grid; gap: 7px; }
.agenda-item { display: grid; grid-template-columns: 70px 8px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }
.agenda-time { color: var(--muted); font-size: 10px; font-weight: 800; }
.agenda-line { width: 3px; height: 34px; border-radius: 999px; background: var(--blue); }
.agenda-item.overdue .agenda-line { background: var(--red); }
.agenda-main strong { display: block; font-size: 11px; }
.agenda-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; }
.calendar-actions { display: flex; gap: 7px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(110px,1fr)); gap: 6px; min-width: 820px; }
.calendar-wrap { overflow-x: auto; }
.calendar-weekday { padding: 8px 9px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.calendar-day { min-height: 120px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 9px; cursor: pointer; }
.calendar-day.outside { opacity: .38; }
.calendar-day.today { border-color: rgba(47,128,237,.65); box-shadow: inset 0 0 0 1px rgba(47,128,237,.16); }
.calendar-number { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; }
.calendar-number span:last-child { color: var(--orange); }
.calendar-events { display: grid; gap: 4px; margin-top: 8px; }
.calendar-event { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 4px 6px; border-radius: 6px; background: rgba(47,128,237,.09); color: var(--blue-2); font-size: 8px; font-weight: 750; }
.calendar-event.appointment { color: var(--orange-2); background: rgba(245,158,11,.09); }

.backlog-list { display: grid; gap: 8px; }
.backlog-item { display: grid; grid-template-columns: 30px minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }
.backlog-grip { color: var(--muted); font-size: 17px; }
.backlog-main strong { display: block; font-size: 11px; }
.backlog-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.family-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 13px; }
.members-list { display: grid; gap: 8px; }
.member-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.member-profile { display: flex; align-items: center; gap: 10px; }
.member-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; font-weight: 900; }
.member-profile strong { display: block; font-size: 11px; }
.member-profile small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.form-stack { display: grid; gap: 14px; }
.form-stack label, .form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.form-stack input, .form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-height: 43px; padding: 9px 11px; }
.form-grid textarea { resize: vertical; }
.form-error { padding: 10px; margin-top: 12px; border-radius: 10px; color: #ffaaaa; background: rgba(239,68,68,.09); font-size: 10px; }
.compact-form { max-width: 460px; }

.modal { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 28px); border: 0; padding: 0; background: transparent; color: var(--text); }
.modal::backdrop { background: rgba(0,6,15,.72); backdrop-filter: blur(5px); }
.modal-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px; padding: 21px; box-shadow: var(--shadow); overflow-y: auto; max-height: calc(100vh - 28px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }
.modal-actions { display: flex; align-items: center; gap: 8px; padding-top: 17px; }
.spacer { flex: 1; }

#toast-root { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: #10233a; color: #ecf5ff; border: 1px solid rgba(147,170,201,.22); box-shadow: var(--shadow); font-size: 10px; animation: toast-in .2s ease; }
.toast.error { border-color: rgba(239,68,68,.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-only { display: none; }

@media (max-width: 1180px) {
  :root { --sidebar: 210px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid .span-2 { grid-column: span 2; }
  .dashboard-grid .panel:not(.span-2) { grid-column: span 1; }
  .filters-bar { align-items: flex-start; flex-direction: column; }
  .filter-tools { width: 100%; }
  .search-box { flex: 1; }
}

@media (max-width: 820px) {
  :root { --sidebar: 250px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 12px 0 45px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: grid; }
  .topbar { padding: 12px 14px; min-height: 72px; }
  .topbar > div:nth-child(2) { flex: 1; }
  .topbar h2 { font-size: 17px; }
  .top-actions { gap: 7px; }
  .top-actions #install-btn, .user-chip { display: none; }
  .top-actions .btn-primary { width: 38px; padding: 0; font-size: 0; }
  .top-actions .btn-primary span { font-size: 22px; margin: 0; }
  .content-wrap { padding: 15px 13px 35px; }
  .filters-bar { margin-bottom: 16px; }
  .period-pills { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .pill { white-space: nowrap; }
  .filter-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: span 2; min-width: 0; }
  .kpi-grid { gap: 8px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 26px; }
  .dashboard-grid { display: block; }
  .dashboard-grid .panel { margin-bottom: 9px; }
  .bar-chart { overflow-x: auto; gap: 7px; }
  .bar-wrap { min-width: 20px; }
  .section-intro { align-items: flex-start; flex-direction: column; }
  .kanban-board { grid-template-columns: repeat(5, 82vw); scroll-snap-type: x mandatory; }
  .kanban-col { scroll-snap-align: start; min-height: 430px; }
  .family-layout { grid-template-columns: 1fr; }
  .agenda-item { grid-template-columns: 52px 5px minmax(0,1fr); }
  .agenda-item > :last-child { display: none; }
  .backlog-item { grid-template-columns: 24px minmax(0,1fr) auto; }
  .backlog-item > :last-child { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .modal-card { padding: 17px; border-radius: 18px; }
  .login-card { padding: 28px 22px; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-label { font-size: 8px; }
  .kpi-foot { display: none; }
  .topbar .eyebrow { display: none; }
  .topbar h2 { font-size: 14px; }
  .calendar-toolbar { align-items: flex-start; gap: 12px; }
  #cal-today { display: none; }
  .modal-actions { flex-wrap: wrap; }
}

/* ===== MINDFY TASK UI REFRESH 2026-10-07 ===== */
:root {
  --topbar-height: 86px;
  --sidebar-bg: #081525;
}

[data-theme="light"] {
  --sidebar-bg: #0b1a2e;
}

html, body {
  font-size: 15px;
}

/* Brand assets */
.brand {
  display: flex;
  align-items: center;
  min-height: 42px;
}
.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.brand-login {
  margin-bottom: 34px;
  justify-content: flex-start;
}
.brand-logo-login {
  width: min(320px, 84%);
}
.brand-sidebar {
  justify-content: center;
}
.brand-logo-sidebar {
  width: min(100%, 198px);
}
.sidebar .brand {
  padding: 0 6px 23px;
}

/* Login readability */
.login-card {
  width: min(480px, 100%);
}
.login-copy {
  font-size: 15px;
  line-height: 1.65;
}
.eyebrow {
  font-size: 12px;
  font-weight: 850;
}

/* Sidebar + fixed top bar */
.sidebar {
  padding: 22px 16px;
  background: var(--sidebar-bg);
  border-right: 0;
}
[data-theme="light"] .sidebar {
  background: var(--sidebar-bg);
}
.sidebar::after {
  content: "";
  position: absolute;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: 1px;
  background: rgba(147,170,201,.14);
  pointer-events: none;
}
.nav-item {
  color: #a9bbcf;
  font-size: 13px;
  letter-spacing: .045em;
}
.mini-tip {
  color: #9eb2c9;
  font-size: 12px;
  line-height: 1.55;
}

.main-area {
  min-height: 100vh;
  padding-top: var(--topbar-height);
}
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar);
  right: 0;
  z-index: 20;
  min-height: var(--topbar-height);
  height: var(--topbar-height);
  padding: 14px 28px;
  gap: 22px;
  background: var(--sidebar-bg);
  color: #edf5ff;
  border-bottom: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  backdrop-filter: none;
}
.topbar h2 {
  font-size: 22px;
  line-height: 1.15;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 44px;
}
.top-actions > * {
  flex: 0 0 auto;
}
.user-chip {
  min-height: 42px;
  padding: 4px 10px 4px 4px;
  border-color: rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}
.user-chip small {
  color: #9eb2c9;
  font-size: 10px;
  letter-spacing: .10em;
}
.user-chip strong {
  margin-top: 3px;
  color: #f3f8ff;
  font-size: 12px;
}
.topbar .icon-btn,
.topbar .btn-ghost {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.10);
  color: #b8c8da;
}
.topbar .icon-btn:hover,
.topbar .btn-ghost:hover {
  color: #fff;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
}
.topbar .btn-primary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Controls */
.pill {
  min-height: 36px;
  padding: 8px 13px;
  font-size: 11.5px;
  letter-spacing: .07em;
}
.search-box {
  min-width: 270px;
  height: 40px;
  gap: 8px;
  padding: 0 12px;
}
.search-box input {
  font-size: 13px;
}
.filter-tools select {
  height: 40px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 750;
}
.btn {
  min-height: 40px;
  padding: 0 15px;
  font-size: 12px;
  letter-spacing: .055em;
}
.icon-btn {
  width: 40px;
  height: 40px;
}
.text-btn {
  font-size: 11px;
}

/* Global readability */
.kpi-label { font-size: 12px; }
.kpi-foot { font-size: 11.5px; }
.panel h3,
.section-intro h3,
.calendar-toolbar h3 { font-size: 18px; }
.metric-chip { font-size: 10.5px; }
.bar-label { font-size: 10px; }
.bar-count { font-size: 10.5px; }
.status-row {
  grid-template-columns: 110px 1fr 30px;
  gap: 10px;
  font-size: 11px;
}
.priority-item div { font-size: 11.5px; }
.date-box small { font-size: 10px; }
.upcoming-main strong { font-size: 13px; }
.upcoming-main small { font-size: 11px; }
.section-intro p:last-child {
  font-size: 13px;
  line-height: 1.5;
}
.kanban-head strong { font-size: 11.5px; }
.count-badge {
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  font-size: 10.5px;
}
.type-badge,
.priority-badge,
.member-badge {
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
}
.task-card h4 {
  font-size: 14px;
  line-height: 1.4;
}
.task-card p {
  font-size: 12px;
  line-height: 1.5;
}
.due-text { font-size: 10.5px; }
.empty-state {
  font-size: 12px;
  line-height: 1.55;
}
.agenda-group h4 { font-size: 11.5px; }
.agenda-time { font-size: 12px; }
.agenda-main strong { font-size: 13px; }
.agenda-main span { font-size: 11.5px; }
.calendar-weekday { font-size: 11px; }
.calendar-number { font-size: 12px; }
.calendar-event {
  padding: 5px 7px;
  font-size: 10px;
}
.backlog-main strong { font-size: 13px; }
.backlog-main small { font-size: 11px; }
.member-profile strong { font-size: 13px; }
.member-profile small { font-size: 11px; }
.form-stack label,
.form-grid label {
  gap: 7px;
  font-size: 11px;
}
.form-stack input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 45px;
  padding: 10px 12px;
  font-size: 14px;
}
.form-error { font-size: 12px; }
.toast { font-size: 12px; }

@media (max-width: 1180px) {
  .brand-logo-sidebar { width: min(100%, 174px); }
}

@media (max-width: 820px) {
  :root { --topbar-height: 74px; }
  .main-area { padding-top: var(--topbar-height); }
  .topbar {
    left: 0;
    min-height: var(--topbar-height);
    height: var(--topbar-height);
    padding: 10px 14px;
    gap: 10px;
  }
  .top-actions {
    gap: 6px;
    min-height: 40px;
  }
  .top-actions .btn-primary {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }
  .sidebar::after { top: 0; }
  .brand-logo-sidebar { width: min(100%, 198px); }
  .brand-logo-login { width: min(300px, 88%); }
  .content-wrap { padding-top: 18px; }
}

@media (max-width: 520px) {
  .kpi-label { font-size: 11px; }
  .topbar h2 { font-size: 16px; }
  .topbar .eyebrow { display: none; }
}


/* ===== PAGE TITLE + NAV ICON CONSISTENCY 2026-10-07 ===== */
.topbar-title {
  display: flex;
  align-items: center;
  min-width: 0;
}
.topbar #top-title {
  margin: 0;
  color: var(--orange-2);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .085em;
  text-transform: uppercase;
}
.nav-item {
  min-height: 48px;
}
.nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #77a9df;
  font-size: 0;
  line-height: 1;
}
.nav-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.nav-item.active .nav-icon {
  color: var(--orange-2);
}

@media (max-width: 820px) {
  .topbar #top-title {
    font-size: 17px;
    letter-spacing: .07em;
  }
}

@media (max-width: 520px) {
  .topbar #top-title {
    font-size: 15px;
  }
}
