/* Signed in app shell and Home. Every rule is scoped under .app-shell so it never touches the sign in screens. */
.app-shell {
  --a-bg: #f5f6f9; --a-surface: #ffffff; --a-surface-2: #f8f9fc; --a-border: #e4e7ee; --a-border-strong: #d3d8e2;
  --a-text: #161c28; --a-text-2: #475066; --a-text-3: #78829a;
  --a-brand: #0b66c3; --a-brand-2: #3b8cf0; --a-brand-hover: #0a58aa; --a-brand-on: #ffffff; --a-brand-soft: #e7f0fb;
  --a-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --t-blue: #0b66c3; --t-blue-bg: #e7f0fb;
  --t-amber: #a35f00; --t-amber-bg: #fdf1d9;
  --t-rose: #b4234a; --t-rose-bg: #fde8ee;
  --t-green: #13774a; --t-green-bg: #def5ea;
  --t-violet: #6a3fc4; --t-violet-bg: #efe9fb;
  --t-slate: #4a5568; --t-slate-bg: #e9ecf2;
  min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr);
  background: var(--a-bg); color: var(--a-text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  .app-shell {
    --a-bg: #0d1117; --a-surface: #151a23; --a-surface-2: #1a2030; --a-border: #262d3b; --a-border-strong: #364055;
    --a-text: #e7ebf3; --a-text-2: #b0b9ca; --a-text-3: #858fa4;
    --a-brand: #4ea4ff; --a-brand-2: #7cbcff; --a-brand-hover: #79baff; --a-brand-on: #04121f; --a-brand-soft: #14243b;
    --a-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
    --t-blue: #7cbcff; --t-blue-bg: #14243b;
    --t-amber: #f0b650; --t-amber-bg: #2d2210;
    --t-rose: #ff8fab; --t-rose-bg: #34131f;
    --t-green: #62d6a0; --t-green-bg: #0f2a1f;
    --t-violet: #b79bff; --t-violet-bg: #231a3d;
    --t-slate: #aab4c6; --t-slate-bg: #222a39;
  }
}
.app-shell .icon { flex: none; }
.app-shell h1, .app-shell h2, .app-shell p { margin-top: 0; }
.app-shell a { color: inherit; text-decoration: none; }
.app-shell :focus-visible { outline: 2px solid var(--a-brand); outline-offset: 2px; border-radius: 8px; }

/* Side bar */
.app-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px 16px; background: var(--a-surface); border-right: 1px solid var(--a-border); }
.app-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px; font-weight: 650; letter-spacing: -.01em; font-size: 16px; }
.app-shell .brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--a-brand-2), var(--a-brand)); box-shadow: 0 4px 12px rgba(11, 102, 195, .35); }
.app-nav { display: flex; flex-direction: column; gap: 4px; }
.app-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--a-text-2); font-weight: 500; transition: background .15s, color .15s; }
.app-link:hover { background: var(--a-surface-2); color: var(--a-text); }
.app-link.active { background: var(--a-brand-soft); color: var(--a-brand); font-weight: 600; }
.app-side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--a-border); border-radius: 14px; background: var(--a-surface-2); }
.app-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 650; font-size: 13px; letter-spacing: .02em; color: var(--a-brand); background: var(--a-brand-soft); border: 1px solid var(--a-border); }
.app-who { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.app-who strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-who span { font-size: 12px; color: var(--a-text-3); }
.app-signout { margin-left: auto; }
.app-signout button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--a-text-3); cursor: pointer; transition: background .15s, color .15s; }
.app-signout button:hover { background: var(--a-border); color: var(--a-text); }

/* Page */
.app-main { min-width: 0; padding: 34px clamp(20px, 4vw, 52px) 56px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 2px 0 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.025em; font-weight: 650; }
.eyebrow { margin: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--a-text-3); font-weight: 600; }

