
/* ── Base (Green / default dark) ──────────────── */
:root {
  --bg:        #09160e;
  --bg2:       #0f1f16;
  --bg3:       #152a1c;
  --bg4:       #1b3525;
  --card:      #132118;
  --card-h:    #1a2e21;
  --border:    #1e3827;
  --border2:   #28503a;
  --green:     #22c55e;
  --green-d:   #16a34a;
  --green-glow:rgba(34,197,94,.12);
  --yellow:    #eab308;
  --yellow-bg: rgba(234,179,8,.13);
  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,.13);
  --blue:      #60a5fa;
  --blue-bg:   rgba(96,165,250,.13);
  --orange:    #f97316;
  --orange-bg: rgba(249,115,22,.13);
  --purple:    #a855f7;
  --purple-bg: rgba(168,85,247,.13);
  --text:      #d6edd9;
  --text2:     #7aaa87;
  --text3:     #4a7558;
  --mono:      'DM Mono', monospace;
  --sans:      'Outfit', sans-serif;
  --r:         8px;
  --r2:        12px;
}

/* ── Blue dark theme ──────────────────────────── */
[data-theme="blue"] {
  --bg:        #090f1a;
  --bg2:       #0d1829;
  --bg3:       #111f35;
  --bg4:       #172840;
  --card:      #0f1c30;
  --card-h:    #152438;
  --border:    #1a2e4a;
  --border2:   #1e3d63;
  --text:      #ccdcf5;
  --text2:     #6a9bc8;
  --text3:     #3d6490;
  --accent:    #3b82f6;
  --accent-d:  #2563eb;
  --accent-glow: rgba(59,130,246,.12);
}

/* ── Red dark theme ───────────────────────────── */
[data-theme="red"] {
  --bg:        #160909;
  --bg2:       #1f0d0d;
  --bg3:       #2a1111;
  --bg4:       #351616;
  --card:      #200e0e;
  --card-h:    #2a1414;
  --border:    #3a1a1a;
  --border2:   #4d2020;
  --text:      #f5cccc;
  --text2:     #c87070;
  --text3:     #8f4040;
  --accent:    #ef4444;
  --accent-d:  #dc2626;
  --accent-glow: rgba(239,68,68,.12);
}

/* ── Yellow dark theme ────────────────────────── */
[data-theme="yellow"] {
  --bg:        #141006;
  --bg2:       #1e1809;
  --bg3:       #28200d;
  --bg4:       #332910;
  --card:      #1e1709;
  --card-h:    #281f0e;
  --border:    #3a2e10;
  --border2:   #4d3d14;
  --text:      #f5eacc;
  --text2:     #c8a850;
  --text3:     #8f7030;
  --accent:    #eab308;
  --accent-d:  #ca8a04;
  --accent-glow: rgba(234,179,8,.12);
}

/* Wire accent into green vars for all themes */
[data-theme="blue"],
[data-theme="red"],
[data-theme="yellow"] {
  --green:      var(--accent);
  --green-d:    var(--accent-d);
  --green-glow: var(--accent-glow);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbars ───────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── App Bar ──────────────────────────────────── */
.app-bar {
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.75)} }

.logo-sep {
  width: 1px;
  height: 24px;
  background: var(--border2);
  margin: 0 4px;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 340px;
}

.search-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 15px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0 12px 0 32px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}

.search-input:focus { border-color: var(--green); }
.search-input::placeholder { color: var(--text3); }

.bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 34px; height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}

.icon-btn:hover { color: var(--green); border-color: var(--green); }
.icon-btn.spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pill-btn {
  height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0 12px;
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.pill-btn:hover { color: var(--text); border-color: var(--border2); }
.pill-btn.green { background: var(--green); color: #09160e; border-color: transparent; font-weight: 600; }
.pill-btn.green:hover { opacity: .9; }

/* ── Setup Banner ─────────────────────────────── */
.setup-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 52px);
  padding: 40px 20px;
}

.setup-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  padding: 40px;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.setup-icon {
  width: 56px; height: 56px;
  background: var(--green-glow);
  border: 1px solid var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 20px;
}

