/* ═══════════════════════════════════════════════════════════
   HearAB — Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --c-teal:       #1D9E75;
  --c-teal-l:     #5DCAA5;
  --c-teal-ll:    #E1F5EE;
  --c-bg:         #ffffff;
  --c-bg2:        #f7f7f6;
  --c-bg3:        #f0efec;
  --c-border:     rgba(0,0,0,0.12);
  --c-border2:    rgba(0,0,0,0.20);
  --c-text:       #1a1a18;
  --c-text2:      #5a5956;
  --c-text3:      #9a9894;
  --c-danger:     #a32d2d;
  --c-danger-bg:  #fcebeb;
  --c-warn:       #854f0b;
  --c-warn-bg:    #faeeda;
  --c-info:       #185fa5;
  --c-info-bg:    #e6f1fb;
  --c-success:    #0f6e56;
  --c-success-bg: #e1f5ee;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --transition:   0.15s ease;
}

[data-theme="dark"] {
  --c-bg:         #1a1a18;
  --c-bg2:        #232320;
  --c-bg3:        #2c2c28;
  --c-border:     rgba(255,255,255,0.10);
  --c-border2:    rgba(255,255,255,0.18);
  --c-text:       #f0efec;
  --c-text2:      #a0a09a;
  --c-text3:      #606058;
  --c-teal-ll:    #04342c;
  --c-danger-bg:  #501313;
  --c-warn-bg:    #412402;
  --c-info-bg:    #042c53;
  --c-success-bg: #04342c;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--c-bg3);
  color: var(--c-text);
  height: 100%;
  line-height: 1.6;
}

a { color: var(--c-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 500; }
h4 { font-size: 1rem;   font-weight: 500; }
p  { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-rows: 52px 1fr;
  height: 100vh;
  overflow: hidden;
}

.app-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
}

/* ── Nav ────────────────────────────────────────────────────── */
.app-nav {
  background: var(--c-bg);
  border-bottom: 0.5px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: relative;
  z-index: 100;
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--c-text);
}
.nav-logo span { color: var(--c-teal); }

.nav-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--c-text3);
  flex: 1;
}
.nav-breadcrumb .sep { color: var(--c-border2); }
.nav-breadcrumb .crumb { color: var(--c-text2); cursor: pointer; }
.nav-breadcrumb .crumb:hover { color: var(--c-teal); }
.nav-breadcrumb .crumb.active { color: var(--c-text); font-weight: 500; }

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

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--c-teal);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  background: var(--c-bg);
  border-right: 0.5px solid var(--c-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px 8px;
}

.sidebar-section {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--c-text3);
  padding: 10px 8px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--c-text2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.sidebar-item:hover { background: var(--c-bg2); color: var(--c-text); }
.sidebar-item.active { background: var(--c-bg3); color: var(--c-text); font-weight: 500; }
.sidebar-item .dot {
  width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}

.sidebar-folder {
  padding-left: 22px;
  font-size: 0.82rem;
}
.sidebar-folder.depth-2 { padding-left: 36px; }

.sidebar-footer {
  margin-top: auto;
  padding: 8px 4px 4px;
  border-top: 0.5px solid var(--c-border);
}

