@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=DM+Mono:wght@400;500&display=swap');

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

:root {
  --bg: #f8fafc;
  --bg2: #ffffff;
  --bg3: #f1f5f9;
  --bg4: #e2e8f0;
  --bg5: #cbd5e1;
  --border: #0000000f;
  --border2: #0000001a;
  --border3: #0000002a;
  --text: #0f172a;
  --text2: #475569;
  --text3: #64748b;
  --accent: #facc15;
  --accent-hover: #eab308;
  --accent2: #8b5cf6;
  --accent-text: #1e293b;
  --green: #10b981;
  --red: #f43f5e;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --pink: #ec4899;
  --teal: #14b8a6;
  --orange: #f97316;
  --green-bg: #10b98115;
  --red-bg: #f43f5e15;
  --amber-bg: #f59e0b15;
  --blue-bg: #3b82f615;
  --r: 12px;
  --r2: 8px;
  --r3: 6px;
}

html,
body {
  height: 100%;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5
}

/* ─── AUTH ─────────────────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #fefce8 0%, var(--bg) 70%)
}

.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px #00000008
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  justify-content: center
}

.logo-mark {
  width: 96px;
  height: 96px;
  background: var(--accent);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-text);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.auth-brand {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.3px;
  color: var(--text)
}

.auth-sub {
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  margin-bottom: 28px
}

.field-group {
  margin-bottom: 16px
}

.flabel {
  display: block;
  font-size: 11.5px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 6px;
  font-weight: 500
}

.finput {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
  outline: none
}

.finput:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px #fef9c3
}

.finput::placeholder {
  color: var(--text3)
}

.btn-auth {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: var(--r2);
  padding: 11px;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  margin-top: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05)
}

.btn-auth:hover {
  background: var(--accent-hover);
  transform: translateY(-1px)
}

.btn-auth:disabled {
  opacity: .6;
  cursor: not-allowed
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text3)
}

.auth-switch a {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 500
}

.auth-switch a:hover {
  text-decoration: underline
}

.alert-box {
  padding: 10px 14px;
  border-radius: var(--r3);
  margin-bottom: 14px;
  font-size: 13px;
  background: var(--red-bg);
  border: 1px solid #f43f5e30;
  color: var(--red)
}

.alert-box.success {
  background: var(--green-bg);
  border-color: #10b98130;
  color: var(--green)
}

.alert-box.info {
  background: var(--blue-bg);
  border-color: #3b82f630;
  color: var(--blue)
}

/* ─── APP LAYOUT ───────────────────────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden
}

.sidebar {
  width: 218px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0
}

.sidebar-logo {
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border)
}

.logo-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.4px;
  text-align: center
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0
}

.nav-section {
  padding: 14px 14px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  font-weight: 600
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--text2);
  font-size: 13.5px;
  transition: all .12s;
  margin: 1px 6px;
  border-radius: var(--r3);
  position: relative
}

.nav-item:hover {
  background: var(--bg4);
  color: var(--text)
}

.nav-item.active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600
}

.nav-item.active .ni {
  stroke: var(--accent-text)
}

.nav-item.active::before {
  display: none
}

.ni {
  width: 15px;
  height: 15px;
  flex-shrink: 0
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border)
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--bg3);
  border-radius: var(--r2);
  border: 1px solid var(--border)
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
  flex-shrink: 0
}

.user-info {
  flex: 1;
  min-width: 0
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.user-role {
  font-size: 10.5px;
  color: var(--text3)
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color .12s
}

.logout-btn:hover {
  color: var(--red)
}

.record-count {
  padding: 8px 10px 0;
  font-size: 11.5px;
  color: var(--text3);
  text-align: center
}

/* ─── MAIN CONTENT ─────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden
}

.topbar {
  height: 54px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 40
}

.page-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.2px
}

.topbar-right {
  display: flex;
  gap: 8px;
  align-items: center
}

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px
}

/* ─── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r3);
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all .12s;
  font-weight: 500;
  text-decoration: none
}

.btn:hover {
  background: var(--bg4);
  border-color: var(--border3)
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text)
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover)
}

.btn-danger {
  border-color: #f43f5e30;
  color: var(--red)
}

.btn-danger:hover {
  background: var(--red-bg)
}

.btn-success {
  border-color: #10b98130;
  color: var(--green)
}

.btn-success:hover {
  background: var(--green-bg)
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11.5px
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  border-radius: var(--r3)
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed
}

/* ─── STAT CARDS ───────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03)
}

.stat-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text3);
  font-weight: 600;
  margin-bottom: 8px
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  line-height: 1.1
}

.stat-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px
}

.stat-accent {
  color: var(--accent2)
}

.stat-green {
  color: var(--green)
}

.stat-red {
  color: var(--red)
}

/* ─── FORMS ────────────────────────────────────────────────────── */
.fselect {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color .12s;
  width: 100%
}

