@font-face { font-family: "Inter"; src: url("/static/fonts/Inter-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/Inter-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/Inter-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/Inter-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/IBMPlexMono-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/static/fonts/IBMPlexMono-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --navy: #0A1E2C;
  --navy-2: #102A3B;
  --teal: #0E8C86;
  --teal-dark: #0A746F;
  --aqua: #2FB6A8;
  --bg: #F5F7F8;
  --card: #FFFFFF;
  --ink: #16232F;
  --ink-2: #33424F;
  --muted: #6C7A87;
  --faint: #93A0AC;
  --line: #E2E8EC;
  --line-2: #EDF1F3;
  --sand: #F4F0E8;
  --amber: #C9A227;
  --rust: #C2542F;
  --green: #2F7D5E;
  --blue: #3C6E9F;
  --shadow: 0 1px 2px rgba(10,30,44,.05), 0 8px 24px -12px rgba(10,30,44,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13.5px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: 25px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
.mono { font-family: "IBM Plex Mono", monospace; font-size: .93em; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------------- hosted demo notice ---------------- */
.demo-strip {
  position: fixed; inset: 0 0 auto 0; z-index: 40; min-height: 34px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 7px 18px; background: #0A1E2C; color: #C9D8E1;
  border-bottom: 1px solid rgba(47,182,168,.28);
  font-size: 11px; letter-spacing: .01em; text-align: center;
}
.demo-strip b {
  color: #7FD8CC; font-size: 9.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.demo-strip span { color: #AFC0CD; }
.demo-short { display: none; }
body.has-demo-strip .sidebar { top: 34px; }
body.has-demo-strip .main { padding-top: 60px; }

/* ---------------- shell ---------------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 226px; z-index: 20;
  background: radial-gradient(120% 80% at 0% 0%, #123246 0%, #0A1E2C 55%, #081821 100%);
  color: #fff; padding: 22px 16px 18px; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; padding: 0; }
.brand-plate { display: block; width: 194px; max-width: 100%; background: #fff; border-radius: 8px; padding: 6px 8px; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.brand-plate img { display: block; width: 100%; height: auto; }
.nav { margin-top: 30px; display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px;
  color: #AFC0CD; font-size: 13px; font-weight: 500; border-left: 2px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav a.active { background: rgba(47,182,168,.12); color: #fff; border-left-color: var(--aqua); }
.nav .ico { width: 16px; height: 16px; opacity: .9; }
.nav .ico svg { width: 16px; height: 16px; }
.side-note { margin-top: auto; padding: 12px 10px 2px; border-top: 1px solid rgba(255,255,255,.09); }
.side-note .local { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #BFD3DF; letter-spacing: .02em; }
.side-note .dot { width: 6px; height: 6px; border-radius: 50%; background: #4FD1A5; box-shadow: 0 0 0 3px rgba(79,209,165,.15); }
.side-note p { font-size: 10.5px; color: #7F93A2; line-height: 1.45; margin: 7px 0 9px; }
.side-note .ver { font-family: "IBM Plex Mono"; font-size: 9.5px; color: #5F7382; }

.main { margin-left: 226px; flex: 1; padding: 26px 34px 70px; min-width: 0; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }

.page-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.page-head .grow { flex: 1; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--faint); margin-bottom: 7px; }
.crumbs a:hover { color: var(--teal); }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------- primitives ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 550; cursor: pointer;
  transition: background .14s, border-color .14s, transform .14s, box-shadow .14s;
  white-space: nowrap;
}
.btn:hover { border-color: #C9D3DA; background: #FCFDFD; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 1px 2px rgba(14,140,134,.25); }
.btn.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: #12293A; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #EDF1F3; color: var(--ink); }
.btn.danger { color: var(--rust); border-color: #EBD3C9; background: #FDF8F5; }
.btn.danger:hover { background: #FBEDE6; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 11.5px; border-radius: 6px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 11px; }
.card.pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 13px; letter-spacing: .01em; }
.card-body { padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
  border-radius: 20px; font-size: 10.5px; font-weight: 600; letter-spacing: .03em;
  background: #EEF2F4; color: #5B6673; text-transform: uppercase; white-space: nowrap;
}
.pill.teal { background: #E4F3F1; color: #0A6E69; }
.pill.amber { background: #F8F0D8; color: #8A6C12; }
.pill.rust { background: #F9E7E0; color: #A34422; }
.pill.green { background: #E5F1EA; color: #23664A; }
.pill.blue { background: #E7EFF6; color: #2C5C86; }
.pill.grey { background: #EEF2F4; color: #64727F; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.live .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 5px; font-size: 10.5px; background: #F0F4F5; color: #56636F; }

/* ---------------- jobs ---------------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; margin-bottom: 22px; }
.stat-strip .s { background: #fff; padding: 14px 18px; }
.stat-strip .k { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.stat-strip .v { font-size: 22px; font-weight: 600; letter-spacing: -.03em; margin-top: 3px; }
.stat-strip .v small { font-size: 12px; color: var(--muted); font-weight: 500; }

.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.job-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: box-shadow .18s, transform .18s, border-color .18s; display: flex; flex-direction: column; }
.job-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: #D3DDE3; }
.job-card .cover { height: 132px; background: #0C2534; position: relative; overflow: hidden; }
.job-card .cover img { width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.job-card .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,30,44,0) 35%, rgba(10,30,44,.72) 100%); }
.job-card .cover .vessel { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 2; color: #fff; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.job-card .cover .status { position: absolute; top: 11px; right: 11px; z-index: 2; }
.job-card .cover .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #3C586B; }
.job-card .body { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.job-card .meta { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.job-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); }
.job-card .nums { display: flex; gap: 14px; font-size: 11px; color: var(--faint); }
.job-card .nums b { color: var(--ink); font-weight: 600; }

.empty { border: 1px dashed #CFD9DF; border-radius: 12px; padding: 50px 30px; text-align: center; background: #FBFCFC; }
.empty .ico { width: 44px; height: 44px; border-radius: 12px; background: #E9F2F1; color: var(--teal); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.empty h3 { font-size: 15px; margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: 12.5px; max-width: 420px; margin: 0 auto 14px; }

/* ---------------- job workspace ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 13px; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.tabs .count { font-size: 10px; color: var(--faint); margin-left: 4px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 13px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--teal); opacity: .8; }
.kpi .k { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--faint); }
.kpi .v { font-size: 24px; font-weight: 600; letter-spacing: -.035em; margin-top: 3px; color: var(--ink); }
.kpi .v small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .d { font-size: 11px; color: var(--muted); margin-top: 3px; }
.kpi .d.good { color: var(--green); }
.kpi .d.warn { color: var(--rust); }

.progress-card { border: 1px solid #CFE3E1; background: linear-gradient(180deg, #F3FAF9, #fff); border-radius: 11px; padding: 16px 18px; margin-bottom: 16px; }
.progress-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.progress-card h3 { font-size: 13px; }
.progress { height: 7px; border-radius: 6px; background: #E3EDEC; overflow: hidden; }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--teal), var(--aqua)); border-radius: 6px; transition: width .4s ease; }
.progress .bar.indet { width: 35% !important; animation: slide 1.3s infinite ease-in-out; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 7px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.section-title h2 { font-size: 14px; letter-spacing: 0; }
.section-title .hint { font-size: 11.5px; color: var(--faint); }

/* zone maps */
.surface { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px 15px; margin-bottom: 12px; }
.surface-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.surface-head h3 { font-size: 13px; }
.surface-head span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.maps2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.map-cap { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.zgrid { display: flex; flex-direction: column; gap: 4px; }
.zrow { display: flex; gap: 4px; align-items: stretch; }
.zband { width: 34px; font-size: 9.5px; color: var(--faint); text-transform: uppercase; display: flex; align-items: center; letter-spacing: .05em; }
.zcell { flex: 1; border-radius: 5px; padding: 7px 8px; color: #fff; min-height: 50px; position: relative; }
.zcell.light { color: #22303B; }
.zcell.nodata { background: #E7EBEE !important; color: #97A3AE; }
.zcell .zs { font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.zcell .zv { font-size: 15px; font-weight: 600; letter-spacing: -.02em; margin-top: 1px; }
.zcell .zg { font-size: 9px; opacity: .85; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 10.5px; color: var(--muted); }
.legend .sw { width: 18px; height: 9px; border-radius: 2px; }
.legend .lbl { text-transform: uppercase; letter-spacing: .08em; font-size: 9.5px; color: var(--faint); margin-right: 2px; }

/* charts */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { position: relative; width: 132px; height: 132px; flex: 0 0 auto; }
.donut svg { transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .center b { font-size: 22px; letter-spacing: -.03em; }
.donut .center span { font-size: 9px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
.legend-list { display: flex; flex-direction: column; gap: 7px; flex: 1; }
.legend-list .li { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.legend-list .li .sw { width: 9px; height: 9px; border-radius: 2px; }
.legend-list .li .n { margin-left: auto; font-family: "IBM Plex Mono"; font-size: 10.5px; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row .lab { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.bar-row .lab b { color: var(--ink); font-weight: 550; }
.track { height: 8px; border-radius: 5px; background: #EDF1F3; position: relative; overflow: hidden; }
.track .fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; }
.track .fill.ghost { opacity: .38; }

/* photos */
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.filters select, .filters input { width: auto; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; background: #fff; font-size: 12px; }
.filters input[type=search] { width: 210px; }
.filters .count { font-size: 11.5px; color: var(--faint); margin-left: auto; }
.ico svg { width: 100%; height: 100%; display: block; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 12px; }
.ph { background: #fff; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.ph:hover { box-shadow: 0 6px 18px -8px rgba(10,30,44,.25); transform: translateY(-1px); border-color: #CFDAE1; }
.ph .im { aspect-ratio: 4/3; background: #E9EEF1; position: relative; }
.ph .im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .badges { position: absolute; top: 7px; left: 7px; display: flex; gap: 4px; }
.ph .badge { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: rgba(10,30,44,.78); color: #fff; font-weight: 600; }
.ph .badge.after { background: rgba(14,140,134,.9); }
.ph .badge.finding { background: rgba(194,84,47,.92); }
.ph .body { padding: 8px 10px 9px; }
.ph .z { font-size: 11.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph .m { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.ph .q { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.q.good { background: #3FA776; } .q.usable { background: #C9A227; } .q.unusable { background: #C2542F; } .q.unknown { background: #B9C4CC; }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.pager .info { font-size: 11.5px; color: var(--muted); }

/* selection */
.sel-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sel-tabs button { height: 30px; padding: 0 11px; border-radius: 16px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.sel-tabs button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.sel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 14px; }
.sel-card { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 9px; overflow: hidden; }
.sel-card.max { border-top-color: var(--rust); }
.sel-card.median { border-top-color: var(--amber); }
.sel-card.min { border-top-color: var(--green); }
.sel-card.residual { border-top-color: #8A5A44; }
.sel-card .head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.sel-card .zone { font-size: 12.5px; font-weight: 600; flex: 1; }
.sel-card .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.sel-card .shot { position: relative; background: #E9EEF1; aspect-ratio: 4/3; cursor: pointer; }
.sel-card .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sel-card .shot .tag { position: absolute; top: 6px; left: 6px; font-size: 8.5px; letter-spacing: .1em; padding: 2px 5px; border-radius: 3px; background: rgba(10,30,44,.8); color: #fff; }
.sel-card .shot .tag.after { background: rgba(14,140,134,.9); }
.sel-card .shot .none { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--faint); font-size: 11px; }
.sel-card .shot .metrics { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; background: linear-gradient(0deg, rgba(10,30,44,.72), transparent); color: #fff; font-size: 9.5px; display: flex; justify-content: space-between; }
.sel-card .why { padding: 8px 12px 4px; font-size: 10.5px; color: var(--muted); }
.sel-card .actions { display: flex; gap: 4px; padding: 6px 8px 9px; }
.sel-card .actions .btn { flex: 1; }
.sel-empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 60; background: rgba(7,17,24,.86); display: flex; align-items: stretch; backdrop-filter: blur(3px); }
.lb .stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px; position: relative; min-width: 0; }
.lb .stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.lb .close { position: absolute; top: 16px; left: 16px; }
.lb .toggle { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; }
.lb .panel { width: 360px; background: #fff; overflow-y: auto; padding: 22px 22px 30px; }
.lb .panel h3 { font-size: 16px; margin-bottom: 2px; }
.lb .panel .sub { font-size: 11px; color: var(--faint); margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.kv .k { font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.kv .v { font-size: 12px; margin-top: 2px; }
.kv .v.mono { font-size: 11px; }
.panel-section { border-top: 1px solid var(--line-2); margin-top: 16px; padding-top: 14px; }
.panel-section h4 { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
textarea, input:not([type]), input[type=text], input[type=date], input[type=number], select { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 7px 9px; font-size: 12.5px; }
textarea { resize: vertical; min-height: 64px; }
label.f { display: block; margin-bottom: 10px; }
label.f span { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label.f { margin-bottom: 0; }
.form-section { margin-bottom: 22px; }
.form-section h3 { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line-2); }

/* modal */
.modal-bg { position: fixed; inset: 0; z-index: 70; background: rgba(8,20,29,.6); display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { font-size: 14px; }
.modal-body { padding: 18px 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff; }

/* upload */
.drop { border: 1.5px dashed #C7D5DC; border-radius: 11px; padding: 34px 24px; text-align: center; background: #FAFCFC; transition: border-color .15s, background .15s; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--teal); background: #F2FAF9; }
.drop .ico { width: 42px; height: 42px; border-radius: 11px; background: #E6F3F1; color: var(--teal); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.drop h3 { font-size: 14px; margin-bottom: 3px; }
.drop p { font-size: 11.5px; color: var(--muted); margin: 0; }
.upload-list { margin-top: 12px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.upload-list .u { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line-2); font-size: 11.5px; }
.upload-list .u:last-child { border-bottom: 0; }
.upload-list .u .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-list .u .ok { color: var(--green); }
.upload-list .u .err { color: var(--rust); }

/* report */
.report-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.preview-shell { background: #E8ECEF; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.preview-shell iframe { width: 100%; height: calc(100vh - 190px); min-height: 620px; border: 0; display: block; background: #E8ECEF; }
.report-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.report-item:last-child { border-bottom: 0; }
.report-item .ico { width: 32px; height: 32px; border-radius: 7px; background: #EEF2F4; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.report-item .nm { font-size: 11px; font-weight: 550; line-height: 1.3; overflow-wrap: anywhere; }
.report-item .mt { font-size: 10.5px; color: var(--faint); }

/* events */
.events { display: flex; flex-direction: column; }
.ev { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 11.5px; }
.ev:last-child { border-bottom: 0; }
.ev .t { width: 82px; color: var(--faint); font-family: "IBM Plex Mono"; font-size: 9.5px; padding-top: 2px; }
.ev .d { color: var(--ink-2); }

/* toasts */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: in .2s ease; max-width: 380px; }
.toast.err { background: #8E3A22; }
.toast.ok { background: #1F6B52; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }

/* misc */
.hr { height: 1px; background: var(--line-2); margin: 14px 0; }
.kbd { font-family: "IBM Plex Mono"; font-size: 10px; background: #EEF2F4; padding: 1px 5px; border-radius: 4px; color: var(--muted); }
.notice { border-left: 3px solid var(--teal); background: #F3F9F8; padding: 10px 14px; border-radius: 0 7px 7px 0; font-size: 12px; color: #2C4A47; }
.notice.warn { border-left-color: var(--rust); background: #FCF4F0; color: #5E3527; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.table td { font-size: 11.5px; padding: 8px; border-bottom: 1px solid var(--line-2); }
.table td.num, .table th.num { text-align: right; font-family: "IBM Plex Mono"; font-size: 10.5px; }
.table tr:last-child td { border-bottom: 0; }

@media (max-width: 1180px) {
  .kpis, .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .report-layout { grid-template-columns: 1fr; }
  .sel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar {
    inset: 34px 0 auto 0; width: 100%; height: 54px;
    flex-direction: row; align-items: center; gap: 10px; padding: 8px 14px;
  }
  .brand { padding: 0; flex: 0 0 auto; }
  .brand-plate { width: 108px; padding: 3px 5px; border-radius: 5px; }
  .nav { flex-direction: row; margin: 0 0 0 auto; gap: 2px; }
  .nav a {
    padding: 8px; font-size: 0; gap: 0; border-left: 0;
    border-bottom: 2px solid transparent; border-radius: 5px;
  }
  .nav a.active { border-left: 0; border-bottom-color: var(--aqua); }
  .nav .ico, .nav .ico svg { width: 17px; height: 17px; }
  .side-note { display: none; }
  .main { margin-left: 0; padding: 100px 16px 60px; }
  body.has-demo-strip .main { padding-top: 100px; }
  .page-head { flex-wrap: wrap; gap: 12px; }
  .page-head .grow { flex-basis: 100%; }
  .page-actions { width: 100%; }
  .demo-strip { justify-content: flex-start; font-size: 10px; gap: 6px; padding: 7px 12px; }
  .demo-long { display: none; }
  .demo-short { display: inline; }
  .g2, .g3, .maps2, .form-grid { grid-template-columns: 1fr; }
  .lb .panel { width: 300px; }
}

/* ---------------- account & team ---------------- */
.user-chip {
  margin-top: auto; display: flex; align-items: center; gap: 9px;
  padding: 10px 9px; border-radius: 9px; background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.07);
}
.user-chip .avatar {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px;
  display: grid; place-items: center; background: #0E8C86; color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
}
.user-chip .who { min-width: 0; flex: 1; line-height: 1.25; }
.user-chip .who b { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { display: block; font-size: 9.5px; color: #7FD8CC; text-transform: capitalize; margin-top: 2px; }
.user-chip .out { color: #7F93A2; display: flex; padding: 4px; border-radius: 5px; transform: rotate(180deg); }
.user-chip .out:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-note { margin-top: 10px; }

.table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th {
  text-align: left; font-size: 10px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 10px 18px; border-bottom: 1px solid var(--line-2);
  background: #FAFCFD; white-space: nowrap;
}
.users-table td { padding: 12px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 12.5px; }
.users-table tr:last-child td { border-bottom: 0; }
.users-table select { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 0 8px; font-size: 12px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.switch input { accent-color: var(--teal); }

@media (max-width: 860px) {
  .user-chip { display: none; }
}