/* ── Main content ────────────────────────────────────────────── */
.main-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-bg3);
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.toolbar {
  background: var(--c-bg);
  border-bottom: 0.5px solid var(--c-border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-sep {
  width: 0.5px;
  height: 22px;
  background: var(--c-border);
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  border: 0.5px solid var(--c-border2);
  background: transparent;
  color: var(--c-text);
  line-height: 1.4;
  white-space: nowrap;
}
.btn:hover { background: var(--c-bg2); }
.btn:active { opacity: 0.8; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--c-teal);
  color: #fff;
  border-color: var(--c-teal);
}
.btn-primary:hover { background: #0f6e56; border-color: #0f6e56; }

.btn-danger {
  border-color: var(--c-danger);
  color: var(--c-danger);
}
.btn-danger:hover { background: var(--c-danger-bg); }

.btn-icon {
  padding: 5px 7px;
  border-radius: var(--radius);
}

.btn-play {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c-teal);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-play:hover { background: #0f6e56; }
.btn-play svg { fill: #fff; }

/* ── Mode badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}
.badge-blind   { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-half    { background: var(--c-warn-bg);   color: var(--c-warn); }
.badge-visible { background: var(--c-info-bg);   color: var(--c-info); }
.badge-run     { background: var(--c-bg2); color: var(--c-text2); border: 0.5px solid var(--c-border); }

/* ── Select / Input ──────────────────────────────────────────── */
select, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], textarea {
  background: var(--c-bg);
  color: var(--c-text);
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--c-teal);
  box-shadow: 0 0 0 2px rgba(29,158,117,0.15);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Timeline ────────────────────────────────────────────────── */
.global-timeline {
  background: var(--c-bg);
  border-bottom: 0.5px solid var(--c-border);
  padding: 8px 16px 6px;
  flex-shrink: 0;
}

.timeline-track {
  height: 6px;
  border-radius: 3px;
  background: var(--c-bg3);
  position: relative;
  cursor: pointer;
  user-select: none;
  border: 0.5px solid var(--c-border);
}
.timeline-track:hover .timeline-thumb { opacity: 1; }

.timeline-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--c-teal);
  pointer-events: none;
  position: relative;
}

.timeline-loop-range {
  position: absolute;
  top: 0; height: 100%;
  background: rgba(29,158,117,0.25);
  pointer-events: none;
}

.timeline-thumb {
  position: absolute;
  top: 50%; right: -6px;
  transform: translateY(-50%);
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--c-teal);
  border: 2px solid var(--c-bg);
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--c-text3);
}
.timeline-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-text2);
  text-align: center;
}

/* ── Loading bar ─────────────────────────────────────────────── */
.load-bar {
  background: var(--c-bg);
  border-bottom: 0.5px solid var(--c-border);
  padding: 5px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--c-text3);
  flex-shrink: 0;
}
.load-track {
  flex: 1; height: 3px;
  border-radius: 2px;
  background: var(--c-border);
}
.load-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--c-teal-l);
  transition: width 0.3s ease;
}

/* ── Cell grid ───────────────────────────────────────────────── */
.cell-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.cell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.cell-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cell-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cell-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cell-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.cell-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

/* ── Cell card ───────────────────────────────────────────────── */
.cell-card {
  background: var(--c-bg);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  cursor: pointer;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
  user-select: none;
}
.cell-card:hover { border-color: var(--c-border2); }
.cell-card.is-active {
  border: 1.5px solid var(--c-teal);
  box-shadow: 0 0 0 2px rgba(29,158,117,0.12);
}
.cell-card.is-loading { opacity: 0.5; pointer-events: none; }

.cell-num {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--c-text3);
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.cell-card.is-active .cell-num { color: var(--c-teal); }

.cell-label-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text2);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-mini-timeline {
  height: 3px;
  border-radius: 2px;
  background: var(--c-bg3);
  margin-bottom: 6px;
  overflow: hidden;
}
.cell-mini-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--c-teal);
  transition: width 0.2s linear;
}

.cell-time {
  font-size: 0.72rem;
  color: var(--c-text3);
  font-variant-numeric: tabular-nums;
}

.cell-rating-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.cell-actions {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity var(--transition);
}
.cell-card:hover .cell-actions { opacity: 1; }

.cell-action-btn {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--c-bg2);
  border: 0.5px solid var(--c-border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text3);
}
.cell-action-btn:hover { color: var(--c-text); background: var(--c-bg3); }

