/* ============================================================
   DMI-OS Natural Dye Intelligence — app.css
   ============================================================ */

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

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #1c2128;
  --border:    #30363d;
  --accent:    #3fb950;
  --accent-dk: #2ea043;
  --accent2:   #4f8ef7;
  --success:   #3fb950;
  --warn:      #d29922;
  --danger:    #f85149;
  --indigo-c:  #6e40c9;
  --text:      #e6edf3;
  --text2:     #8b949e;
  --sidebar-w: 232px;
  --topbar-h:  52px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

[data-theme="light"] {
  --bg:       #f0f4f0;
  --surface:  #ffffff;
  --surface2: #f0f4f0;
  --border:   #d0d7de;
  --text:     #1f2328;
  --text2:    #656d76;
}

html, body { height: 100%; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; line-height: 1.5;
}

/* ── Utilities ─────────────────────────────────────────────── */
.nd-muted   { color: var(--text2); }
.nd-error   { color: var(--danger); padding: 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.nd-empty   { text-align: center; padding: 48px 20px; color: var(--text2); }
.nd-empty-icon { font-size: 2.5rem; margin-bottom: 8px; }
.nd-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; gap: 12px; color: var(--text2); font-size: 13px; }
.nd-spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGE
   ══════════════════════════════════════════════════════════════ */
#authPage {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background:
    radial-gradient(ellipse 60% 50% at 15% 60%, rgba(63,185,80,.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(110,64,201,.08) 0%, transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
}
.auth-brand { text-align: center; padding: 28px 24px 0; }
.auth-brand-icon { font-size: 2.2rem; margin-bottom: 6px; }
.auth-brand-name { font-size: 1.5rem; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
.auth-brand-sub  { font-size: 11px; color: var(--text2); margin-top: 3px; text-transform: uppercase; letter-spacing: 1px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-top: 20px; }
.auth-tab  { flex: 1; text-align: center; padding: 11px 6px; font-size: 12px; font-weight: 700; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; user-select: none; }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-tab:hover:not(.active) { color: var(--text); }
.auth-panel { display: none; padding: 22px; }
.auth-panel.active { display: block; }
.auth-footer-link { text-align: center; font-size: 12px; color: var(--text2); margin-top: 14px; }
.auth-footer-link span { color: var(--accent); cursor: pointer; font-weight: 600; }
.auth-footer-link span:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════════════════════ */
.fg { margin-bottom: 13px; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 11px; }

label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px;
}
/* Shorthand label class for experiment form */
.lf {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px;
}

input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 8px 11px; border-radius: var(--radius);
  font-size: 13px; font-family: inherit; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[disabled], select[disabled] { opacity: .5; cursor: not-allowed; }
textarea { resize: vertical; min-height: 72px; }
select option { background: var(--surface); }
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 4px;
  background: var(--border); border-radius: 2px; padding: 0; border: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
}
input[type="range"]:focus { border-color: transparent; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 38px; }
.eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text2); cursor: pointer; font-size: 14px; padding: 0;
}
.form-err { font-size: 12px; color: var(--danger); min-height: 16px; margin-top: 3px; }

/* ══════════════════════════════════════════════════════════════
   LAB LOG FORM SECTIONS  (UJJAPPA-style)
   ══════════════════════════════════════════════════════════════ */
