:root{
  --bg:#f5f7fb;--panel:#fff;--ink:#1f2937;--muted:#6b7280;--line:#e5e7eb;
  --brand:#1f2937;--brand2:#374151;--accent:#2563eb;--danger:#b91c1c;--warn:#a16207;
  --ok:#047857;--radius:14px;--shadow:0 8px 24px rgba(15,23,42,.07);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink);
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg)}button,input,select,textarea{font:inherit}
button,a,select{cursor:pointer}.app-shell{min-height:100vh;display:grid;grid-template-columns:240px 1fr}
.sidebar{position:sticky;top:0;height:100vh;background:var(--brand);color:#fff;padding:22px 16px;z-index:20}
.brand{display:flex;gap:12px;align-items:center;margin-bottom:26px}.brand strong,.brand small{display:block}.brand small{opacity:.68}
.brand-mark{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#fff;color:var(--brand);font-weight:800}
.brand-mark.large{width:62px;height:62px;border-radius:18px;margin:0 auto 14px;background:var(--brand);color:#fff}
.main-nav{display:grid;gap:8px}.main-nav a{color:#d1d5db;text-decoration:none;padding:12px 14px;border-radius:10px}
.main-nav a:hover,.main-nav a.active{background:rgba(255,255,255,.12);color:#fff}.workspace{min-width:0}
.topbar{height:74px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:18px;padding:0 24px;position:sticky;top:0;z-index:15}
.page-heading{min-width:180px}.page-heading h1{font-size:20px;margin:0}.page-heading span{font-size:12px;color:var(--muted)}
.top-actions{margin-left:auto;display:flex;gap:12px;align-items:center}.top-actions select{min-width:180px;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:#fff}
.user-chip{padding:9px 12px;background:#f3f4f6;border-radius:999px;font-size:13px}.content{padding:22px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.toolbar{display:flex;gap:10px;align-items:center;padding:12px;margin-bottom:14px}.toolbar .grow{flex:1}.toolbar input,.toolbar select{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}
.btn{border:0;border-radius:10px;padding:10px 14px;background:#eef2f7;color:var(--ink)}.btn.primary{background:var(--accent);color:#fff}.btn.danger{background:#fee2e2;color:var(--danger)}
.kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:14px}.kpi-card{padding:18px}.kpi-card small{display:block;color:var(--muted);margin-bottom:8px}.kpi-card strong{font-size:28px}
.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:separate;border-spacing:0}.data-table th,.data-table td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap;font-size:13px}.data-table th{position:sticky;top:0;background:#f8fafc;color:#475569;z-index:1}.data-table tr:hover td{background:#fafcff}
.status{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:700;background:#f3f4f6}.status-DONE{background:#d1fae5;color:#065f46}.status-OVERDUE,.status-CANCELLED{background:#fee2e2;color:#991b1b}.status-IN_PROGRESS,.status-APPOINTED{background:#dbeafe;color:#1d4ed8}.status-DUE,.status-PENDING{background:#fef3c7;color:#92400e}
.empty,.loading{padding:42px;text-align:center;color:var(--muted)}.system-banner{margin:14px 22px 0;padding:10px 12px;border-radius:10px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412}
.auth-overlay{position:fixed;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(5px);display:grid;place-items:center;z-index:100}.auth-overlay.hidden{display:none}.auth-card{width:min(390px,calc(100vw - 32px));padding:28px;background:#fff;border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.2);text-align:center}.auth-card h2{margin:0 0 8px}.auth-card p{color:var(--muted);font-size:14px}.auth-message{min-height:20px;margin-top:12px;color:var(--danger);font-size:13px}
.toast-root{position:fixed;right:18px;bottom:18px;z-index:120;display:grid;gap:8px}.toast{max-width:360px;background:#111827;color:#fff;padding:11px 14px;border-radius:10px;box-shadow:var(--shadow)}
.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:110;display:grid;place-items:center;padding:18px}.modal{width:min(560px,100%);background:#fff;border-radius:16px;box-shadow:0 30px 90px rgba(0,0,0,.25)}.modal header,.modal footer{padding:14px 18px;border-bottom:1px solid var(--line)}.modal footer{border-bottom:0;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px}.modal .body{padding:18px}.field{display:grid;gap:6px;margin-bottom:12px}.field input,.field select,.field textarea{padding:10px;border:1px solid var(--line);border-radius:9px}.field textarea{min-height:90px}
.pager{display:flex;justify-content:flex-end;gap:8px;align-items:center;padding:12px}.pager span{font-size:13px;color:var(--muted)}.mobile-only{display:none}.icon-btn{border:0;background:transparent;font-size:22px}
@media(max-width:1023px){
  .app-shell{grid-template-columns:1fr}.sidebar{position:fixed;left:-260px;width:240px;transition:left .18s ease}.sidebar.open{left:0}.mobile-only{display:inline-grid}.content{padding:16px}.topbar{padding:0 16px}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  .topbar{height:auto;min-height:68px;flex-wrap:wrap;padding:10px 12px}.page-heading{flex:1}.top-actions{width:100%;margin:0}.top-actions select{flex:1;min-width:0}.user-chip{max-width:46%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{padding:12px}.toolbar{align-items:stretch;flex-direction:column}.kpi-grid{grid-template-columns:1fr 1fr;gap:10px}.kpi-card{padding:14px}.kpi-card strong{font-size:23px}.data-table th,.data-table td{padding:10px;font-size:12px}
}
/* v0.7.1 Login Experience */
.auth-overlay{
  background:linear-gradient(135deg,rgba(15,23,42,.78),rgba(30,41,59,.62));
  backdrop-filter:blur(10px);padding:28px;
}
.auth-stage{
  width:min(940px,calc(100vw - 48px));min-height:560px;display:grid;
  grid-template-columns:1.05fr .95fr;background:#fff;border-radius:28px;
  overflow:hidden;box-shadow:0 34px 100px rgba(2,6,23,.35);
}
.auth-hero{
  position:relative;padding:52px;color:#fff;display:flex;flex-direction:column;
  justify-content:space-between;background:
  radial-gradient(circle at 15% 15%,rgba(255,255,255,.16),transparent 30%),
  linear-gradient(145deg,#111827,#253247 72%,#35445c);
}
.auth-hero:after{content:"";position:absolute;width:260px;height:260px;border:1px solid rgba(255,255,255,.1);border-radius:50%;right:-90px;bottom:-80px}
.auth-hero-mark{width:54px;height:54px;border:1px solid rgba(255,255,255,.18);border-radius:16px;display:grid;place-items:center;background:rgba(255,255,255,.1);font-weight:900;letter-spacing:.04em}
.auth-eyebrow,.auth-kicker{font-size:11px;letter-spacing:.18em;font-weight:800}.auth-eyebrow{color:#cbd5e1}.auth-kicker{color:#64748b}
.auth-hero-copy h2{font-size:38px;line-height:1.18;margin:14px 0 18px;letter-spacing:-.03em}.auth-hero-copy p{max-width:390px;color:#cbd5e1;line-height:1.75;margin:0}
.auth-features{display:grid;gap:10px;font-size:13px;color:#e2e8f0}
.auth-card{width:auto;padding:60px 54px;border-radius:0;box-shadow:none;text-align:left;display:flex;flex-direction:column;justify-content:center}
.auth-mobile-brand{display:none}.auth-heading{margin-bottom:30px}.auth-heading h1{font-size:32px;letter-spacing:-.03em;margin:8px 0 8px}.auth-heading p{font-size:14px;line-height:1.65;margin:0;color:#64748b}
.auth-form{display:grid;gap:18px}.auth-field{display:grid;gap:8px}.auth-field>span{font-size:13px;font-weight:700;color:#334155}
.auth-input-wrap{height:52px;display:flex;align-items:center;border:1px solid #dbe1e8;border-radius:13px;background:#f8fafc;transition:.18s ease;overflow:hidden}
.auth-input-wrap:focus-within{border-color:#64748b;background:#fff;box-shadow:0 0 0 4px rgba(100,116,139,.10)}
.auth-input-icon{width:46px;display:grid;place-items:center;font-size:15px;opacity:.62}.auth-input-wrap input{height:100%;min-width:0;flex:1;border:0;outline:0;background:transparent;padding:0 12px 0 0;color:#0f172a}.auth-input-wrap input::placeholder{color:#94a3b8}
.auth-eye{width:44px;height:44px;border:0;background:transparent;color:#64748b;font-size:16px}.auth-eye:hover{background:#eef2f7}
.auth-submit{height:52px;border:0;border-radius:13px;background:#1f2937;color:#fff;font-weight:800;letter-spacing:.01em;box-shadow:0 8px 18px rgba(31,41,55,.18);transition:.18s ease}.auth-submit:hover{background:#111827;transform:translateY(-1px)}.auth-submit:disabled{opacity:.65;cursor:not-allowed;transform:none}
.auth-message{min-height:22px;margin-top:16px;padding:0;color:#b91c1c;font-size:13px;text-align:left}.auth-message:empty{display:none}.auth-footer{margin-top:28px;padding-top:18px;border-top:1px solid #eef2f7;text-align:center;font-size:11px;color:#94a3b8;letter-spacing:.04em}
.auth-submit-spinner{width:18px;height:18px;border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;display:inline-block;animation:authspin .7s linear infinite;vertical-align:-4px;margin-left:8px}@keyframes authspin{to{transform:rotate(360deg)}}
@media(max-width:760px){
  .auth-overlay{padding:16px;align-items:center}.auth-stage{width:min(460px,100%);min-height:0;grid-template-columns:1fr;border-radius:22px}.auth-hero{display:none}.auth-card{padding:36px 26px 30px}.auth-mobile-brand{display:block;margin-bottom:24px}.auth-heading{text-align:center;margin-bottom:26px}.auth-heading h1{font-size:28px}.auth-heading p{font-size:13px}.auth-footer{margin-top:24px}.brand-mark.large{width:54px;height:54px;border-radius:15px}
}
@media(max-width:420px){
  .auth-overlay{padding:10px}.auth-card{padding:30px 20px 24px}.auth-stage{border-radius:18px}.auth-input-wrap,.auth-submit{height:50px}.auth-heading h1{font-size:26px}
}
/* v0.7.2 Login busy-state fix */
.auth-submit-spinner[hidden]{display:none !important}
.auth-submit-spinner:not([hidden]){display:inline-block}
.auth-submit[disabled]{pointer-events:none}