/* ── Equalizer animation ─────────────────────────────────────── */
.eq-icon {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.eq-bar {
  width: 3px;
  border-radius: 1px;
  background: var(--c-teal);
  animation: eq-bounce 0.5s ease-in-out infinite alternate;
}
.eq-bar:nth-child(2) { animation-delay: 0.12s; }
.eq-bar:nth-child(3) { animation-delay: 0.25s; }
.eq-bar:nth-child(4) { animation-delay: 0.38s; }
@keyframes eq-bounce { from { height: 3px; } to { height: 13px; } }

/* ── Star rating ─────────────────────────────────────────────── */
.stars { display: flex; gap: 1px; }
.star {
  font-size: 0.9rem;
  color: var(--c-teal);
  cursor: pointer;
  transition: transform 0.1s;
}
.star.empty { color: var(--c-border2); }
.star:hover { transform: scale(1.15); }

/* ── Numeric / slider rating ─────────────────────────────────── */
.rating-numeric {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.rating-num-btn {
  width: 26px; height: 26px;
  border-radius: 5px;
  border: 0.5px solid var(--c-border);
  background: transparent;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--c-text2);
  transition: background var(--transition);
}
.rating-num-btn.selected,
.rating-num-btn:hover { background: var(--c-teal); color: #fff; border-color: var(--c-teal); }

/* ── List view ───────────────────────────────────────────────── */
.cell-list { display: flex; flex-direction: column; gap: 4px; }

.cell-list-row {
  background: var(--c-bg);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 48px 1fr 200px 140px 120px auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.cell-list-row:hover { border-color: var(--c-border2); }
.cell-list-row.is-active { border: 1.5px solid var(--c-teal); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--c-bg);
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 18px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: 16px 20px; }
.modal-footer {
  padding: 12px 20px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 0.5px solid var(--c-border);
}

/* ── Note panel ──────────────────────────────────────────────── */
.note-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 240px;
  background: var(--c-bg);
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 10px;
  z-index: 200;
}
.note-panel textarea {
  width: 100%;
  border-radius: var(--radius);
  font-size: 0.82rem;
  padding: 7px;
  border-color: var(--c-border);
  resize: vertical;
  min-height: 70px;
}

/* ── Color swatch picker ─────────────────────────────────────── */
.swatch-picker {
  display: flex; gap: 5px; flex-wrap: wrap;
}
.swatch {
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.1s;
}
.swatch.selected, .swatch:hover { border-color: var(--c-text); }

/* ── Form grid ───────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text2);
  margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea { width: 100%; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-hint {
  font-size: 0.75rem;
  color: var(--c-text3);
  margin-top: 4px;
}

/* ── Alerts / notices ────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.84rem;
  margin-bottom: 12px;
}
.alert-info    { background: var(--c-info-bg);    color: var(--c-info);    border: 0.5px solid var(--c-info); }
.alert-danger  { background: var(--c-danger-bg);  color: var(--c-danger);  border: 0.5px solid var(--c-danger); }
.alert-success { background: var(--c-success-bg); color: var(--c-success); border: 0.5px solid var(--c-success); }
.alert-warn    { background: var(--c-warn-bg);    color: var(--c-warn);    border: 0.5px solid var(--c-warn); }

/* ── Upload drop zone ────────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--c-border2);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  color: var(--c-text3);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--c-teal);
  background: var(--c-teal-ll);
  color: var(--c-teal);
}
.upload-zone .icon { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ── Progress item ───────────────────────────────────────────── */
.upload-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  font-size: 0.82rem;
}
.upload-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .prog { width: 80px; height: 4px; border-radius: 2px; background: var(--c-border); overflow: hidden; }
.upload-item .prog-fill { height: 100%; background: var(--c-teal); border-radius: 2px; }

/* ── Results table ───────────────────────────────────────────── */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.results-table th, .results-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--c-border);
}
.results-table th {
  font-weight: 600;
  color: var(--c-text2);
  background: var(--c-bg2);
  font-size: 0.75rem;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--c-bg2); }