.log-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.log-sec-title {
  background: #8B3A2A;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
[data-theme="light"] .log-sec-title { background: #7a3222; }

.log-section .form-row2,
.log-section .form-row3,
.log-section .fg {
  padding: 10px 12px 0;
}
.log-section .fg:last-child { padding-bottom: 12px; }
.log-section .form-row2:last-child,
.log-section .form-row3:last-child { padding-bottom: 12px; }

/* ── Fastness dots ─────────────────────────────────────────── */
.fastness-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; transition: background .12s, border-color .12s; flex-shrink: 0;
  display: inline-block;
}
.fastness-dot:hover { border-color: #8B3A2A; }
.fastness-dot.on { background: #8B3A2A; border-color: #8B3A2A; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; background: var(--accent); border: none; color: #fff;
  font-size: 13px; font-weight: 700; font-family: inherit; border-radius: var(--radius);
  cursor: pointer; transition: background .15s, opacity .15s; white-space: nowrap;
}
.btn-primary:hover   { background: var(--accent-dk); }
.btn-primary:disabled{ opacity: .5; cursor: not-allowed; }
.btn-primary.full    { width: 100%; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: transparent; border: 1px solid var(--border); color: var(--text);
  font-size: 13px; font-weight: 600; font-family: inherit; border-radius: var(--radius);
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn-ghost:hover { background: var(--surface2); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs {
  padding: 3px 9px; font-size: 11px; font-weight: 700; font-family: inherit;
  border-radius: 5px; border: 1px solid var(--border); cursor: pointer;
  background: transparent; color: var(--text); white-space: nowrap; transition: background .12s;
}
.btn-xs:hover  { background: var(--surface2); }
.btn-ok   { border-color: var(--success); color: var(--success); }
.btn-ok:hover  { background: rgba(63,185,80,.1); }
.btn-del  { border-color: var(--danger);  color: var(--danger); }
.btn-del:hover { background: rgba(248,81,73,.1); }
.btn-warn { border-color: var(--warn);    color: var(--warn); }
.btn-warn:hover{ background: rgba(210,153,34,.1); }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   APP LAYOUT
   ══════════════════════════════════════════════════════════════ */
#appPage { display: none; flex-direction: column; min-height: 100vh; }
#appPage.visible { display: flex; }

.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 14px; gap: 8px;
  position: sticky; top: 0; z-index: 200; flex-shrink: 0;
}
.topbar-brand { font-size: 1rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.topbar-space { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.2rem; cursor: pointer; padding: 5px; }

.notif-wrap { position: relative; }
.notif-bell { background: none; border: none; color: var(--text2); font-size: 1.1rem; cursor: pointer; padding: 6px; transition: color .15s; }
.notif-bell:hover { color: var(--text); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 800;
  min-width: 14px; height: 14px; border-radius: 99px;
  display: none; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-drop {
  position: absolute; top: calc(100% + 6px); right: 0; width: 290px;
  max-height: 380px; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); display: none; z-index: 300;
}
.notif-drop.open { display: block; }
.notif-drop-hdr { padding: 10px 14px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text2); border-bottom: 1px solid var(--border); }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); transition: background .12s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-title { font-size: 12px; font-weight: 700; }
.notif-body  { font-size: 11px; color: var(--text2); margin-top: 2px; }
.notif-time  { font-size: 10px; color: var(--text2); margin-top: 3px; }
.notif-empty { padding: 20px; text-align: center; font-size: 12px; color: var(--text2); }

.top-user { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: var(--radius); }
.top-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--indigo-c)); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0; }
.top-name { font-size: 12px; font-weight: 700; line-height: 1.2; }
.top-role { font-size: 10px; color: var(--text2); text-transform: capitalize; }
.icon-btn { background: none; border: none; color: var(--text2); font-size: 1rem; cursor: pointer; padding: 6px; border-radius: var(--radius); transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--text); background: var(--surface2); }

.app-body { display: flex; flex: 1; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0; transition: transform .22s ease;
}
.nav-divider { padding: 6px 14px 3px; font-size: 10px; font-weight: 800; color: var(--text2); text-transform: uppercase; letter-spacing: .08em; margin-top: 8px; }
/* ── ACCORDION SIDEBAR ───────────────────────────────────── */
.nav-group { border-bottom: 1px solid var(--border); }
.nav-group-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; cursor: pointer; user-select: none;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text2);
  transition: background .12s, color .12s;
}
/* pointer-events removed — nav uses event delegation with closest() */
.nav-group-hdr:hover { background: var(--surface2); color: var(--text); }
.nav-group-icon { font-size: 13px; flex-shrink: 0; }
.nav-group-label { flex: 1; }
.nav-group-arrow { font-size: 10px; color: var(--text2); flex-shrink: 0; transition: transform .2s; }
.nav-group-body { overflow: hidden; }