.fselect:focus {
  border-color: var(--accent)
}

.fselect option {
  background: #fff
}

input[type=date].finput,
input[type=date].fselect {
  color-scheme: light
}

/* ─── TABLE ────────────────────────────────────────────────────── */
.table-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px
}

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

.search-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  padding: 8px 10px 8px 32px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none
}

.search-input:focus {
  border-color: var(--accent)
}

.table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: auto;
  flex: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03)
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 600px
}

th {
  padding: 9px 14px;
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky;
  top: 0;
  white-space: nowrap;
  cursor: pointer;
  user-select: none
}

th:hover {
  color: var(--text)
}

th.sort-asc::after {
  content: ' ↑'
}

th.sort-desc::after {
  content: ' ↓'
}

td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis
}

tr:hover td {
  background: var(--bg3);
  color: var(--text)
}

tr:last-child td {
  border-bottom: none
}

.num-cell {
  font-family: 'DM Mono', monospace;
  text-align: right
}

.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 0;
  justify-content: flex-end;
  flex-shrink: 0
}

.page-btn {
  min-width: 30px;
  height: 30px;
  border-radius: var(--r3);
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-family: inherit;
  transition: all .12s
}

.page-btn:hover,
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600
}

.page-info {
  font-size: 12px;
  color: var(--text3);
  padding: 0 8px
}

/* ─── BADGE ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600
}

.badge-green {
  background: var(--green-bg);
  color: var(--green)
}

.badge-red {
  background: var(--red-bg);
  color: var(--red)
}

.badge-amber {
  background: var(--amber-bg);
  color: var(--amber)
}

.badge-blue {
  background: var(--blue-bg);
  color: var(--blue)
}

.badge-purple {
  background: #8b5cf618;
  color: var(--accent2)
}

/* ─── IMPORT ───────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border3);
  border-radius: var(--r);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 20px;
  background: var(--bg2)
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: #fefce8
}

.drop-icon {
  font-size: 42px;
  margin-bottom: 14px;
  display: block
}

.drop-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px
}

.drop-sub {
  font-size: 13px;
  color: var(--text3)
}

.progress-bar-wrap {
  height: 4px;
  background: var(--bg4);
  border-radius: 2px;
  margin: 12px 0;
  overflow: hidden
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width .3s;
  border-radius: 2px
}

.import-batches {
  margin-top: 20px
}

.batch-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px
}

.batch-name {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent2)
}

/* ─── BUILDER (CREATE CHART) ───────────────────────────────────── */
.builder-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start
}

.builder-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03)
}

.builder-panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px
}

.chart-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 4px
}

.ct-btn {
  padding: 9px 4px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  cursor: pointer;
  text-align: center;
  font-size: 11px;
  color: var(--text2);
  transition: all .12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px
}

.ct-btn:hover {
  border-color: var(--border3);
  color: var(--text)
}

.ct-btn.active {
  background: #fefce8;
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600
}

.ct-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 2px
}

.ct-svg {
  width: 18px;
  height: 18px;
  stroke: var(--text3);
  transition: stroke .12s
}

.ct-btn.active .ct-svg {
  stroke: var(--accent-text)
}

.ct-btn:hover .ct-svg {
  stroke: var(--text)
}

.preview-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  position: sticky;
  top: 54px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05)
}

.preview-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text3);
  font-weight: 600;
  margin-bottom: 16px
}

.metric-big {
  text-align: center;
  padding: 36px 20px
}

.metric-number {
  font-size: 58px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  color: var(--accent);
  line-height: 1
}

.metric-desc {
  font-size: 13px;
  color: var(--text3);
  margin-top: 10px
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 90px 1fr 28px;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center
}

.chip {
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer
}

.chip:hover {
  border-color: #f43f5e50;
  color: var(--red)
}

