/* ===========================================================================
   HARBOUR — SharePoint archive
   Same "ops console" system as Beacon, Compass and Content Flow (Space
   Grotesk / JetBrains Mono, panel + form + table conventions; copied from
   contentflow.css) with its own accent - sea teal - and the Harbour additions
   (file pickers, progress meters) at the end of this file.
   =========================================================================== */

:root {
  --ink:        #0e1218;   /* page */
  --panel:      #161c26;   /* raised surface */
  --panel-2:    #1c232f;   /* inputs / nested */
  --line:       #28303d;   /* hairlines */
  --text:       #e7ecf3;
  --muted:      #8b97a8;

  --accent:      #2dd4bf;   /* brand — Harbour teal */
  --accent-soft: #99f6e4;

  --ok:         #2fb87a;
  --warning:    #f5a524;
  --critical:   #e5484d;
  --offline:    #6b7280;

  --risk-low:      var(--ok);
  --risk-medium:   var(--warning);
  --risk-high:     #ff8a3d;
  --risk-critical: var(--critical);

  --type-standard:  #6b7280;
  --type-normal:    var(--accent);
  --type-emergency: var(--critical);

  --radius:     12px;
  --shadow:     0 6px 24px rgba(0,0,0,.35);

  /* surfaces/text that differ between themes (see the light palette below) */
  --glow:          #182231;               /* page background highlight */
  --topbar-bg:     rgba(14,18,24,.7);
  --on-accent:     #042f2e;               /* text on accent / ok / critical buttons */
  --on-ok:         #06231a;
  --on-critical:   #2a0607;
  --ok-hover:      #45d996;
  --critical-hover:#ff6167;
  --critical-text: #ffb3b5;               /* error text on a tinted background */
  --focus-ring:    rgba(45,212,191,.18);
  --card-shadow:   0 20px 60px rgba(0,0,0,.4);
  color-scheme: dark;                     /* native controls, scrollbars, date pickers */
}

/* Light theme - <html data-theme="light">, chosen per account from the account
   menu (top right). 'auto' follows the device's setting: the same palette,
   applied when the browser reports a light preference. Status/brand hues are
   deepened so they keep enough contrast as text on white. The two blocks must
   stay identical. */
:root[data-theme="light"] {
  --ink: #eef2f7; --panel: #ffffff; --panel-2: #f4f6fa; --line: #d8dfe9;
  --text: #142033; --muted: #5a6679;
  --accent: #0f766e; --accent-soft: #115e59;
  --ok: #188454; --warning: #9a6a00; --critical: #c9302f; --offline: #6b7280;
  --risk-high: #c25a12; --type-standard: #5b6472;
  --shadow: 0 6px 20px rgba(20,30,50,.08);
  --glow: #ffffff; --topbar-bg: rgba(255,255,255,.82);
  --on-accent: #ffffff; --on-ok: #ffffff; --on-critical: #ffffff;
  --ok-hover: #1f9d63; --critical-hover: #e0413f; --critical-text: #a3232a;
  --focus-ring: rgba(15,118,110,.22); --card-shadow: 0 20px 50px rgba(20,30,50,.14);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --ink: #eef2f7; --panel: #ffffff; --panel-2: #f4f6fa; --line: #d8dfe9;
    --text: #142033; --muted: #5a6679;
    --accent: #0f766e; --accent-soft: #115e59;
    --ok: #188454; --warning: #9a6a00; --critical: #c9302f; --offline: #6b7280;
    --risk-high: #c25a12; --type-standard: #5b6472;
    --shadow: 0 6px 20px rgba(20,30,50,.08);
    --glow: #ffffff; --topbar-bg: rgba(255,255,255,.82);
    --on-accent: #ffffff; --on-ok: #ffffff; --on-critical: #ffffff;
    --ok-hover: #1f9d63; --critical-hover: #e0413f; --critical-text: #a3232a;
    --focus-ring: rgba(15,118,110,.22); --card-shadow: 0 20px 50px rgba(20,30,50,.14);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 70% -10%, var(--glow) 0%, var(--ink) 55%);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.muted { color: var(--muted); }
.empty-dash { font-family: "Space Grotesk", system-ui, sans-serif; } /* same dash in mono columns as elsewhere */

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: radial-gradient(circle at 35% 30%, rgba(45,212,191,.22), transparent 70%);
  box-shadow: 0 0 10px 1px rgba(45,212,191,.35);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-sep { width: 1px; height: 22px; background: var(--line); }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: .04em; white-space: nowrap; }