.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 22px;
  cursor: pointer; color: var(--text2); font-size: 13px; font-weight: 500;
  border-left: 3px solid transparent; transition: all .12s; user-select: none;
}
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(63,185,80,.1); color: var(--accent); border-left-color: var(--accent); font-weight: 700; }
.nav-icon { font-size: 13px; flex-shrink: 0; width: 16px; text-align: center; }
.nav-label-text { flex: 1; }
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 150; }
.main { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 22px; }

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════════ */
.page-title  { font-size: 1.05rem; font-weight: 800; margin-bottom: 18px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.page-header .page-title { margin-bottom: 0; }
.hdr-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.block-hdr { margin-bottom: 12px; }
.block-hdr h3 { font-size: 13px; font-weight: 700; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; transition: border-color .15s; }
.stat-card:hover { border-color: var(--accent); }
.stat-label { font-size: 10px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 2rem; font-weight: 800; margin-top: 4px; }
.stat-card.danger  .stat-value { color: var(--danger); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.warn    .stat-value { color: var(--warn); }
.stat-card.indigo  .stat-value { color: var(--indigo-c); }

.dash-section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; margin-top: 4px; }
.dash-section-hdr h3 { font-size: 13px; font-weight: 700; }

.insight-card {
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface); border-top: 1px solid var(--border);
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 12px 14px; margin-bottom: 10px;
}
.insight-card.warn   { border-left-color: var(--warn); }
.insight-card.danger { border-left-color: var(--danger); }
.insight-card.indigo { border-left-color: var(--indigo-c); }
.insight-label { font-size: 10px; font-weight: 800; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 5px; }
.insight-label.warn   { color: var(--warn); }
.insight-label.danger { color: var(--danger); }
.insight-text  { font-size: 13px; line-height: 1.55; }
.insight-conf  { font-size: 11px; color: var(--text2); margin-top: 5px; }
.conf-bar  { height: 3px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.conf-fill { height: 100%; border-radius: 2px; background: var(--accent); }
.conf-fill.warn   { background: var(--warn); }
.conf-fill.danger { background: var(--danger); }
.insight-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.nd-tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
.nd-tbl thead th { background: var(--surface2); padding: 9px 12px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); white-space: nowrap; }
.nd-tbl tbody td { padding: 9px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.nd-row-link:hover td { background: var(--surface2); cursor: pointer; }
.exp-no { color: var(--accent); font-family: monospace; font-size: 12px; }
.act-cell { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-bar select, .filter-bar input { width: auto; padding: 7px 10px; font-size: 12px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.swatch-row { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.swatch-item { text-align: center; }
.swatch { width: 48px; height: 48px; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; }
.swatch-label { font-size: 10px; color: var(--text2); margin-top: 4px; max-width: 56px; line-height: 1.3; }

.dip-row { display: flex; gap: 5px; align-items: flex-end; margin: 12px 0; padding-bottom: 4px; }
.dip-bar { border-radius: var(--radius) var(--radius) 0 0; width: 30px; min-width: 30px; cursor: default; transition: height .4s ease; }
.dip-num { font-size: 10px; text-align: center; color: var(--text2); margin-top: 4px; }
.dip-item { text-align: center; }

.risk-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.risk-label { font-size: 12px; color: var(--text2); width: 160px; flex-shrink: 0; }
.risk-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.risk-fill  { height: 100%; border-radius: 3px; transition: width .4s ease; }
.risk-pct   { font-size: 11px; color: var(--text2); width: 36px; text-align: right; flex-shrink: 0; }

.lock-card {
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  padding: 18px; text-align: center; background: var(--surface); margin-bottom: 10px;
}
.lock-icon { font-size: 1.6rem; margin-bottom: 8px; }
.blurred { filter: blur(4px); user-select: none; font-size: 12px; color: var(--text2); pointer-events: none; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.65);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-title { font-size: 15px; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body  { padding: 20px; }
.modal-foot  { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }

/* ── Experiment detail ──────────────────────────────────────── */
.back-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 700; padding: 0 0 14px; display: inline-flex; align-items: center; gap: 5px; }
.back-btn:hover { opacity: .8; }
.exp-detail { max-width: 860px; }
.exp-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.meta-tag { background: var(--surface2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 99px; font-size: 11px; color: var(--text2); }
.section-label { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.cmt-meta { font-size: 11px; color: var(--text2); margin-bottom: 5px; }
.cmt-body { font-size: 13px; line-height: 1.6; word-break: break-word; }

/* ── Profile ────────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 720px; }

/* ── Tier cards ─────────────────────────────────────────────── */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tier-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.tier-card.featured { border: 2px solid var(--accent); }
.tier-name  { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.tier-price { font-size: 22px; font-weight: 800; }
.tier-price sub { font-size: 13px; font-weight: 400; color: var(--text2); }
.tier-feature { font-size: 12px; color: var(--text2); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.tier-feature .yes { color: var(--success); }

/* ── Course card ─────────────────────────────────────────────── */
.course-card { transition: border-color .15s, transform .15s; }
.course-card:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ── Mail settings ───────────────────────────────────────────── */
.mail-status-bar { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; line-height: 1.6; border-left: 4px solid; }
.status-ok   { background: rgba(63,185,80,.08);  border-color: var(--success); }
.status-warn { background: rgba(210,153,34,.08); border-color: var(--warn); }

/* ── Reports ────────────────────────────────────────────────── */
.col-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.col-check { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 99px; font-size: 12px; cursor: pointer; }
.col-check:hover { border-color: var(--accent); }
.col-check input { width: auto; cursor: pointer; }
.rpt-count { font-size: 12px; color: var(--text2); margin-bottom: 8px; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
/* Bottom tab bar — hidden on desktop, shown via mobile media query */
.bottom-tab-bar { display: none; }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 60px; /* leave room for bottom tab bar */
    z-index: 160;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
    width: min(280px, 80vw);
  }
  .sidebar.open { transform: translateX(0); }
  .sb-backdrop.open { display: block; }
  .main { padding: 12px 12px 74px; } /* bottom padding for tab bar */

  /* ── BOTTOM TAB BAR ──────────────────────────────────────── */
  .bottom-tab-bar {
    display: flex !important;
    position: fixed; bottom: 0; left: 0; right: 0; height: 60px;
    background: var(--surface); border-top: 1px solid var(--border);
    z-index: 200; align-items: stretch;
  }
  .bottom-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; cursor: pointer;
    color: var(--text2); font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    border: none; background: none; transition: color .15s;
    padding: 0; -webkit-tap-highlight-color: transparent;
  }
  .bottom-tab .bt-icon { font-size: 1.4rem; line-height: 1; }
  .bottom-tab.active { color: var(--accent); }
  .bottom-tab.active .bt-icon { transform: scale(1.12); }

  /* Make page header sticky on mobile */
  .page-header { position: sticky; top: 0; z-index: 10; background: var(--bg); padding-bottom: 10px; margin-bottom: 8px; }

  /* Larger touch targets for dot ratings */
  .dot { width: 28px !important; height: 28px !important; }

  /* Sticky save button on mobile */
  .sticky-save { position: fixed; bottom: 64px; left: 0; right: 0; padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--border); z-index: 100; display: none; }
  .sticky-save.show { display: block; }
  .form-row2 { grid-template-columns: 1fr; }
  .form-row3 { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none !important; }
  .notif-drop { right: -60px; width: 265px; }
  .top-name, .top-role { display: none; }
}
@media (max-width: 480px) {
  .form-row3 { grid-template-columns: 1fr; }
  .hide-xs { display: none !important; }
  .auth-card { border-radius: var(--radius); }
  .tier-grid { grid-template-columns: 1fr 1fr; }
  .modal-box { max-height: 96vh; }
}
@media (max-width: 360px) {
  .hide-md { display: none !important; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Hand Paint Engine ──────────────────────────────────────── */
.hp-swatch-row { display:flex;gap:8px;margin:12px 0;flex-wrap:wrap; }
.hp-swatch { width:48px;height:48px;border-radius:var(--radius);border:1px solid var(--border);cursor:pointer;transition:transform .15s; }
.hp-swatch:hover { transform:scale(1.08); }

/* ── Log section title (UJJAPPA) ────────────────────────────── */
.log-section { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:12px;overflow:hidden; }
.log-sec-title { background:#8B3A2A;color:#fff;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:7px 14px; }
[data-theme="light"] .log-sec-title { background:#7a3222; }
.log-section .form-row2,.log-section .form-row3,.log-section .fg { padding:10px 14px 0; }
.log-section .fg:last-child,.log-section .form-row2:last-child,.log-section .form-row3:last-child { padding-bottom:12px; }

/* ── Fastness dots ──────────────────────────────────────────── */
.fastness-dot { width:14px;height:14px;border-radius:50%;border:1.5px solid var(--border);background:var(--bg);cursor:pointer;transition:background .12s,border-color .12s;flex-shrink:0;display:inline-block; }
.fastness-dot:hover { border-color:#8B3A2A; }
.fastness-dot.on { background:#8B3A2A;border-color:#8B3A2A; }

/* ── Course card hover ──────────────────────────────────────── */
.course-card { transition:border-color .15s,transform .15s; }
.course-card:hover { border-color:var(--accent);transform:translateY(-2px); }

/* ── Mail status bar ────────────────────────────────────────── */
.mail-status-bar { padding:12px 16px;border-radius:var(--radius);font-size:13px;line-height:1.6;border-left:4px solid; }
.status-ok   { background:rgba(63,185,80,.08);border-color:var(--success); }
.status-warn { background:rgba(210,153,34,.08);border-color:var(--warn); }

/* ── Print: force background colours ─────────────────────────────────────── */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  .swatch-chip, .shade-chip, [style*="background"], .stat-card,
  .insight-card, .nav-group, .nav-item, .sidebar, .topbar,
  .bottom-tab-bar { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .topbar, .sidebar, .bottom-tab-bar, .notif-drop, #hamburgerBtn { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .app-body { display: block !important; }
  body { background: #fff !important; color: #000 !important; }
}