/* ─── DASHBOARD ────────────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap
}

.dash-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1
}

.dash-tab {
  padding: 7px 14px;
  border-radius: var(--r3);
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text2);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .12s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap
}

.dash-tab:hover {
  background: var(--bg3);
  color: var(--text)
}

.dash-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600
}

.dash-tab-x {
  opacity: .5;
  font-size: 15px;
  margin-left: 2px;
  line-height: 1
}

.dash-tab-x:hover {
  opacity: 1
}

.dash-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr)
}

.dash-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  position: relative;
  cursor: default;
  transition: border-color .12s;
  grid-column: span 4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03)
}

.dash-card.size-6 {
  grid-column: span 6
}

.dash-card.size-12 {
  grid-column: span 12
}

.dash-card:hover {
  border-color: var(--border3)
}

.dash-card.dragging {
  opacity: .4;
  cursor: grabbing
}

.dash-card.drag-over {
  border-color: var(--accent) !important;
  background: #fefce8
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  flex: 1;
  word-break: break-word
}

.card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .12s;
  flex-shrink: 0
}

.dash-card:hover .card-actions {
  opacity: 1
}

.card-act-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .12s
}

.card-act-btn:hover {
  border-color: var(--border3);
  color: var(--text)
}

.card-act-btn.del:hover {
  border-color: #f43f5e40;
  color: var(--red);
  background: var(--red-bg)
}

.dash-metric-val {
  font-size: 38px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  line-height: 1.1;
  margin-bottom: 4px;
  color: var(--accent-hover)
}

.dash-metric-label {
  font-size: 11.5px;
  color: var(--text3)
}

.chart-wrap {
  position: relative;
  width: 100%
}

.empty-dash {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--text3);
  gap: 10px;
  padding: 40px
}

.drag-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text3);
  font-size: 14px;
  opacity: 0;
  cursor: grab;
  transition: opacity .12s;
  letter-spacing: 2px
}

.dash-card:hover .drag-handle {
  opacity: .3
}

/* ─── ADMIN PAGE ───────────────────────────────────────────────── */
.user-table-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: auto
}

.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px
}

/* ─── DATE FILTERS ─────────────────────────────────────────────── */
.date-range-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap
}

.date-label {
  font-size: 11.5px;
  color: var(--text3);
  white-space: nowrap
}

input[type=date] {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  padding: 7px 10px;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color .12s
}

input[type=date]:focus {
  border-color: var(--accent)
}

/* ─── MODAL ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #00000040;
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center
}

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px #00000010
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border)
}

/* ─── SCROLL ────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 99px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg5)
}

/* ─── TOOLTIP ────────────────────────────────────────────────────── */
.tooltip {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  padding: 8px 12px;
  font-size: 12px;
  pointer-events: none;
  z-index: 3000;
  min-width: 140px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1)
}

.tt-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12.5px
}

.tt-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--text2);
  font-size: 12px
}

.tt-val {
  font-family: 'DM Mono', monospace;
  color: var(--accent-hover);
  font-weight: 600;
  font-size: 12px
}

/* ─── MISC ───────────────────────────────────────────────────────── */
.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text3);
  font-weight: 600;
  margin-bottom: 12px
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--bg4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.admin-only {
  display: none
}

.admin-only.visible {
  display: block
}

.admin-only-flex {
  display: none !important
}

.admin-only-flex.visible {
  display: flex !important
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.fade-up {
  animation: fadeUp .2s ease
}

/* ─── MULTI-SELECT CHECKBOXES ───────────────────────────────────── */
.ms-wrap {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px
}

.ms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text2);
  cursor: pointer;
  padding: 2px 0
}

.ms-item:hover {
  color: var(--text)
}

input[type=checkbox] {
  accent-color: var(--accent);
  width: 13px;
  height: 13px
}

/* ─── SERIES TAGS ───────────────────────────────────────────────── */
.series-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  margin: 2px;
  background: var(--bg3);
  border: 1px solid var(--border)
}

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

/* ─── SMART FILTER DROPDOWNS ─────────────────────────────────────── */
.filter-row-wrap {
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  padding: 10px 12px;
  background: var(--bg2);
  margin-top: 10px
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 140px 32px;
  gap: 6px;
  align-items: center;
}

.filter-val-wrap {
  position: relative;
}

.filter-multi-wrap {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  padding: 6px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.filter-multi-list {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-multi-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text2);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
}

.filter-multi-item:hover {
  background: var(--bg3);
  color: var(--text);
}

.filter-multi-search {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 4px 0;
  font-size: 12px;
  margin-bottom: 8px
}

.filter-val-input {
  width: 100%;
}

/* ─── POWERED BY ───────────────────────────────────────────────── */
.powered-sidebar {
  padding: 12px 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.8;
  border-top: 1px solid var(--border);
  margin-top: 4px
}

.vba-logo {
  height: 32px;
  width: auto;
  margin-bottom: 2px;
}

.vba-text {
  font-size: 8px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.2;
  text-align: center;
  opacity: 0.7
}

.powered-dash {
  position: absolute;
  bottom: 20px;
  left: 24px;
  font-size: 10px;
  color: var(--text3);
  opacity: 0.6;
  pointer-events: none;
}