/* ForensicDeck web — pastel "Soft Surface" theme (mirrors Themes/PastelTheme.xaml) */
:root {
  --canvas-a: #F4E9E0; --canvas-b: #EAE2DA; --canvas-c: #CBD9D3;
  --surface: rgba(255,255,255,.90); --surface-solid: #FFFDFB; --surface-glass: rgba(255,255,255,.55);
  --sunken: #F6F2EE; --inspector: #FBF7F1;
  --card-border: rgba(255,255,255,.7); --input-border: #E2D9D0; --divider: #ECE5DE; --focus: #5BAEAD;
  --text: #2D3436; --text-2: #5B666D; --muted: #6B757D; --inspector-text: #2F4F5A;
  --teal: #2C6E73; --blue: #2F6E95; --rose: #B23A57; --green: #2A7D59;
  --primary-a: #3A8A8E; --primary-b: #33768F; --primary-hover-a: #2F7A7E; --primary-hover-b: #2A6680;
  --mint-soft: #DCEFE8; --hover-soft: #E4F2EC;
  --tint-teal: linear-gradient(135deg, rgba(255,255,255,.95), rgba(220,239,232,.9));
  --tint-sky: linear-gradient(135deg, rgba(255,255,255,.95), rgba(217,233,244,.9));
  --tint-peach: linear-gradient(135deg, rgba(255,255,255,.95), rgba(248,225,214,.9));
  --tint-olive: linear-gradient(135deg, rgba(255,255,255,.95), rgba(235,239,207,.9));
  --shadow: 0 10px 30px rgba(125,110,98,.14);
  --shadow-btn: 0 4px 14px rgba(47,110,117,.22);
  --radius: 22px; --radius-pill: 999px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); font-size: 14px; color: var(--text);
  background: linear-gradient(135deg, var(--canvas-a) 0%, var(--canvas-b) 48%, var(--canvas-c) 100%) fixed;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* decorative waves */
.waves { position: fixed; inset: 0; z-index: 0; pointer-events: none; width: 100%; height: 100%; }
#app { position: relative; z-index: 1; min-height: 100%; }

