/* PPC Navigator Portal: shared styles. Same design tokens as the Navigator product. */

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg-app:      #0A1220;
  --surface-0:   #101B2E;
  --surface-1:   #14213A;
  --surface-2:   #1A2B48;
  --surface-3:   #22365A;
  --hover:       #1E3358;
  --sel-bg:      #274B7C;
  --sel-edge:    #4DA3FF;
  --line-100:    #182741;
  --line-200:    #243A5E;
  --line-300:    #34507A;
  --ink-900:     #EAF0F9;
  --ink-700:     #C4D0E3;
  --ink-500:     #8A9CBB;
  --ink-300:     #5A6C8C;
  --brand:       #1F4F9A;
  --brand-hover: #2A63BF;
  --brand-deep:  #0F2A55;
  --accent:      #4DA3FF;
  --accent-text: #7CC0FF;
  --accent-soft: rgba(77,163,255,.14);
  --brand-cyan:  #35C4E8;
  --on-brand:    #FFFFFF;
  --on-brand-muted: #A9C4E8;
  --on-brand-line:  rgba(255,255,255,.14);
  --neutral-btn: #3B4D6B;
  --st-complete: #34C77B;  --st-complete-soft: rgba(52,199,123,.16);  --st-complete-line: rgba(52,199,123,.45);
  --st-progress: #F5B62B;  --st-progress-soft: rgba(245,182,43,.16);  --st-progress-line: rgba(245,182,43,.45);
  --st-notstart: #4C8DFF;  --st-notstart-soft: rgba(76,141,255,.16);
  --st-critical: #F0554F;  --st-critical-soft: rgba(240,85,79,.16);   --st-critical-line: rgba(240,85,79,.45);
  --st-warning:  #F58A2B;
  --font-ui: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: Consolas, "SF Mono", Menlo, monospace;
  --radius: 5px;
  --radius-lg: 8px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.35);
  --shadow-2: 0 8px 24px rgba(0,0,0,.45);
  --glow-accent: 0 0 0 3px rgba(77,163,255,.22);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg-app:      #EEF2F7;
  --surface-0:   #FFFFFF;
  --surface-1:   #F6F8FB;
  --surface-2:   #EDF1F6;
  --surface-3:   #E2E8F0;
  --hover:       #E7F0FC;
  --sel-bg:      #FFF3D6;
  --sel-edge:    #E08A1E;
  --line-100:    #EDF1F5;
  --line-200:    #DCE3EC;
  --line-300:    #C3CEDC;
  --ink-900:     #16213A;
  --ink-700:     #3A4A66;
  --ink-500:     #6B7A94;
  --ink-300:     #A7B3C6;
  --brand:       #1B3A6B;
  --brand-hover: #254E8C;
  --brand-deep:  #0F2A55;
  --accent:      #2A6FD6;
  --accent-text: #1B3A6B;
  --accent-soft: rgba(42,111,214,.12);
  --brand-cyan:  #1FA6CC;
  --on-brand:    #FFFFFF;
  --on-brand-muted: #B7CBE8;
  --on-brand-line:  rgba(255,255,255,.18);
  --neutral-btn: #6C757D;
  --st-complete: #2E9E5B;  --st-complete-soft: #E6F4EC;  --st-complete-line: #B9E0C8;
  --st-progress: #E08A1E;  --st-progress-soft: #FDF1E1;  --st-progress-line: #F3D8A8;
  --st-notstart: #4C8DFF;  --st-notstart-soft: #E8EFFC;
  --st-critical: #D03B3B;  --st-critical-soft: #FBE8E8;  --st-critical-line: #F0C4C4;
  --st-warning:  #E8740C;
  --shadow-1: 0 1px 2px rgba(11,30,61,.08);
  --shadow-2: 0 8px 24px rgba(11,30,61,.16);
  --glow-accent: 0 0 0 3px rgba(42,111,214,.18);
}