.brand-tag  { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 1100px) { .brand-tag, .brand-sep { display: none; } }

.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link {
  color: var(--muted); text-decoration: none;
  padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.is-active { color: var(--text); background: var(--panel); box-shadow: inset 0 -2px 0 var(--accent); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 28px; }

/* ---- flash ---- */
.flash {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 8px; margin-bottom: 22px;
}

/* ---- summary strip ---- */
.summary {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  justify-content: space-between; margin-bottom: 26px;
}
.summary-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.stat b { color: var(--text); font-size: 16px; }
.stat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.stat--draft::before       { background: var(--offline); }
.stat--submitted::before   { background: var(--warning); }
.stat--approved::before    { background: var(--ok); }
.stat--rejected::before    { background: var(--critical); }
.stat--in-progress::before { background: var(--accent); }
.stat--implemented::before { background: var(--ok); }
.stat--closed::before      { background: var(--offline); }
.stat--mine::before        { background: var(--accent-soft); }

a.stat { text-decoration: none; cursor: pointer; transition: opacity .15s, border-color .15s; }
a.stat:hover { border-color: var(--muted); }
a.stat.is-off { opacity: .38; }
a.stat.is-off b { color: var(--muted); }
.filter-reset { color: var(--accent-soft); text-decoration: none; }
.filter-reset:hover { text-decoration: underline; }
.summary-meta { font-size: 13px; color: var(--muted); }

/* ---- dashboard cards ---- */
.dash-grid {
  display: grid; gap: 16px; margin-bottom: 30px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.dash-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.dash-card h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.dash-card .big { font-size: 32px; font-weight: 700; font-family: "JetBrains Mono", monospace; }
.dash-card .big.accent { color: var(--accent-soft); }
.dash-card .big.warn { color: var(--warning); }
.dash-card p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.dash-card a.dash-link { color: var(--accent-soft); text-decoration: none; font-size: 13px; }
.dash-card a.dash-link:hover { text-decoration: underline; }

.section-title { font-size: 16px; margin: 30px 0 12px; }

/* ---- admin pages ---- */
.page-head { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; }
.page-head-text { flex: 1; min-width: 240px; }

.cols { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.cols--wide { grid-template-columns: 1fr; }
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 20px; }
.panel h2 { margin: 0 0 16px; font-size: 16px; }
.panel--narrow { max-width: 460px; }

/* ---- forms ---- */
.form { display: flex; flex-direction: column; gap: 13px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.form-row { display: flex; gap: 13px; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 160px; }
.form-row label.narrow { flex: 0 0 140px; }
/* Filter bars: a single row of fields, buttons and checkboxes lined up on the bottom edge. */
.form.filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form.filters .check { padding-bottom: 10px; }
.form.filters .narrow { flex: 0 0 170px; }
.form input, .form select, .form textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 9px 11px; font: inherit; font-size: 14px;
  width: 100%; min-width: 0;
}
.form textarea { resize: vertical; min-height: 64px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
.form .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.form .check input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); border: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 8px; text-decoration: none;
}
.btn:hover { background: var(--accent-soft); }
.btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn--ghost:hover { color: var(--text); background: var(--panel-2); }
.btn--ok { background: var(--ok); color: var(--on-ok); }
.btn--ok:hover { background: var(--ok-hover); }
.btn--danger { background: var(--critical); color: var(--on-critical); }
.btn--danger:hover { background: var(--critical-hover); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-clickable:hover { background: var(--panel-2); }
.table .num { text-align: right; }
.row-actions { text-align: right; white-space: nowrap; } /* stays a table cell, so it lines up with the row */
.row-actions > * + * { margin-left: 14px; }
.row-actions a { color: var(--accent-soft); text-decoration: none; font-size: 13px; }
.row-actions a:hover { text-decoration: underline; }
.row-actions form { display: inline; margin: 0; }
.link-danger { background: none; border: none; color: var(--critical); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
.link-danger:hover { text-decoration: underline; }

/* ---- pills (status / risk / type) ---- */
.pill { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill--draft       { background: rgba(139,151,168,.15); color: var(--muted); }
.pill--submitted   { background: rgba(245,165,36,.15);  color: var(--warning); }
.pill--approved    { background: rgba(47,184,122,.15);  color: var(--ok); }
.pill--rejected    { background: rgba(229,72,77,.15);   color: var(--critical); }
.pill--in-progress { background: rgba(45,212,191,.15);  color: var(--accent-soft); }
.pill--implemented { background: rgba(47,184,122,.15);  color: var(--ok); }
.pill--backed-out  { background: rgba(229,72,77,.15);   color: var(--critical); }
.pill--closed      { background: rgba(139,151,168,.15); color: var(--muted); }
.pill--cancelled   { background: rgba(139,151,168,.15); color: var(--muted); text-decoration: line-through; }

.pill--risk-low      { background: rgba(47,184,122,.15); color: var(--ok); }
.pill--risk-medium   { background: rgba(245,165,36,.15); color: var(--warning); }
.pill--risk-high     { background: rgba(255,138,61,.16); color: var(--risk-high); }
.pill--risk-critical { background: rgba(229,72,77,.15);  color: var(--critical); }

.pill--type-standard  { background: rgba(107,114,128,.18); color: var(--type-standard); }
.pill--type-normal    { background: rgba(45,212,191,.15);  color: var(--accent-soft); }
.pill--type-emergency { background: rgba(229,72,77,.15);   color: var(--critical); }

/* ---- empty state ---- */
.empty { text-align: center; padding: 60px 20px; }
.empty h2 { margin: 0 0 8px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }

/* ---- settings: sub-nav, manage cards ---- */
.subnav {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 22px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.subnav-link {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 6px 13px; border-radius: 8px;
}
.subnav-link:hover { color: var(--text); background: var(--panel); }
.subnav-link.is-active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }

.field-hint { display: block; font-size: 12px; margin-top: 2px; }
.flag {
  font-family: "Space Grotesk", sans-serif; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  background: rgba(245,165,36,.15); color: var(--warning);
  padding: 2px 6px; border-radius: 5px; vertical-align: middle;
}
.flag--danger, .flag--critical { background: rgba(220,53,69,.15); color: var(--critical); }
.flag--warning { background: rgba(245,165,36,.15); color: var(--warning); }
.flag--ok { background: rgba(47,184,122,.15); color: var(--ok); }
.flag--muted, .flag--unmonitored { background: var(--panel-2); color: var(--muted); }

/* ---- Settings > Developer (tabs, banner) ---- */
.page-tabs { display: flex; gap: 2px; margin: 0 0 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.page-tab {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.page-tab:hover { color: var(--text); }
.page-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab-intro { margin: 0 0 18px; }
.migration-banner {
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 16px; margin-bottom: 22px; font-size: 14px;
}
.migration-banner a { margin-left: 8px; font-weight: 600; color: var(--accent-soft); }
.migration-banner--error { border-color: var(--critical); background: rgba(229,72,77,.10); }
.migration-banner--warn  { border-color: var(--warning);  background: rgba(245,165,36,.10); }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 0; text-decoration: none; }
.link:hover { text-decoration: underline; }
.chip {
  display: inline-flex; align-items: center; padding: 6px 13px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  text-decoration: none; font-size: 13px;
}
.chip--on { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.manage-grid--hub { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.manage-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 16px; text-decoration: none; color: var(--text);
  transition: border-color .15s, color .15s;
}
.manage-card:hover { border-color: var(--accent); color: var(--accent-soft); }
.manage-card svg { width: 30px; height: 30px; color: var(--accent-soft); }
.manage-card:hover svg { color: var(--accent); }
.manage-card-title { font-weight: 600; font-size: 14px; color: var(--text); }
.manage-card:hover .manage-card-title { color: var(--text); }

/* ---- login + auth ---- */
.login-body {
  min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 600px at 50% -10%, rgba(45,212,191,.10), transparent), var(--ink);
}
.login-card {
  width: 380px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 30px 28px; box-shadow: var(--card-shadow);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-brand .brand-name { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .5px; }
.login-tag { margin: 4px 0 20px; font-size: 13px; }
.login-error {
  background: rgba(229,72,77,.12); border: 1px solid rgba(229,72,77,.4); color: var(--critical-text);
  padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}
.login-form .btn.login-submit { width: 100%; justify-content: center; margin-top: 4px; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0 14px; }
.login-or span { white-space: nowrap; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-ms { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 9px; }
.login-sso { text-align: center; }
.ms-logo { width: 16px; height: 16px; display: block; }
.login-logo { display: inline-flex; margin-bottom: 18px; color: var(--accent); }
.login-logo svg { width: 42px; height: 42px; }

/* current user menu: click the pill for theme / sign out */
.nav-account { position: relative; margin-left: 10px; font-size: 13px; line-height: 1; }
.nav-user {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2);
  color: var(--text); white-space: nowrap; font: inherit; cursor: pointer;
}
.nav-user:hover { border-color: var(--muted); }
.nav-user-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px 1px rgba(47,184,122,.6); }
.nav-role { color: var(--muted); font-weight: 400; }
.nav-caret { width: 13px; height: 13px; opacity: .6; margin-left: 1px; }
.account-dropdown[hidden] { display: none; }
.account-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 220px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 4px;
}
.account-dropdown-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 2px 6px 4px; }
.theme-toggle { display: flex; gap: 6px; margin-bottom: 6px; }
.theme-toggle form { flex: 1; margin: 0; }
.theme-opt {
  width: 100%; padding: 6px 0; font: 500 13px "Space Grotesk", sans-serif; cursor: pointer;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
}
.theme-opt:hover { color: var(--text); }
.theme-opt.is-active { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.account-dropdown-item {
  display: block; padding: 7px 6px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 13.5px;
}
.account-dropdown-item:hover { background: var(--panel-2); }
.account-dropdown-item--danger:hover { color: var(--critical); }

/* generic fieldset (device as-built groups, etc.) */
.fields { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; margin: 2px 0; }
.fields legend { padding: 0 6px; font-size: 13px; color: var(--muted); }

/* documents list (device attachments) */
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.doc-item a { color: var(--accent-soft); text-decoration: none; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .doc-meta { font-size: 12px; color: var(--muted); flex: none; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  .wrap { padding: 18px; }
  .cols { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Shared additions (from Content Flow)
   =========================================================================== */

/* ---- small utilities ---- */
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.text-warning { color: var(--warning); }
.tight { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.plain-list a, .table td a, .crumbs a, .history-list a { color: var(--accent-soft); text-decoration: none; }
.plain-list a:hover, .table td a:hover, .crumbs a:hover, .history-list a:hover { text-decoration: underline; }
.crumbs { margin: 0 0 6px; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cols--even { grid-template-columns: 1fr 1fr; }
.cols--reader { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 900px) { .cols--even, .cols--reader { grid-template-columns: 1fr; } }

/* ---- browse ---- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input[type=search], .head-actions select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 11px; font: inherit; font-size: 14px;
}
.toolbar input[type=search] { min-width: 220px; flex: 1; max-width: 360px; }
.toolbar-spacer { flex: 1; }


.table--kv td { padding: 7px 4px; font-size: 13.5px; }
.table--kv td:first-child { width: 42%; }
.history-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.history-list li { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: 7px; font-size: 13.5px; }
.history-list li.is-active { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }

/* ---- upload preview ---- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.kpi-n { font: 600 17px "JetBrains Mono", monospace; }
.kpi-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi--warn { border-color: color-mix(in srgb, var(--warning) 55%, var(--line)); }
.kpi--warn .kpi-n { color: var(--warning); }
.kpi--bad { border-color: color-mix(in srgb, var(--critical) 55%, var(--line)); }
.kpi--bad .kpi-n { color: var(--critical); }

.notice {
  padding: 9px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.notice--warn { background: rgba(245,165,36,.10); border-color: rgba(245,165,36,.35); }
.notice--bad { background: rgba(229,72,77,.10); border-color: rgba(229,72,77,.4); color: var(--critical-text); }
.notice a { color: var(--accent-soft); }

.confirm-panel { margin-bottom: 18px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.confirm-row { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.confirm-form { flex: 1; min-width: 300px; }
.confirm-side { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form--inline { flex-direction: row; align-items: flex-end; }

.entry-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.entry { border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.entry > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; font-size: 14px;
}
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.entry--warn { border-left: 3px solid var(--warning); }
.entry--bad { border-left: 3px solid var(--critical); }
.entry--ok { border-left: 3px solid var(--ok); }
.entry-date { flex: 0 0 120px; color: var(--muted); font-size: 12.5px; }
.entry-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.entry-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.entry-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.entry-body .notice:first-child { margin-top: 12px; }
@media (max-width: 600px) { .entry > summary { flex-wrap: wrap; gap: 6px 12px; } .entry-date { flex-basis: auto; } }

/* ---- sign-in (Microsoft only) ---- */
.login-sso--only { display: flex; flex-direction: column; gap: 12px; }
.login-sso--only .field-hint { margin: 0; }



/* ===========================================================================
   Shared additions (from Trust)
   =========================================================================== */
[hidden] { display: none !important; }
.text-danger { color: var(--critical); font-size: 12.5px; }
.req { color: var(--accent); }
.grow { flex: 1; align-self: center; }
.pad { padding: 18px 20px; margin: 0; }
.panel--flush { padding: 0; overflow-x: auto; }
.panel--flush .table th:first-child, .panel--flush .table td:first-child { padding-left: 18px; }
.panel--flush .table th:last-child, .panel--flush .table td:last-child { padding-right: 18px; }
.panel--danger { border-color: color-mix(in srgb, var(--critical) 40%, var(--line)); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel-head a { color: var(--accent-soft); text-decoration: none; }
.sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; font-weight: 600; }
.notes-text { margin: 0 0 12px; font-size: 14px; }
.table--compact td, .table--compact th { padding: 7px 8px; font-size: 13.5px; }
.table tfoot td { border-top: 1px solid var(--line); border-bottom: none; }
.table tr.is-void td { opacity: .55; }
.table tr.is-muted td { color: var(--muted); }
.form-wide { max-width: 860px; }
.danger-zone { margin: 14px 0 0; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.notice { margin-bottom: 16px; }

/* Dashboard */
.kpi-row--big .kpi-n { font-size: 22px; }
.kpi-sub { font-size: 12px; }
.kpi-sub a { color: var(--accent-soft); text-decoration: none; }
.cols--dash { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); margin-bottom: 20px; }
@media (max-width: 900px) { .cols--dash { grid-template-columns: 1fr; } }

.audit-details summary { cursor: pointer; margin-top: 4px; }
.audit-details s { color: var(--muted); }

/* Phones: grid columns may shrink below their tables (which then scroll inside their panel), and the nav wraps. */
.cols > *, .cols--dash > * { min-width: 0; }
.panel { min-width: 0; overflow-x: auto; }
.form-wide.panel { overflow: visible; } 
.table--kv td:last-child { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .nav { flex-wrap: wrap; margin-left: 0; }
  .nav-account { margin-left: 0; }
}

/* ===========================================================================
   Harbour additions
   =========================================================================== */
.kpi-row { margin-bottom: 20px; }
.cols--even { margin-bottom: 20px; }

/* Search on the home page */
.search-hero { display: flex; gap: 10px; margin: 0 0 20px; }
.search-hero input { flex: 1; font-size: 16px; padding: 12px 14px; }

/* Breadcrumbs */
.crumbs { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.crumbs a { color: var(--accent-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* File and folder icons */
.ico { width: 18px; height: 18px; vertical-align: -4px; flex: 0 0 auto; color: var(--muted); }
.ico--folder { color: var(--accent); }
.ico--image { color: #a78bfa; }
.ico--video { color: #f472b6; }
.ico--audio { color: #fbbf24; }
.ico--sheet { color: #34d399; }
.ico--slides { color: #fb923c; }
.ico--doc { color: #60a5fa; }
.item-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.item-link:hover { color: var(--accent-soft); }

/* Picking files and folders (tick boxes + a sticky action bar) */
.pick-bar { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pick-count { font-size: 13.5px; }
.pick-table th.pick, .pick-table td.pick { width: 34px; }
.pick-table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.pick-table tbody tr:has(input:checked) td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pick-table th a { color: inherit; text-decoration: none; }
.pick-table th a.is-sorted { color: var(--accent-soft); }
.pick-table th a.is-sorted::after { content: ' ▾'; }
.is-stale td:nth-child(4) { color: var(--warning); }
.stale-key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--warning); vertical-align: 0; }

/* Progress / storage meters */
.meter { height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin: 6px 0 10px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }
.meter--big { height: 14px; }
.job-status { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Confirm dialog (delete from archive) */
.confirm-dialog { max-width: 460px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text);
  box-shadow: var(--card-shadow); padding: 22px; }
.confirm-dialog::backdrop { background: rgba(0,0,0,.5); }
.confirm-dialog h2 { margin-top: 0; }
.confirm-dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin: 12px 0; }

.fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.form .fields label.check, .form label.check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--text); font-size: 14px; }
.form label.check input { width: auto; margin-top: 3px; }

@media (max-width: 720px) {
  .pick-bar { top: 0; }
  .search-hero { flex-direction: column; }
}
.page-head .muted a { color: var(--accent-soft); }