/* ── View toggle ─────────────────────────────────────────────── */
.view-toggle {
  display: flex;
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-toggle button {
  background: transparent;
  border: none;
  padding: 5px 9px;
  cursor: pointer;
  color: var(--c-text3);
  transition: background var(--transition);
}
.view-toggle button.active {
  background: var(--c-bg2);
  color: var(--c-text);
}

/* ── Column adjuster ─────────────────────────────────────────── */
.col-adj {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: var(--c-text3);
}
.col-adj button {
  width: 22px; height: 22px;
  border-radius: 4px;
  border: 0.5px solid var(--c-border2);
  background: transparent;
  cursor: pointer;
  color: var(--c-text2);
  font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* ── Landing page ────────────────────────────────────────────── */
.landing-shell {
  min-height: 100vh;
  background: var(--c-bg3);
}

.landing-hero {
  background: var(--c-bg);
  border-bottom: 0.5px solid var(--c-border);
  padding: 60px 20px 50px;
  text-align: center;
}
.landing-hero h1 { font-size: 2.4rem; margin-bottom: 16px; }
.landing-hero h1 span { color: var(--c-teal); }
.landing-hero p { font-size: 1.05rem; color: var(--c-text2); max-width: 540px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary {
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}
.btn-hero-ghost {
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border2);
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
}
.btn-hero-ghost:hover { background: var(--c-bg2); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 40px 20px;
  max-width: 1000px;
  margin: 0 auto;
}
.feature-card {
  background: var(--c-bg);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.feature-card .icon { font-size: 1.4rem; margin-bottom: 10px; }
.feature-card h3 { font-size: 0.95rem; margin-bottom: 6px; }
.feature-card p { font-size: 0.84rem; color: var(--c-text2); margin: 0; }

/* ── Auth card ───────────────────────────────────────────────── */
.auth-card {
  background: var(--c-bg);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}
.auth-tabs {
  display: flex;
  border-bottom: 0.5px solid var(--c-border);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1; text-align: center;
  padding: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-text3);
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
}
.auth-tab.active { color: var(--c-teal); border-bottom-color: var(--c-teal); }

/* ── Project grid ────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 20px;
}
.project-card {
  background: var(--c-bg);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  border-color: var(--c-teal);
  box-shadow: 0 2px 8px rgba(29,158,117,0.12);
}
.project-card h3 { font-size: 0.95rem; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card .meta { font-size: 0.75rem; color: var(--c-text3); }
.project-card .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.project-new {
  border-style: dashed;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  color: var(--c-text3);
  min-height: 100px;
}
.project-new:hover { color: var(--c-teal); border-color: var(--c-teal); }
.project-new .plus { font-size: 1.8rem; line-height: 1; }

/* ── Cookie banner ───────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--c-bg);
  border-top: 0.5px solid var(--c-border);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  z-index: 800;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.cookie-banner p { font-size: 0.84rem; color: var(--c-text2); flex: 1; min-width: 200px; margin: 0; }

/* ── Tooltip ─────────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  background: var(--c-text);
  color: var(--c-bg);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
}
[data-tip]:hover::after { opacity: 1; }
.no-tips [data-tip]::after { display: none; }

/* ── Admin ───────────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--c-bg);
  border-right: 0.5px solid var(--c-border);
  padding: 20px 10px;
}
.admin-main { padding: 24px; }
.stat-card {
  background: var(--c-bg2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: center;
}
.stat-card .val { font-size: 1.8rem; font-weight: 700; color: var(--c-teal); }
.stat-card .lbl { font-size: 0.78rem; color: var(--c-text3); margin-top: 2px; }

/* ── Utilities ───────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.mt-2   { margin-top: 8px; }
.mt-3   { margin-top: 12px; }
.mb-3   { margin-bottom: 12px; }
.text-sm { font-size: 0.84rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--c-text2); }
.text-hint  { color: var(--c-text3); }
.text-teal  { color: var(--c-teal); }
.text-danger { color: var(--c-danger); }
.fw-500 { font-weight: 500; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-body { grid-template-columns: 1fr; }
  .sidebar  { display: none; }
  .sidebar.mobile-open { display: flex; position: fixed; inset: 52px 0 0 0; z-index: 500; width: 80vw; max-width: 280px; }
  .cell-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .cell-list-row { grid-template-columns: 36px 1fr auto; }
  .cell-list-row > *:nth-child(n+3):not(:last-child) { display: none; }
  .landing-hero h1 { font-size: 1.6rem; }
  .features-grid { padding: 20px; }
}

/* ── Drag ghost ──────────────────────────────────────────────── */
.sortable-ghost { opacity: 0.4; }
.sortable-chosen { box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