*{ box-sizing:border-box; }
html,body{ margin:0; }
body{ background:var(--bg-app); color:var(--ink-900); font-family:var(--font-ui); font-size:13px; line-height:1.45; min-height:100vh; display:flex; flex-direction:column; }
a{ color:var(--accent-text); }
.ic{ width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
[hidden]{ display:none !important; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){ *{ transition:none !important; animation:none !important; } }

/* header */
.hdr{ background:var(--brand); border-bottom:2px solid var(--brand-deep); padding:10px 22px; display:flex; align-items:center; gap:12px; flex-shrink:0; }
.brand{ display:flex; align-items:center; gap:10px; color:inherit; text-decoration:none; }
.brand-mark{ width:30px; height:30px; border-radius:8px; background:linear-gradient(135deg,var(--accent),var(--brand-cyan)); display:flex; align-items:center; justify-content:center; color:#fff; box-shadow:0 2px 8px rgba(77,163,255,.35); }
.brand-mark .ic{ width:17px; height:17px; stroke-width:2.2; }
.brand-name{ font-size:15px; font-weight:800; letter-spacing:1.4px; color:var(--on-brand); text-transform:uppercase; white-space:nowrap; }
.brand-name b{ color:var(--brand-cyan); font-weight:800; }
.hdr-sep{ width:1px; height:26px; background:var(--on-brand-line); }
.hdr-title{ font-size:14px; font-weight:700; color:var(--on-brand); }
.hdr-sub{ font-size:11px; color:var(--on-brand-muted); }
.hdr-right{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.hdr-nav{ display:flex; align-items:center; gap:2px; }
.hdr-nav a{ color:var(--on-brand-muted); text-decoration:none; font-size:12.5px; font-weight:600; padding:6px 10px; border-radius:var(--radius); }
.hdr-nav a:hover{ color:var(--on-brand); background:rgba(255,255,255,.08); }
.hdr-nav a.current{ color:var(--on-brand); background:rgba(255,255,255,.12); }
.hdr-user{ font-size:11.5px; color:var(--on-brand-muted); max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.theme-btn{ flex:none; width:32px; height:32px; border-radius:50%; border:1px solid var(--on-brand-line); background:transparent; color:var(--on-brand-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.theme-btn:hover{ color:var(--on-brand); border-color:var(--on-brand); }
.theme-btn .ic{ width:15px; height:15px; }
@media (max-width:720px){ .hdr{ padding:10px 16px; flex-wrap:wrap; } .hdr-sub, .hdr-sep, .hdr-user{ display:none; } .hdr-right{ margin-left:auto; } }

/* status pill (trial, plan, expired) */
.pill-status{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:20px; font-size:11.5px; font-weight:700; white-space:nowrap; border:1px solid transparent; }
.pill-status .dot{ width:7px; height:7px; border-radius:50%; background:currentColor; }
.pill-status.plan{ background:var(--st-complete-soft); color:var(--st-complete); border-color:var(--st-complete-line); }
.pill-status.trial{ background:var(--st-progress-soft); color:var(--st-progress); border-color:var(--st-progress-line); }
.pill-status.expired{ background:var(--st-critical-soft); color:var(--st-critical); border-color:var(--st-critical-line); }
.pill-status.admin{ background:var(--accent-soft); color:var(--accent-text); border-color:var(--line-300); }
.hdr .pill-status.plan{ color:#7FE3AC; } .hdr .pill-status.trial{ color:#FFD36B; } .hdr .pill-status.expired{ color:#FF9A96; }

/* layout */
.wrap{ width:100%; max-width:1180px; margin:0 auto; padding:22px 22px 10px; flex:1; }
.wrap.narrow{ max-width:560px; }
.wrap.auth{ max-width:420px; padding-top:48px; }
@media (max-width:560px){ .wrap{ padding:16px; } .wrap.auth{ padding-top:24px; } }
.grid2{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; align-items:start; }
@media (max-width:900px){ .grid2{ grid-template-columns:minmax(0,1fr); } }
.card{ background:var(--surface-0); border:1px solid var(--line-200); border-radius:var(--radius-lg); box-shadow:var(--shadow-1); overflow:hidden; }
.card + .card{ margin-top:18px; }
.card-hd{ display:flex; align-items:center; gap:10px; padding:12px 16px; background:var(--surface-2); border-bottom:1px solid var(--line-200); }
.card-hd h2{ margin:0; font-size:12px; font-weight:800; letter-spacing:.8px; text-transform:uppercase; color:var(--ink-700); }
.card-hd .aside{ margin-left:auto; font-size:11px; color:var(--ink-500); display:flex; gap:8px; align-items:center; }
.card-bd{ padding:16px; }
.num{ width:22px; height:22px; border-radius:50%; background:var(--accent-soft); color:var(--accent-text); font-weight:800; font-size:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.page-title{ margin:0 0 4px; font-size:20px; font-weight:800; letter-spacing:-.2px; }
.page-sub{ margin:0 0 18px; color:var(--ink-500); font-size:12.5px; }
.muted{ color:var(--ink-500); }
.small{ font-size:11.5px; }
.mono{ font-family:var(--font-mono); }
.right{ text-align:right; }
.tnum{ font-variant-numeric:tabular-nums; }

/* forms */
.fld{ margin-bottom:14px; }
.fld label{ display:block; font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--ink-500); margin-bottom:5px; }
.fld input, .fld select, .fld textarea{ width:100%; background:var(--surface-1); border:1px solid var(--line-300); color:var(--ink-900); border-radius:var(--radius); padding:8px 10px; font:inherit; font-size:13px; }
.fld textarea{ min-height:72px; resize:vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus{ outline:none; border-color:var(--accent); box-shadow:var(--glow-accent); }
.fld input:disabled{ opacity:.5; }
.fld input.bad{ border-color:var(--st-critical); box-shadow:0 0 0 3px var(--st-critical-soft); }
.hint{ font-size:11.5px; color:var(--ink-500); margin-top:5px; }
.hint a{ color:var(--accent-text); cursor:pointer; text-decoration:underline; }
.row2{ display:grid; grid-template-columns:180px minmax(0,1fr); gap:14px; align-items:start; }
.row2 .hint{ margin-top:22px; }
@media (max-width:520px){ .row2{ grid-template-columns:minmax(0,1fr); gap:0; } .row2 .hint{ margin-top:5px; } }
.actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.actions .spacer{ flex:1; }

/* buttons */
.btn{ border:none; border-radius:var(--radius); background:var(--brand); color:var(--on-brand); font:inherit; font-size:13.5px; font-weight:700; padding:10px 16px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; letter-spacing:.2px; text-decoration:none; white-space:nowrap; }
.btn.block{ width:100%; padding:12px 16px; font-size:14px; }
.btn:hover:not(:disabled){ background:var(--brand-hover); }
.btn:disabled{ opacity:.45; cursor:not-allowed; }
.btn.secondary{ background:var(--surface-2); color:var(--ink-700); border:1px solid var(--line-300); }
.btn.secondary:hover:not(:disabled){ background:var(--hover); color:var(--ink-900); }
.btn.danger{ background:transparent; color:var(--st-critical); border:1px solid var(--st-critical-line); }
.btn.danger:hover:not(:disabled){ background:var(--st-critical-soft); }
.btn.small{ padding:6px 10px; font-size:12px; }
.btn.ghost{ background:transparent; color:var(--accent-text); border:1px solid transparent; }
.btn.ghost:hover:not(:disabled){ background:var(--accent-soft); }
.link-btn{ background:none; border:none; padding:0; color:var(--accent-text); text-decoration:underline; cursor:pointer; font:inherit; }

/* messages */
.msg{ margin-top:12px; padding:10px 12px; border-radius:var(--radius); font-size:12.5px; border:1px solid var(--line-200); background:var(--surface-1); color:var(--ink-700); }
.msg.ok{ border-color:var(--st-complete-line); background:var(--st-complete-soft); color:var(--ink-900); }
.msg.err{ border-color:var(--st-critical-line); background:var(--st-critical-soft); color:var(--ink-900); }
.msg.warn{ border-color:var(--st-progress-line); background:var(--st-progress-soft); color:var(--ink-900); }
.msg[hidden]{ display:none; }
.notice{ padding:14px 16px; border-radius:var(--radius-lg); border:1px solid var(--line-200); background:var(--surface-1); margin-bottom:18px; display:flex; gap:12px; align-items:flex-start; }
.notice .ic{ width:20px; height:20px; margin-top:1px; }
.notice.warn{ border-color:var(--st-progress-line); background:var(--st-progress-soft); }
.notice.warn .ic{ color:var(--st-progress); }
.notice.err{ border-color:var(--st-critical-line); background:var(--st-critical-soft); }
.notice.err .ic{ color:var(--st-critical); }
.notice.ok{ border-color:var(--st-complete-line); background:var(--st-complete-soft); }
.notice.ok .ic{ color:var(--st-complete); }
.notice b{ display:block; font-size:13px; margin-bottom:2px; }
.notice p{ margin:0; color:var(--ink-700); }
.notice .act{ margin-left:auto; flex:none; }
.toast{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--brand); color:var(--on-brand); padding:8px 16px; border-radius:var(--radius); font-size:12.5px; box-shadow:var(--shadow-2); opacity:0; pointer-events:none; transition:opacity .2s; z-index:9999; }
.toast.show{ opacity:1; }
.toast.err{ background:var(--st-critical); }

/* tables */
table.sum{ width:100%; border-collapse:collapse; }
table.sum td{ padding:7px 2px; border-bottom:1px solid var(--line-100); vertical-align:top; }
table.sum tr:last-child td{ border-bottom:none; }
table.sum td.k{ color:var(--ink-500); width:40%; padding-right:12px; }
table.sum td.v{ color:var(--ink-900); font-weight:600; font-variant-numeric:tabular-nums; word-break:break-word; }
table.sum td.v .sub{ display:block; font-weight:400; color:var(--ink-500); font-size:11.5px; margin-top:1px; }
table.sum td.v.muted{ color:var(--ink-300); font-weight:400; }
.pill{ display:inline-block; padding:1px 7px; border-radius:10px; font-size:11px; font-weight:700; margin-right:4px; }
.pill.c{ background:var(--st-complete-soft); color:var(--st-complete); }
.pill.p{ background:var(--st-progress-soft); color:var(--st-progress); }
.pill.n{ background:var(--st-notstart-soft); color:var(--st-notstart); }
.pill.x{ background:var(--st-critical-soft); color:var(--st-critical); }
.pill.g{ background:var(--surface-2); color:var(--ink-500); }
.warn{ color:var(--st-warning); }
table.list{ width:100%; border-collapse:collapse; font-size:12.5px; }
table.list th{ text-align:left; font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--ink-500); padding:8px 10px; border-bottom:1px solid var(--line-200); white-space:nowrap; }
table.list td{ padding:9px 10px; border-bottom:1px solid var(--line-100); vertical-align:top; }
table.list tr:last-child td{ border-bottom:none; }
table.list tr:hover td{ background:var(--surface-1); }
table.list td.actions-cell{ white-space:nowrap; text-align:right; }
table.list .sub{ display:block; color:var(--ink-500); font-size:11.5px; font-weight:400; }
.table-scroll{ overflow:auto; }

/* project cards */
.proj-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:16px; }
.proj{ background:var(--surface-0); border:1px solid var(--line-200); border-radius:var(--radius-lg); box-shadow:var(--shadow-1); padding:16px; display:flex; flex-direction:column; gap:10px; min-width:0; }
.proj:hover{ border-color:var(--line-300); }
.proj .pname{ font-size:15px; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.proj .pshort{ color:var(--ink-500); font-size:11.5px; margin-top:-6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.proj .pstats{ display:grid; grid-template-columns:1fr 1fr; gap:4px 12px; font-size:12px; }
.proj .pstats span{ color:var(--ink-500); }
.proj .pstats b{ font-weight:600; font-variant-numeric:tabular-nums; }
.proj .pfoot{ display:flex; gap:8px; align-items:center; margin-top:auto; padding-top:6px; }
.proj .pfoot .when{ margin-left:auto; color:var(--ink-300); font-size:11px; white-space:nowrap; }
.proj.new{ border-style:dashed; border-color:var(--line-300); background:var(--surface-1); align-items:center; justify-content:center; text-align:center; cursor:pointer; min-height:170px; color:var(--ink-700); text-decoration:none; }
.proj.new:hover{ border-color:var(--accent); background:var(--hover); box-shadow:var(--glow-accent); }
.proj.new .ic{ width:28px; height:28px; color:var(--accent); stroke-width:1.8; }
.proj.new b{ font-size:14px; }
.proj.new span{ font-size:11.5px; color:var(--ink-500); }
.empty{ padding:36px 16px; text-align:center; color:var(--ink-500); }
.empty b{ display:block; color:var(--ink-900); font-size:14px; margin-bottom:4px; }

/* drop zone (viewer open panel) */
.drop{ border:1.5px dashed var(--line-300); border-radius:var(--radius-lg); background:var(--surface-1); padding:26px 16px; text-align:center; cursor:pointer; transition:border-color .15s, background .15s; outline:none; }
.drop:hover, .drop:focus-visible, .drop.over{ border-color:var(--accent); background:var(--hover); box-shadow:var(--glow-accent); }
.drop .ic{ width:28px; height:28px; color:var(--accent); stroke-width:1.8; }
.drop-big{ font-size:14px; font-weight:700; margin-top:8px; }
.drop-small{ font-size:11.5px; color:var(--ink-500); margin-top:4px; }
.file-line{ display:none; margin-top:12px; padding:10px 12px; border-radius:var(--radius); background:var(--surface-1); border:1px solid var(--line-200); align-items:center; gap:10px; }
.file-line.on{ display:flex; }
.file-line .fname{ font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.file-line .fmeta{ margin-left:auto; color:var(--ink-500); font-size:11.5px; white-space:nowrap; }
.file-line .ic{ color:var(--st-complete); }

/* footer */
.foot{ max-width:1180px; width:100%; margin:0 auto; padding:10px 22px 22px; font-size:11px; color:var(--ink-300); display:flex; gap:14px; flex-wrap:wrap; }
.foot a{ color:var(--ink-500); }

/* account status block */
.status-big{ display:flex; gap:16px; align-items:center; padding:16px; border-radius:var(--radius-lg); border:1px solid var(--line-200); background:var(--surface-1); }
.status-big .days{ font-size:34px; font-weight:800; line-height:1; font-variant-numeric:tabular-nums; }
.status-big .days small{ display:block; font-size:11px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:var(--ink-500); margin-top:4px; }
.status-big .txt b{ display:block; font-size:14px; }
.status-big .txt span{ color:var(--ink-500); font-size:12px; }
.status-big.plan .days{ color:var(--st-complete); }
.status-big.trial .days{ color:var(--st-progress); }
.status-big.expired .days{ color:var(--st-critical); }

/* loading */
.spinner{ width:18px; height:18px; border:2px solid var(--line-300); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; display:inline-block; vertical-align:middle; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.loading{ display:flex; align-items:center; gap:10px; color:var(--ink-500); padding:12px 0; }

/* viewer: portal bar above the Navigator */
.portal-bar{ flex:none; display:flex; align-items:center; gap:10px; padding:5px 12px; background:var(--surface-1); border-bottom:1px solid var(--line-200); font-family:var(--font-ui); font-size:12px; min-height:38px; }
.portal-bar .brand-name{ font-size:12px; letter-spacing:1px; color:var(--ink-700); }
.portal-bar .brand-name b{ color:var(--accent-text); }
.portal-bar .brand-mark{ width:22px; height:22px; border-radius:6px; }
.portal-bar .brand-mark .ic{ width:13px; height:13px; }
.portal-bar .pb-sep{ width:1px; height:20px; background:var(--line-300); }
.portal-bar .pb-name{ font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.portal-bar .pb-right{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.portal-bar .btn.small{ padding:5px 10px; font-size:12px; }
.portal-bar a.plain{ color:var(--ink-700); text-decoration:none; font-weight:600; padding:5px 8px; border-radius:var(--radius); }
.portal-bar a.plain:hover{ background:var(--hover); color:var(--ink-900); }
.portal-bar .pb-saved{ color:var(--st-complete); font-weight:700; font-size:11.5px; display:flex; align-items:center; gap:5px; }
.portal-bar .pb-saved .ic{ width:14px; height:14px; }
@media (max-width:720px){ .portal-bar .brand-name, .portal-bar .pb-sep{ display:none; } }

/* viewer: open panel (shown until a schedule is loaded) */
.open-panel{ flex:1; overflow:auto; background:var(--bg-app); font-family:var(--font-ui); font-size:13px; line-height:1.45; }
.open-panel .wrap{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-areas:"load sum" "set sum"; gap:18px; align-items:start; }
.open-panel .a-load{ grid-area:load; } .open-panel .a-sum{ grid-area:sum; } .open-panel .a-set{ grid-area:set; }
@media (max-width:900px){ .open-panel .wrap{ grid-template-columns:minmax(0,1fr); grid-template-areas:"load" "sum" "set"; } }
.open-panel .card{ margin:0; }
.open-panel .fld input{ font-size:13px; }
.open-panel .card-bd{ font-size:13px; }
.open-panel .fld label{ font-size:11px; }
.open-panel .hint{ font-size:11.5px; }
.open-panel .btn.block{ font-size:14px; }