.setup-card h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.setup-card p {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 24px;
}

.setup-row {
  display: flex;
  gap: 8px;
}

.setup-input {
  flex: 1;
  height: 38px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 0 14px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  transition: border-color .2s;
}

.setup-input:focus { border-color: var(--green); }
.setup-input::placeholder { color: var(--text3); }

/* ── Toolbar ──────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.time-pills {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 3px;
}

.t-pill {
  height: 28px;
  padding: 0 12px;
  background: none;
  border: none;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.t-pill:hover { color: var(--text); }
.t-pill.active { background: var(--green); color: #09160e; font-weight: 600; }

.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-in {
  height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  color-scheme: dark;
}

.date-in:focus { border-color: var(--green); }
.date-sep { color: var(--text3); font-size: 12px; }

.view-tog {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 3px;
  margin-left: auto;
}

.v-btn {
  width: 32px; height: 28px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text2);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.v-btn:hover { color: var(--text); }
.v-btn.active { background: var(--green); color: #09160e; }

/* ── Filter Bar ───────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.f-select {
  height: 30px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0 28px 0 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a7558' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  white-space: nowrap;
  flex-shrink: 0;
}

.f-select:focus { border-color: var(--green); }
.f-select option { background: var(--bg2); }

.filter-clear {
  height: 30px;
  padding: 0 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-clear:hover { color: var(--text); border-color: var(--border2); }

.filter-active-count {
  background: var(--green);
  color: #09160e;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--mono);
  display: none;
}

/* ── Editor Tabs ──────────────────────────────── */
.editor-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.e-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.e-tab:hover { color: var(--text); }

.e-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.e-count {
  background: var(--bg3);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text2);
}

.e-tab.active .e-count {
  background: var(--green-glow);
  color: var(--green);
}

/* ── Stats Row ────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  overflow-x: auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 110px;
  flex-shrink: 0;
}

.stat-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.stat-value.g { color: var(--green); }
.stat-value.y { color: var(--yellow); }
.stat-value.r { color: var(--red); }
.stat-value.b { color: var(--blue); }

/* ── Board ────────────────────────────────────── */
.board {
  display: flex;
  gap: 14px;
  padding: 16px 20px 24px;
  overflow-x: auto;
  align-items: flex-start;
  min-height: calc(100vh - 340px);
}

.col {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: all .2s;
  animation: colIn .25s ease forwards;
}

.col.open {
  min-width: 272px;
  max-width: 272px;
}

.col.collapsed {
  min-width: 42px;
  max-width: 42px;
  cursor: pointer;
}

@keyframes colIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.col.collapsed .col-header {
  flex-direction: column;
  justify-content: center;
  height: 200px;
  border-bottom: none;
  padding: 12px 6px;
  gap: 10px;
}

.col-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.col.collapsed .col-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  font-size: 11px;
  line-height: 1.3;
}

.col-count {
  background: var(--green-glow);
  color: var(--green);
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 500;
  flex-shrink: 0;
}

.col.collapsed .col-count {
  writing-mode: horizontal-tb;
  transform: none;
}

.col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 390px);
  min-height: 80px;
}

.col.collapsed .col-body { display: none; }

.col-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--text3);
  font-size: 11px;
  font-family: var(--mono);
}