a { color: var(--teal); }
h1, h2, h3 { margin: 0; font-weight: 600; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: 68px 1fr auto; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-solid); box-shadow: var(--shadow); display: grid; place-items: center; }
.brand-logo img { width: 26px; height: 26px; }
.brand-name { font-size: 19px; letter-spacing: .01em; }
.brand-name b { color: var(--teal); font-weight: 700; }
.brand-name span { color: var(--text); font-weight: 300; }
.topbar .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--surface-solid); border: 1px solid var(--input-border); font-size: 12px; }
.pill.glass { background: var(--surface-glass); border-color: var(--card-border); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff, #9AD6D1 55%, #5FB2B0); flex: none; }
.dot.bad { background: radial-gradient(circle at 32% 28%, #fff, #F2C6D1 55%, #B23A57); }

.sidebar { margin: 6px 4px 12px 20px; padding: 20px 14px; border-radius: 26px; background: var(--surface-glass); border: 1px solid var(--card-border); display: flex; flex-direction: column; gap: 6px; }
.nav-btn { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 22px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13px; transition: background .15s; }
.nav-btn:hover { background: rgba(255,255,255,.6); }
.nav-btn.active { background: var(--mint-soft); color: var(--teal); }
.nav-btn svg { width: 18px; height: 18px; flex: none; }
.sidebar .grow { flex: 1; }

.main { padding: 6px 24px 12px 18px; min-width: 0; }
.footer { grid-column: 1 / -1; margin: 0 24px 10px 20px; padding: 10px 18px; border-radius: 18px; background: var(--surface-glass); border: 1px solid var(--card-border); display: flex; gap: 12px; align-items: center; font: 12px var(--mono); color: var(--text-2); }
.footer .status { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* mobile bottom nav */
.bottom-nav { display: none; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.tint-teal { background: var(--tint-teal); } .tint-sky { background: var(--tint-sky); }
.tint-peach { background: var(--tint-peach); } .tint-olive { background: var(--tint-olive); }
.sphere { width: 30px; height: 30px; border-radius: 50%; flex: none; box-shadow: 0 3px 10px rgba(125,110,98,.18); }
.sphere.teal { background: radial-gradient(circle at 32% 28%, #fff, #9AD6D1 55%, #5FB2B0); }
.sphere.sky { background: radial-gradient(circle at 32% 28%, #fff, #B5D3E7 55%, #7EA8C8); }
.sphere.peach { background: radial-gradient(circle at 32% 28%, #fff, #F4D2C4 55%, #E4A9B6); }
.sphere.olive { background: radial-gradient(circle at 32% 28%, #fff, #DCE2AE 55%, #B5C26E); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric { position: relative; min-height: 100px; }
.metric .sphere { position: absolute; top: 16px; right: 18px; }
.metric .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.metric .sub { font-size: 12px; color: var(--text-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }

.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 12px; color: var(--text-2); margin: 0 0 5px 4px; }
input[type=text], input[type=password], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 13px; color: var(--text); background: var(--sunken);
  border: 1px solid var(--input-border); border-radius: 14px; padding: 9px 12px; outline: none; transition: border-color .15s, background .15s;
}
textarea { min-height: 70px; resize: vertical; }
/* Themed dropdown: drop WebKit/Blink native chrome (doubled border on iOS) and draw our own chevron. */
select {
  -webkit-appearance: none; appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232C6E73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
input:focus, select:focus, textarea:focus { border-color: var(--focus); background: var(--surface-solid); }
input[type=file] { font-size: 13px; max-width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; min-width: 0; }
.form-error { color: var(--rose); font-size: 13px; min-height: 18px; margin: 6px 4px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  border-radius: var(--radius-pill); padding: 10px 20px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; text-decoration: none; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary-a), var(--primary-b)); box-shadow: var(--shadow-btn); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--primary-hover-a), var(--primary-hover-b)); }
.btn-secondary { color: var(--teal); background: var(--surface-solid); border-color: var(--input-border); }
.btn-secondary:hover:not(:disabled) { background: var(--hover-soft); border-color: var(--focus); }
.btn-danger { color: var(--rose); background: var(--surface-solid); border-color: #EBC9D2; }
.btn-danger:hover:not(:disabled) { background: #FBEAEE; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; } /* WebKit collapses unsized inline SVG to 0×0 */
.btn-sm { padding: 6px 14px; font-size: 12px; }
:focus-visible { outline: 3px solid rgba(91,174,173,.55); outline-offset: 2px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border-radius: 14px; max-height: 60vh; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { position: sticky; top: 0; background: #F3EEE8; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
tbody tr:nth-child(even) { background: rgba(246,241,235,.5); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #EEF7F3; }
tbody tr.selected { background: var(--mint-soft) !important; }
td.hash { font-family: var(--mono); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.wrap { white-space: normal; min-width: 220px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

.chip { display: inline-block; border-radius: 10px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.sev-Critical { background: #F7D5DE; color: #A3304E; } .sev-High { background: #F9E2CF; color: #9A5220; }
.sev-Medium { background: #EFEBC5; color: #6E5D0E; } .sev-Low { background: #D5E8F2; color: #2C6A8C; }
.sev-Informational { background: #ECE8E4; color: #5B666D; }
.status-Active, .status-Verified, .status-true { background: #DCEFE8; color: var(--green); }
.status-Closed, .status-Archived { background: #ECE8E4; color: #5B666D; }
.status-Tampered, .status-false, .status-Failed { background: #F7D5DE; color: var(--rose); }

.inspector { font: 12.5px/1.55 var(--mono); color: var(--inspector-text); background: var(--inspector); border: 1px solid var(--input-border); border-radius: 14px; padding: 14px 16px; white-space: pre-wrap; word-break: break-word; min-height: 120px; max-height: 40vh; overflow: auto; margin: 0; }

.progress { height: 10px; border-radius: 5px; background: #ECE5DE; overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #9AD6D1, #86AFCD); transition: width .2s; }

.ledger { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ledger .sphere { width: 44px; height: 44px; }
.ledger .msg { font: 700 15px var(--mono); }
.ledger.ok { border: 1.5px solid var(--green); } .ledger.bad { border: 1.5px solid var(--rose); }
.ledger .ok-text { color: var(--green); } .ledger .bad-text { color: var(--rose); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; font-size: 12px; }
.kv dt { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; }
.kv dd { margin: 0; font-family: var(--mono); word-break: break-all; }

/* ---------- auth screens ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 18px; }
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.auth-card p.lead { text-align: center; color: var(--text-2); margin: 0 0 18px; }

/* ---------- toasts & dialogs ---------- */
.toasts { position: fixed; right: 20px; bottom: 70px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface-solid); border: 1px solid var(--input-border); border-left: 4px solid var(--focus); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px; }
.toast.error { border-left-color: var(--rose); }
dialog { border: none; border-radius: var(--radius); padding: 22px; background: var(--surface-solid); box-shadow: 0 20px 60px rgba(60,50,40,.25); width: min(480px, calc(100vw - 32px)); color: var(--text); }
dialog::backdrop { background: rgba(60,60,60,.25); backdrop-filter: blur(2px); }
dialog h2 { font-size: 16px; margin-bottom: 14px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.install-banner { display: flex; align-items: center; gap: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 60px 1fr auto; padding-bottom: 76px; }
  .topbar { padding: 0 14px; gap: 8px; min-width: 0; }
  .brand-name { font-size: 17px; }
  .topbar .pill { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  .topbar .pill > .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .btn-sm { padding: 6px 10px; flex: none; }
  .topbar .hide-mobile { display: none; }
  .sidebar { display: none; }
  .main { padding: 4px 14px 12px; }
  .footer { margin: 0 14px 10px; font-size: 11px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric .value { font-size: 20px; }
  .card-head > .sphere { display: none; } /* decorative; would wrap onto its own line */
  .card { padding: 16px; }
  .btn { padding: 11px 18px; }
  .row > .btn { flex: 1 1 auto; }
  .bottom-nav { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; justify-content: space-around;
    background: rgba(255,255,255,.92); border: 1px solid var(--card-border); border-radius: 26px; box-shadow: var(--shadow); padding: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--text-2); text-decoration: none; padding: 6px 2px; border-radius: 18px; }
  .bottom-nav a.active { background: var(--mint-soft); color: var(--teal); }
  .bottom-nav svg { width: 20px; height: 20px; }
  .toasts { bottom: 96px; right: 12px; }
}
@media (max-width: 440px) {
  .topbar .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* utilities */
.rose { color: var(--rose); }
.mt { margin-top: 10px; }
.progress-block { margin: 14px 0 6px; }
.grow-1 { flex: 1 1 300px; min-width: 0; }
hr { border: none; border-top: 1px solid var(--divider); margin: 16px 0; }