/* Pills and buttons */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--t-slate-bg); color: var(--t-slate); }
.pill-soft { background: var(--a-surface); border: 1px solid var(--a-border); color: var(--a-text-2); padding: 6px 12px; box-shadow: var(--a-shadow); }
.pill-soft .icon { color: var(--t-green); }
.pill-brand { background: var(--a-brand-soft); color: var(--a-brand); margin-right: 6px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 1px solid transparent; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: transform .1s, background .15s, box-shadow .15s; }
.btn-primary { background: #fff; color: #0a4d97; box-shadow: 0 6px 18px rgba(4, 30, 70, .28); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .72; cursor: not-allowed; }
.btn-ghost { margin-top: 10px; background: var(--a-surface); border-color: var(--a-border-strong); color: var(--a-text); }
.btn-ghost:hover { background: var(--a-surface-2); }

/* Hero */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: clamp(22px, 3.2vw, 34px); margin-bottom: 18px; border-radius: 20px; color: #eaf3ff; overflow: hidden; position: relative;
  background: radial-gradient(700px 320px at 0% -20%, #3b9bff 0%, rgba(59, 155, 255, 0) 60%), linear-gradient(135deg, #0c4a95 0%, #0a2f66 60%, #081f45 100%); box-shadow: var(--a-shadow); }
.hero::after { content: ""; position: absolute; right: -90px; bottom: -130px; width: 340px; height: 340px; border-radius: 50%; background: rgba(255, 255, 255, .06); pointer-events: none; }
.hero-text { position: relative; z-index: 1; max-width: 560px; }
.hero h2 { margin: 0 0 8px; font-size: clamp(21px, 2.4vw, 27px); line-height: 1.2; letter-spacing: -.02em; color: #fff; font-weight: 650; }
.hero p { margin: 0; color: #c3d8f6; }
.hero-actions { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hero-note { font-size: 12.5px; color: #a9c6ee; padding-left: 4px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 16px; box-shadow: var(--a-shadow); }
.stat-icon, .area-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; }
.stat > div { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.stat-num { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.stat-label { margin-top: 3px; font-size: 13px; color: var(--a-text-3); }
.tone-blue { background: var(--t-blue-bg); color: var(--t-blue); }
.tone-amber { background: var(--t-amber-bg); color: var(--t-amber); }
.tone-rose { background: var(--t-rose-bg); color: var(--t-rose); }
.tone-green { background: var(--t-green-bg); color: var(--t-green); }
.tone-violet { background: var(--t-violet-bg); color: var(--t-violet); }
.tone-slate { background: var(--t-slate-bg); color: var(--t-slate); }

/* Cards */
.grid-2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; margin-bottom: 14px; }
.card { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: 18px; box-shadow: var(--a-shadow); padding: 20px 22px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.area-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.area { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.area:hover { background: var(--a-surface-2); border-color: var(--a-border); }
.area-body { display: flex; flex-direction: column; min-width: 0; }
.area-body strong { font-weight: 600; }
.area-body span { font-size: 13.5px; color: var(--a-text-3); }
.area .pill { margin-left: auto; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 26px 12px; color: var(--a-text-3); font-size: 14px; }
.empty strong { color: var(--a-text); font-size: 15px; }
.empty-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 8px; border-radius: 16px; background: var(--a-brand-soft); color: var(--a-brand); }
.empty-lg { padding: 54px 16px; }
.empty-lg .empty-icon { width: 62px; height: 62px; border-radius: 20px; }
.empty-lg span:not(.empty-icon) { max-width: 420px; }

.account dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.account dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--a-text-3); font-weight: 600; margin-bottom: 4px; }
.account dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Narrow screens: the side bar becomes a top bar */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--a-border); }
  .app-nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; }
  .app-link { padding: 8px 12px; }
  .app-side-foot { margin: 0 0 0 auto; padding: 6px; border: 0; background: transparent; }
  .app-who { display: none; }
  .app-main { padding-top: 24px; }
  .account dl { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) { .stats { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .app-shell * { transition: none !important; } }