/* ── Card ─────────────────────────────────────── */
.listing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 11px;
  cursor: pointer;
  transition: all .15s;
  animation: cardIn .2s ease forwards;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.listing-card:hover {
  background: var(--card-h);
  border-color: var(--border2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}

.card-req {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 2px;
}

.card-listtype{
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(0,255,150,0.1);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.card-ref {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  margin-bottom: 7px;
}

.card-loc {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 7px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.ctag {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text2);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.card-date {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
}

/* ── Status Badge ─────────────────────────────── */
.sbadge {
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.s-uploaded  { background: var(--green-glow);  color: var(--green);  }
.s-ongoing   { background: var(--yellow-bg);    color: var(--yellow); }
.s-rejected  { background: var(--red-bg);       color: var(--red);    }
.s-pending   { background: var(--blue-bg);      color: var(--blue);   }
.s-default   { background: var(--bg4);          color: var(--text2);  }

/* ── Table View ───────────────────────────────── */
.table-wrap {
  padding: 16px 20px 24px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.data-table thead th {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  position: sticky;
  top: 0;
  z-index: 2;
  cursor: pointer;
  user-select: none;
}

.data-table thead th:hover { background: var(--bg4); color: var(--text); }

.data-table tbody td {
  border: 1px solid var(--border);
  padding: 7px 12px;
  color: var(--text);
  vertical-align: middle;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody tr:hover td { background: var(--bg3); }

.data-table a {
  color: var(--green);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10px;
}

.data-table a:hover { text-decoration: underline; }

.tbl-mono {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
}

/* ── Loading / Error ──────────────────────────── */
.center-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 20px;
  color: var(--text2);
  font-size: 13px;
  font-family: var(--mono);
}

.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.err-title { color: var(--red); font-size: 16px; font-weight: 600; font-family: var(--sans); }
.err-msg   { color: var(--text2); font-size: 13px; line-height: 1.6; max-width: 400px; text-align: center; }

/* ── Modal ────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadein .15s ease;
}

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  overflow-y: auto;
  padding: 24px;
  animation: modalin .18s ease;
}

@keyframes modalin {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-req  { font-family: var(--mono); font-size: 14px; color: var(--green); font-weight: 500; }
.modal-ref  { font-family: var(--mono); font-size: 11px; color: var(--text3); margin-top: 3px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
  transition: color .15s;
}

.modal-close:hover { color: var(--text); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.detail-item.full { grid-column: 1 / -1; }

.d-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.d-val {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}

.d-val a { color: var(--green); font-size: 12px; text-decoration: none; }
.d-val a:hover { text-decoration: underline; }

.modal-editor {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
}

/* ── Last updated ─────────────────────────────── */
.last-updated {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lu-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* ── No-results ────────────────────────────────── */
.no-results {
  width: 100%;
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
  font-family: var(--mono);
  font-size: 13px;
}

/* ── Card delete button ────────────────────────── */
.listing-card { position: relative; }

.card-del-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 4px;
  color: var(--red);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
  z-index: 2;
  line-height: 1;
}

.listing-card:hover .card-del-btn { opacity: 1; }
.card-del-btn:hover { background: var(--red); color: #fff; }

/* ── Delete confirm overlay ─────────────────────── */
.del-confirm {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadein .15s ease;
}

.del-box {
  background: var(--bg2);
  border: 1px solid var(--red);
  border-radius: var(--r2);
  padding: 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.del-box h3 { font-size: 16px; font-weight: 600; color: var(--red); margin-bottom: 8px; }
.del-box p  { font-size: 12px; color: var(--text2); margin-bottom: 20px; line-height: 1.6; }

.del-box .req-preview {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
  color: var(--green);
  margin-bottom: 20px;
}

.del-actions { display: flex; gap: 8px; }
.del-actions button { flex: 1; height: 38px; border-radius: var(--r); font-family: var(--sans); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; border: 1px solid; }
.del-cancel  { background: none; border-color: var(--border2); color: var(--text2); }
.del-cancel:hover  { color: var(--text); border-color: var(--text2); }
.del-confirm-btn { background: var(--red); border-color: var(--red); color: #fff; }
.del-confirm-btn:hover { opacity: .85; }

/* ── Report View ────────────────────────────────── */
.report-wrap {
  padding: 16px 20px 40px;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.report-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.report-subtitle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}

.report-incoming {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.report-incoming h3 {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 14px;
}

.incoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.incoming-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
}

.incoming-item .i-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  margin-bottom: 6px;
  line-height: 1.4;
}

.incoming-item .i-val {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.incoming-item .i-val.blue   { color: var(--blue); }
.incoming-item .i-val.orange { color: var(--orange); }
.incoming-item .i-val.green  { color: var(--green); }
.incoming-item .i-val.yellow { color: var(--yellow); }
.incoming-item .i-val.white  { color: var(--text); }

.report-table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th {
  background: var(--bg3);
  padding: 10px 16px;
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.report-table th:not(:first-child) { text-align: center; }

.report-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

.report-table td:not(:first-child) { text-align: center; }

.report-table .editor-name {
  font-weight: 500;
  font-size: 13px;
}

.report-table .num-cell {
  font-family: var(--mono);
  font-size: 14px;
}

.report-table .num-zero {
  color: var(--text3);
}

.report-table tr.team-total {
  background: rgba(34,197,94,.07);
  border-top: 2px solid var(--border2);
}

.report-table tr.team-total td {
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
  font-size: 14px;
  border-bottom: 1px solid var(--border2);
}

.report-table tr.pending-row td {
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 13px;
  background: var(--yellow-bg);
  border-bottom: 1px solid var(--border);
}

.report-table tr.rate-row td {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 13px;
  background: var(--blue-bg);
  border-bottom: none;
}

.rate-badge {
  display: inline-block;
  background: var(--blue-bg);
  border: 1px solid rgba(96,165,250,.25);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 13px;
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 500;
}
/* ── Purple var ───────────────────────────────── */
:root {
  --purple:    #a855f7;
  --purple-bg: rgba(168,85,247,.13);
}

/* ── Status badges ────────────────────────────── */
.s-no-ref { background: var(--orange-bg); color: var(--orange); }

/* ── Card top row & list type badge ──────────── */
.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.card-listtype {
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.lt-photo    { border-color: rgba(96,165,250,.4);  color: var(--blue);   background: var(--blue-bg); }
.lt-agent    { border-color: rgba(249,115,22,.4);  color: var(--orange); background: var(--orange-bg); }
.lt-brochure { border-color: rgba(34,197,94,.4);   color: var(--green);  background: var(--green-glow); }
.lt-default  { border-color: var(--border); color: var(--text2); background: var(--bg3); }

/* ── Toolbar (filter btn + view toggle) ───────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

/* ── Filter Button ────────────────────────────── */
.filter-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.filter-trigger:hover { color: var(--text); border-color: var(--border2); }
.filter-trigger.has-filters {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-glow);
}

.filter-badge {
  background: var(--green);
  color: #09160e;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  display: none;
}
.filter-trigger.has-filters .filter-badge { display: inline-block; }

/* ── Filter Backdrop ──────────────────────────── */
.filter-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.filter-backdrop.open { opacity: 1; pointer-events: all; }

/* ── Filter Modal (centered) ──────────────────── */
.filter-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -44%) scale(.97);
  width: 560px;
  max-width: 95vw;
  max-height: 85vh;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  z-index: 151;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  overflow: hidden;
}
.filter-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fp-title { font-size: 14px; font-weight: 600; color: var(--text); }
.fp-close {
  background: none; border: none; color: var(--text2);
  font-size: 20px; cursor: pointer; line-height: 1;
  padding: 2px; transition: color .15s;
}
.fp-close:hover { color: var(--text); }

.fp-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fp-section-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}

.fp-time-pills {
  display: flex;
  gap: 6px;
}
.fp-t-pill {
  flex: 1;
  height: 32px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
}
.fp-t-pill:hover { color: var(--text); border-color: var(--border2); }
.fp-t-pill.active { background: var(--green); color: #09160e; border-color: var(--green); font-weight: 700; }

.fp-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fp-date-in {
  flex: 1; height: 34px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0 10px;
  color: var(--text); font-family: var(--sans); font-size: 12px;
  outline: none; cursor: pointer; transition: border-color .2s;
  color-scheme: dark;
}
.fp-date-in:focus { border-color: var(--green); }
.fp-date-sep { color: var(--text3); font-size: 12px; flex-shrink: 0; }
.fp-apply-date {
  height: 34px; padding: 0 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--text2);
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.fp-apply-date:hover { color: var(--green); border-color: var(--green); }

/* 2-column grid for dropdowns */
.fp-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.fp-select {
  width: 100%; height: 36px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 0 28px 0 12px;
  color: var(--text); font-family: var(--sans); font-size: 13px;
  outline: none; cursor: pointer; transition: border-color .2s;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a7558' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.fp-select:focus { border-color: var(--green); }
.fp-select option { background: var(--bg2); }

.fp-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.fp-apply-btn {
  flex: 1; height: 38px;
  background: var(--green); border: none; border-radius: var(--r);
  color: #09160e; font-family: var(--sans); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.fp-apply-btn:hover { opacity: .85; }
.fp-clear-btn {
  height: 38px; padding: 0 16px;
  background: none; border: 1px solid var(--border2); border-radius: var(--r);
  color: var(--text2); font-family: var(--sans); font-size: 13px;
  cursor: pointer; transition: all .15s;
}
.fp-clear-btn:hover { color: var(--red); border-color: var(--red); }

/* ── Edit Modal ───────────────────────────────── */
.modal-edit-btn {
  height: 28px;
  padding: 0 10px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  color: var(--text2);
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
  transition: all .15s;
}
.modal-edit-btn:hover { color: var(--green); border-color: var(--green); }

.edit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.edit-form-grid .detail-item.full { grid-column: 1 / -1; }

.edit-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  margin-top: 4px;
  display: block;
}
.edit-input:focus { border-color: var(--green); }
textarea.edit-input { resize: vertical; min-height: 70px; }
select.edit-input { appearance: none; -webkit-appearance: none; cursor: pointer; }
select.edit-input option { background: var(--bg2); }

.edit-actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.edit-save-btn {
  flex: 1; height: 38px;
  background: var(--green); border: none; border-radius: var(--r);
  color: #09160e; font-family: var(--sans); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.edit-save-btn:hover    { opacity: .85; }
.edit-save-btn:disabled { opacity: .5; cursor: not-allowed; }
.edit-cancel-btn {
  height: 38px; padding: 0 16px;
  background: none; border: 1px solid var(--border2); border-radius: var(--r);
  color: var(--text2); font-family: var(--sans); font-size: 13px;
  cursor: pointer; transition: all .15s;
}
.edit-cancel-btn:hover { color: var(--text); border-color: var(--text2); }

/* ── Delete confirm ───────────────────────────── */
.del-confirm {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px); z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadein .15s ease;
}
.del-box {
  background: var(--bg2); border: 1px solid var(--red);
  border-radius: var(--r2); padding: 28px;
  max-width: 380px; width: 100%; text-align: center;
}
.del-box h3 { font-size: 16px; font-weight: 600; color: var(--red); margin-bottom: 8px; }
.del-box p  { font-size: 12px; color: var(--text2); margin-bottom: 20px; line-height: 1.6; }
.del-box .req-preview {
  font-family: var(--mono); font-size: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 12px; color: var(--green); margin-bottom: 20px;
}
.del-actions { display: flex; gap: 8px; }
.del-actions button {
  flex: 1; height: 38px; border-radius: var(--r);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; border: 1px solid;
}
.del-cancel      { background: none; border-color: var(--border2); color: var(--text2); }
.del-cancel:hover { color: var(--text); border-color: var(--text2); }
.del-confirm-btn { background: var(--red); border-color: var(--red); color: #fff; }
.del-confirm-btn:hover { opacity: .85; }

/* ── Report styles ────────────────────────────── */
.report-wrap { padding: 16px 20px 40px; }
.report-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.report-title { font-size: 18px; font-weight: 700; color: var(--text); }
.report-subtitle { font-family: var(--mono); font-size: 11px; color: var(--text3); margin-top: 3px; }
.report-incoming { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r2); padding: 16px 20px; margin-bottom: 16px; }
.report-incoming h3 { font-size: 11px; font-family: var(--mono); color: var(--text3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.incoming-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.incoming-item { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.incoming-item .i-label { font-size: 10px; font-family: var(--mono); color: var(--text3); margin-bottom: 6px; line-height: 1.4; }
.incoming-item .i-val { font-size: 28px; font-weight: 700; line-height: 1; }
.incoming-item .i-val.blue   { color: var(--blue); }
.incoming-item .i-val.orange { color: var(--orange); }
.incoming-item .i-val.green  { color: var(--green); }
.incoming-item .i-val.yellow { color: var(--yellow); }
.incoming-item .i-val.white  { color: var(--text); }
.report-table-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th { background: var(--bg3); padding: 10px 16px; text-align: left; font-family: var(--mono); font-size: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.report-table th:not(:first-child) { text-align: center; }
.report-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
.report-table td:not(:first-child) { text-align: center; }
.report-table .editor-name { font-weight: 500; font-size: 13px; }
.report-table .num-cell { font-family: var(--mono); font-size: 14px; }
.report-table .num-zero { color: var(--text3); }
.report-table tr.team-total { background: rgba(34,197,94,.07); border-top: 2px solid var(--border2); }
.report-table tr.team-total td { font-weight: 700; color: var(--green); font-family: var(--mono); font-size: 14px; border-bottom: 1px solid var(--border2); }
.report-table tr.pending-row td { color: var(--yellow); font-family: var(--mono); font-size: 13px; background: var(--yellow-bg); border-bottom: 1px solid var(--border); }
.report-table tr.rate-row td { color: var(--blue); font-family: var(--mono); font-size: 13px; background: var(--blue-bg); border-bottom: none; }

/* ═══════════════════════════════════════════════
   LIGHT MODE
   ═══════════════════════════════════════════════ */
/* ── Light mode — Green ────────────────────────── */
body.light {
  --bg:        #f0faf2;
  --bg2:       #ffffff;
  --bg3:       #f1f5f2;
  --bg4:       #e4ede6;
  --card:      #ffffff;
  --card-h:    #f8fdf9;
  --border:    #d4e4d8;
  --border2:   #b8d4be;
  --text:      #0f2914;
  --text2:     #3a6645;
  --text3:     #6b9e76;

  /* Status badge backgrounds lighten in light mode */
  --yellow-bg: rgba(234,179,8,.12);
  --red-bg:    rgba(239,68,68,.12);
  --blue-bg:   rgba(96,165,250,.12);
  --orange-bg: rgba(249,115,22,.12);
  --purple-bg: rgba(168,85,247,.12);
}

/* Light mode scrollbar */
body.light * { scrollbar-color: var(--border2) transparent; }

/* Light mode data table hover */
body.light .data-table tbody tr:hover td { background: var(--bg3); }

/* Light mode modal */
body.light .modal-bg { background: rgba(0,0,0,.45); }

/* Light mode date input */
body.light .fp-date-in { color-scheme: light; }
body.light .date-in    { color-scheme: light; }
/* ── Light mode — Blue ────────────────────────── */
[data-theme="blue"] body.light {
  --bg:        #f0f5ff;
  --bg2:       #ffffff;
  --bg3:       #eef2fb;
  --bg4:       #dde6f5;
  --card:      #ffffff;
  --card-h:    #f5f8ff;
  --border:    #c8d8f0;
  --border2:   #a8c0e8;
  --text:      #0a1529;
  --text2:     #2a5090;
  --text3:     #5070a8;
}

/* ── Light mode — Red ─────────────────────────── */
[data-theme="red"] body.light {
  --bg:        #fff5f5;
  --bg2:       #ffffff;
  --bg3:       #fbeaea;
  --bg4:       #f5d8d8;
  --card:      #ffffff;
  --card-h:    #fff8f8;
  --border:    #f0c8c8;
  --border2:   #e8a8a8;
  --text:      #290a0a;
  --text2:     #902a2a;
  --text3:     #a85050;
}

/* ── Light mode — Yellow ──────────────────────── */
[data-theme="yellow"] body.light {
  --bg:        #fffbf0;
  --bg2:       #ffffff;
  --bg3:       #fdf6e0;
  --bg4:       #f5ecc8;
  --card:      #ffffff;
  --card-h:    #fffdf5;
  --border:    #ede0b0;
  --border2:   #e0cc88;
  --text:      #1a1400;
  --text2:     #7a5c00;
  --text3:     #a07820;
}

/* ═══════════════════════════════════════════════
   THEME SWATCHES
   ═══════════════════════════════════════════════ */
.theme-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  flex-shrink: 0;
}
.swatch:hover { transform: scale(1.2); }
.swatch.active {
  border-color: var(--text);
  transform: scale(1.15);
}

.swatch-green  { background: #22c55e; }
.swatch-blue   { background: #3b82f6; }
.swatch-red    { background: #ef4444; }
.swatch-yellow { background: #eab308; }

/* Separator between swatches and mode toggle */
.theme-swatches::after {
  content: '';
  display: block;
  width: 1px;
  height: 18px;
  background: var(--border2);
  margin-left: 4px;
}

/* ── Get Extension button ─────────────────────── */
.ext-btn {
  background: var(--bg3);
  border-color: var(--border2);
  color: var(--text2);
}
.ext-btn:hover {
  background: var(--green-glow);
  border-color: var(--green);
  color: var(--green);
}

/* ── Extension Download Modal ─────────────────── */
.ext-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--green);
  color: #09160e;
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 20px;
  transition: opacity .15s;
}
.ext-download-btn:hover { opacity: .85; }

.ext-steps {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.ext-steps-title {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 12px;
}

.ext-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.ext-step:last-child { border-bottom: none; padding-bottom: 0; }

.ext-step-num {
  width: 22px;
  height: 22px;
  background: var(--green-glow);
  border: 1px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ext-step-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}
.ext-step-text strong { color: var(--text); font-weight: 600; }
.ext-step-text code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg4);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--green);
}

.ext-note {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--yellow-bg);
  border: 1px solid rgba(234,179,8,.2);
  border-radius: var(--r);
}
.ext-note strong { color: var(--yellow); }

/* ── Connection Status ────────────────────────── */
.conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: var(--bg3);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .3s;
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.conn-checking .conn-dot  { background: var(--yellow); animation: blink 1.2s ease-in-out infinite; }
.conn-checking            { color: var(--yellow); border-color: rgba(234,179,8,.3); }

.conn-online .conn-dot    { background: var(--green); animation: none; }
.conn-online              { color: var(--green); border-color: var(--green-glow); background: var(--green-glow); }

.conn-offline .conn-dot   { background: var(--red); animation: blink .8s ease-in-out infinite; }
.conn-offline             { color: var(--red); border-color: rgba(239,68,68,.3); background: var(--red-bg); }

/* ── Disconnection Warning Toast ──────────────── */
.disconnect-toast {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  animation: slideDown .3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.disconnect-toast-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--red);
  border-radius: var(--r);
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  min-width: 360px;
  max-width: 95vw;
}

.disconnect-icon {
  font-size: 20px;
  flex-shrink: 0;
  color: var(--red);
}

.disconnect-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 2px;
}

.disconnect-msg {
  font-size: 11px;
  color: var(--text2);
  font-family: var(--mono);
}

.disconnect-retry {
  margin-left: auto;
  height: 30px;
  padding: 0 12px;
  background: var(--red);
  border: none;
  border-radius: var(--r);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .15s;
}
.disconnect-retry:hover { opacity: .85; }

.disconnect-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color .15s;
}
.disconnect-close:hover { color: var(--text); }

/* ── Sheet link button in ext modal ───────────── */
.ext-sheet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 20px;
  transition: all .15s;
}
.ext-sheet-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-glow);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE & TABLET
   ═══════════════════════════════════════════════ */

/* ── Tablet (≤ 900px) ─────────────────────────── */
@media (max-width: 900px) {

  /* App bar — compress */
  .app-bar { gap: 8px; padding: 0 14px; }
  .logo { font-size: 12px; gap: 7px; }
  .logo-sep { display: none; }
  .search-wrap { max-width: 200px; }
  .theme-swatches { gap: 4px; }
  .conn-status { display: none; }

  /* Stats row — wrap */
  .stats-row { flex-wrap: wrap; }
  .stat-card { min-width: 90px; }

  /* Board cols narrower */
  .col.open { min-width: 230px; max-width: 230px; }

  /* Filter modal — wider */
  .filter-panel { width: 95vw; }
}

/* ── Mobile (≤ 600px) ─────────────────────────── */
@media (max-width: 600px) {

  /* App bar */
  .app-bar { height: 52px; padding: 0 12px; gap: 6px; flex-wrap: nowrap; }
  .logo { font-size: 11px; }
  .search-wrap { flex: 1; max-width: none; }
  .search-input { font-size: 12px; }
  .theme-swatches { display: none; }
  .last-updated { display: none !important; }
  .ext-btn { display: none; }
  .modeToggleBtn { display: none; }
  #modeToggleBtn { width: 30px; height: 30px; font-size: 14px; }

  /* Toolbar */
  .toolbar { padding: 6px 12px; }
  .filter-trigger { padding: 0 10px; font-size: 11px; height: 30px; }
  .v-btn { width: 28px; height: 26px; }

  /* Editor tabs — horizontal scroll */
  .editor-tabs { padding: 0 12px; }
  .e-tab { padding: 8px 10px; font-size: 12px; }

  /* Stats row */
  .stats-row { padding: 10px 12px; gap: 8px; }
  .stat-card { min-width: 80px; padding: 8px 12px; }
  .stat-label { font-size: 9px; }
  .stat-value { font-size: 22px; }

  /* Board — vertical scroll, full width cards */
  .board {
    flex-direction: column;
    padding: 12px;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: unset;
  }

  .col.open {
    min-width: 100%;
    max-width: 100%;
  }

  .col.collapsed {
    min-width: 100%;
    max-width: 100%;
    min-height: 42px;
    cursor: pointer;
  }

  /* Collapsed col — horizontal pill on mobile */
  .col.collapsed .col-header {
    flex-direction: row;
    height: auto;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
  }

  .col.collapsed .col-name {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }

  /* Col body — limit height on mobile */
  .col-body {
    max-height: 65vh;
  }

  /* Cards */
  .listing-card { padding: 10px; }
  .card-loc { font-size: 11px; }

  /* Table view */
  .table-wrap { padding: 10px 12px 20px; }

  /* Report view */
  .report-wrap { padding: 12px 12px 30px; }
  .incoming-grid { grid-template-columns: 1fr 1fr; }
  .report-table th,
  .report-table td { padding: 8px 10px; font-size: 11px; }

  /* Filter modal */
  .filter-panel {
    width: 100vw;
    max-width: 100vw;
    top: 52px;
    left: 0;
    transform: none;
    border-radius: 0 0 var(--r2) var(--r2);
    max-height: calc(100vh - 52px);
  }
  .filter-panel.open {
    transform: none;
  }
  .fp-filters-grid { grid-template-columns: 1fr; }

  /* Modal — full screen on mobile */
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    border-radius: var(--r2) var(--r2) 0 0;
    max-height: 90vh;
    padding: 20px 16px;
  }
  .detail-grid { grid-template-columns: 1fr; }
  .edit-form-grid { grid-template-columns: 1fr; }
  .edit-form-grid .detail-item.full { grid-column: 1; }

  /* Extension modal */
  .ext-modal { max-height: 90vh; }

  /* Delete confirm */
  .del-box { padding: 20px 16px; }

  /* Disconnect toast */
  .disconnect-toast-inner { min-width: unset; width: calc(100vw - 24px); }
}

/* ── Small mobile (≤ 380px) ───────────────────── */
@media (max-width: 380px) {
  .logo { display: none; }
  .logo-sep { display: none; }
  .stat-value { font-size: 20px; }
  .stat-card { min-width: 70px; }
}

/* ── Drag to reorder columns ──────────────────── */
.col-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  flex: 1;
}

.col-drag-handle {
  color: var(--text3);
  font-size: 16px;
  cursor: grab;
  line-height: 1;
  flex-shrink: 0;
  padding: 2px 1px;
  transition: color .15s;
  user-select: none;
}
.col-drag-handle:hover { color: var(--text2); }
.col-drag-handle:active { cursor: grabbing; }

.col.col-dragging {
  opacity: .85;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  pointer-events: none;
}

.col-placeholder {
  background: var(--green-glow);
  border: 2px dashed var(--green);
  border-radius: var(--r2);
  flex-shrink: 0;
  opacity: .6;
  transition: all .15s;
}

/* Collapsed col — drag handle hidden on collapsed */
.col.collapsed .col-drag-handle { display: none; }

/* ── Modal delete button ──────────────────────── */
.modal-delete-btn {
  height: 28px;
  padding: 0 10px;
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--r);
  color: var(--red);
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
  transition: all .15s;
}
.modal-delete-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
