.app-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-left: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; transition: width .2s;
  display: flex; flex-direction: column;
}
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .nav-label, .sidebar.collapsed .nav-group-title, .sidebar.collapsed .brand-name { display: none; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.sidebar-brand .brand-logo-fallback { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.brand-name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; }

.nav-group { padding: 10px 10px 2px; }
.nav-group-title { font-size: 11px; color: var(--ink-faint); font-weight: 700; padding: 8px 10px 4px; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--ink-soft); font-size: 13px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; }
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--brand); color: var(--brand-ink); }
.sidebar-toggle { margin: auto 10px 14px; }

/* ---- Topbar ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.notif-btn { position: relative; background: var(--bg); border-radius: 10px; padding: 9px; display: flex; cursor: pointer; }
.notif-dot { position: absolute; top: 5px; left: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }

.main { flex: 1; min-width: 0; padding: 20px 24px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-title { font-size: 19px; font-weight: 800; }
.page-date { font-size: 12px; color: var(--ink-soft); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- Workload table ---- */
.wl-table th, .wl-table td { text-align: center; }
.wl-table th:first-child, .wl-table td:first-child { text-align: right; }
.wl-emp-info { display: flex; align-items: center; gap: 8px; }
.wl-emp-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.wl-emp-name { font-weight: 700; font-size: 12px; }
.wl-emp-jb { font-size: 11px; color: var(--ink-faint); }
.wl-badges { display: flex; gap: 4px; margin-top: 3px; }
.wl-badge { font-size: 10px; padding: 1px 6px; border-radius: 999px; display: inline-flex; align-items: center; gap: 2px; }
.wl-badge.done { background: #e7f8ee; color: var(--green); }
.wl-badge.overdue { background: #fde8e8; color: var(--red); }
.wl-badge.timer { background: #fff8d6; color: #9a7b00; }
.wl-pct-val { font-weight: 800; font-size: 13px; }
.wl-min-val { font-size: 10px; color: var(--ink-faint); }
.wl-bar-track { background: #f0f0f2; border-radius: 6px; height: 6px; overflow: hidden; }
.wl-bar-fill { height: 100%; border-radius: 6px; background: var(--green); }
.wl-bar-fill.mid { background: var(--yellow); }
.wl-bar-fill.high { background: var(--orange); }
.wl-bar-fill.over { background: var(--red); }
.wl-day-header { display: flex; flex-direction: column; }
.wl-day-name { font-size: 11px; }
.wl-day-date { font-size: 10px; color: var(--ink-faint); font-weight: 400; }

/* ---- Project rows ---- */
.proj-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.proj-row:last-child { border-bottom: none; }
.proj-tag { font-size: 11px; background: var(--bg); padding: 4px 8px; border-radius: 999px; color: var(--ink-soft); white-space: nowrap; }
.proj-info { flex: 1; min-width: 0; }
.proj-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.proj-bar-track { background: #f0f0f2; border-radius: 6px; height: 5px; overflow: hidden; }
.proj-bar-fill { height: 100%; background: var(--green); border-radius: 6px; }
.proj-days { text-align: center; font-size: 11px; color: var(--ink-soft); min-width: 50px; }
.proj-days b { display: block; font-size: 14px; }
.proj-days.warn b { color: var(--orange); }
.proj-days.urgent b { color: var(--red); }

/* ---- Active task hero ---- */
.active-task-card { background: linear-gradient(135deg, var(--ink), #2b2b31); color: #fff; border-radius: var(--radius-lg); padding: 18px 22px; }
.active-task-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11px; opacity: .8; margin-bottom: 6px; }
.active-task-title { font-size: 16px; font-weight: 800; }
.active-task-sub { font-size: 12px; opacity: .7; }
.active-clock { font-family: var(--font-mono); font-size: 20px; font-weight: 700; }

/* ---- Auth pages ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-md); }
.auth-logo { width: 48px; height: 48px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; margin: 0 auto 16px; }
.auth-title { text-align: center; font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.auth-sub { text-align: center; font-size: 12px; color: var(--ink-soft); margin-bottom: 20px; }
.auth-alt { text-align: center; font-size: 12px; margin-top: 14px; color: var(--ink-soft); }
.auth-error { background: #fde8e8; color: var(--red); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12px; margin-bottom: 14px; }

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 50; right: 0; height: 100vh; transform: translateX(100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main { padding: 16px; }
}
