/* ============================================================
   TPRSG APP — Stylesheet
   Theme: Ocean / Professional Dark
   ============================================================ */

:root {
  /* Colors */
  --bg:          #0d1117;
  --surface:     #161b22;
  --card:        #1f2937;
  --card-hover:  #263044;
  --border:      #30363d;
  --border-light:#374151;

  --primary:     #3b82f6;
  --primary-dark:#2563eb;
  --accent:      #06b6d4;
  --success:     #10b981;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --info:        #6366f1;

  --text:        #f0f6fc;
  --text-muted:  #8b949e;
  --text-dim:    #6e7681;

  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.3);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Layout ────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .3s ease;
}

.content {
  padding: 1.75rem 2rem;
  flex: 1;
  max-width: 1400px;
}

/* ── Sidebar Brand ─────────────────────────────────────────── */
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem; font-weight: 700;
  color: var(--accent);
  letter-spacing: .05em;
}
.sidebar-brand i { font-size: 1.3rem; }

/* ── Sidebar User ──────────────────────────────────────────── */
.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; flex-shrink: 0;
}
.user-name { font-size: .85rem; font-weight: 600; }
.user-role { font-size: .75rem; color: var(--text-muted); text-transform: capitalize; }

/* ── Sidebar Nav ───────────────────────────────────────────── */
.sidebar-nav { padding: .75rem 0; flex: 1; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.5rem;
  color: var(--text-muted); font-size: .88rem; font-weight: 500;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-nav li a i { width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-nav li a:hover, .sidebar-nav li a.active {
  color: var(--text);
  background: rgba(59,130,246,.1);
  border-left-color: var(--primary);
}
.sidebar-nav li a.active { color: var(--primary); }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: .6rem;
  color: var(--text-muted); font-size: .85rem;
  transition: color .2s;
}
.sidebar-footer a:hover { color: var(--danger); }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 2rem;
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle {
  display: none;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.15rem; padding: .4rem;
  transition: color .2s;
}
.sidebar-toggle:hover { color: var(--text); }
.page-title {
  font-size: 1.1rem; font-weight: 600; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-right {
  display: flex; align-items: center; gap: .75rem; margin-left: auto;
}

/* ── Notifications ─────────────────────────────────────────── */
.notif-wrapper { position: relative; }
.notif-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; padding: .5rem; position: relative;
  transition: color .2s;
}
.notif-btn:hover { color: var(--text); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.notif-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + .5rem);
  width: 320px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; z-index: 200;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: .75rem 1rem; font-weight: 600; font-size: .85rem;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.notif-item {
  display: block; padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text); transition: background .2s;
}
.notif-item:hover { background: var(--card-hover); }
.notif-title { font-size: .82rem; font-weight: 600; }
.notif-msg { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }
.notif-time { font-size: .72rem; color: var(--text-dim); margin-top: .2rem; }
.notif-empty { padding: 1.25rem 1rem; text-align: center; color: var(--text-muted); font-size: .85rem; }
.notif-all {
  display: block; padding: .6rem 1rem; text-align: center;
  font-size: .8rem; color: var(--primary);
  border-top: 1px solid var(--border); background: var(--surface);
}

/* ── Alert / Flash ─────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.5rem;
  font-size: .88rem; font-weight: 500;
  border-left: 4px solid;
  margin: 0;
}
.alert button { background:none; border:none; color:inherit; font-size:1.1rem; padding:0 0 0 .5rem; opacity:.7; }
.alert button:hover { opacity:1; }
.alert-success { background: rgba(16,185,129,.12); border-color: var(--success); color: #6ee7b7; }
.alert-error   { background: rgba(239,68,68,.12);  border-color: var(--danger);  color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,.12); border-color: var(--warning); color: #fcd34d; }
.alert-info    { background: rgba(99,102,241,.12); border-color: var(--info);    color: #a5b4fc; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 600; }
.card-sm { padding: 1rem; }

/* ── Stat cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; align-items: flex-start; gap: 1rem;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.blue    { background: rgba(59,130,246,.15); color: var(--primary); }
.stat-icon.cyan    { background: rgba(6,182,212,.15);  color: var(--accent); }
.stat-icon.green   { background: rgba(16,185,129,.15); color: var(--success); }
.stat-icon.yellow  { background: rgba(245,158,11,.15); color: var(--warning); }
.stat-icon.red     { background: rgba(239,68,68,.15);  color: var(--danger); }
.stat-icon.purple  { background: rgba(99,102,241,.15); color: var(--info); }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Grid helpers ──────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }

/* ── Page header row ───────────────────────────────────────── */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.page-head h2 { font-size: 1.25rem; font-weight: 700; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600; border: none;
  transition: all .2s; cursor: pointer; white-space: nowrap;
}
.btn i { font-size: .8rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #0891b2; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; color: #000; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card); color: var(--text); }
.btn-sm { padding: .35rem .75rem; font-size: .78rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 20px; font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-primary   { background: rgba(59,130,246,.15); color: #93c5fd; }
.badge-success   { background: rgba(16,185,129,.15); color: #6ee7b7; }
.badge-warning   { background: rgba(245,158,11,.15); color: #fcd34d; }
.badge-danger    { background: rgba(239,68,68,.15);  color: #fca5a5; }
.badge-info      { background: rgba(99,102,241,.15); color: #c4b5fd; }
.badge-secondary { background: rgba(107,114,128,.15);color: #9ca3af; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: .86rem;
}
thead th {
  padding: .75rem 1rem; text-align: left;
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.03); }
.td-actions { display: flex; gap: .5rem; align-items: center; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 2.5rem; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: .8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
}
.form-control {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: .65rem .9rem; font-size: .88rem;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}
.form-control::placeholder { color: var(--text-dim); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }
.form-actions {
  display: flex; gap: .75rem; justify-content: flex-end;
  padding-top: 1rem; border-top: 1px solid var(--border);
  margin-top: 1rem;
}

/* ── Auth page ─────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 2rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center; margin-bottom: 2rem;
}
.auth-logo i { font-size: 2.5rem; color: var(--accent); display: block; margin-bottom: .5rem; }
.auth-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.auth-logo p { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.auth-form .form-group { margin-bottom: 1.1rem; }
.auth-form .form-label { font-size: .82rem; color: var(--text-muted); text-transform: none; letter-spacing: 0; font-weight: 500; margin-bottom: .35rem; display: block; }
.auth-form .form-control { padding: .75rem 1rem; }

/* ── Timeline ──────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: .6rem; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-dot {
  position: absolute; left: -1.65rem; top: .3rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--bg);
}
.timeline-dot.green  { background: var(--success); }
.timeline-dot.yellow { background: var(--warning); }
.timeline-dot.cyan   { background: var(--accent); }
.timeline-dot.red    { background: var(--danger); }
.timeline-date { font-size: .75rem; color: var(--text-muted); margin-bottom: .2rem; }
.timeline-title { font-size: .88rem; font-weight: 600; }
.timeline-desc  { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Photo grid ────────────────────────────────────────────── */
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.photo-item {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border);
  cursor: pointer; position: relative;
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item:hover img { transform: scale(1.05); transition: transform .3s; }

/* ── Signature canvas ──────────────────────────────────────── */
.sig-canvas-wrap {
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: #fff; overflow: hidden;
}
#sigCanvas { display: block; width: 100%; cursor: crosshair; }
.sig-actions { display: flex; gap: .75rem; margin-top: .75rem; }

/* ── Timer ─────────────────────────────────────────────────── */
.timer-display {
  font-size: 3rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent); letter-spacing: .05em;
  text-align: center; padding: 1.5rem;
}

/* ── Profile blocks ────────────────────────────────────────── */
.profile-header {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.5rem; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; font-weight: 700; flex-shrink: 0;
}
.profile-name { font-size: 1.25rem; font-weight: 700; }
.profile-sub  { font-size: .85rem; color: var(--text-muted); margin-top: .15rem; }

.detail-list { display: flex; flex-direction: column; gap: .65rem; }
.detail-item { display: flex; gap: .75rem; align-items: flex-start; }
.detail-label {
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  min-width: 120px; padding-top: .05rem;
}
.detail-value { font-size: .88rem; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 1000;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: .75rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
}

/* ── Lightbox ──────────────────────────────────────────────── */
.lightbox-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92); z-index: 2000;
  align-items: center; justify-content: center;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.5rem;
  background: none; border: none; color: #fff; font-size: 2rem;
}

/* ── Misc ──────────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.search-bar {
  display: flex; gap: .75rem; align-items: center;
  margin-bottom: 1.25rem;
}
.search-bar .form-control { max-width: 320px; }

/* ── Responsive ────────────────────────────────────────────── */

/* Large tablet (1024px) */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .content { padding: 1.5rem; }
}

/* Tablet / iPad (768–1024px) */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-260px);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.45);
  }

  .main-wrapper { margin-left: 0 !important; }
  .sidebar-toggle { display: flex; }

  .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head { flex-wrap: wrap; gap: .5rem; }
}

/* Mobile (≤640px) */
@media (max-width: 640px) {
  .content { padding: 1rem; }
  .topbar { padding: 0 .75rem; gap: .5rem; }
  .page-title { font-size: .95rem; }

  .grid-2,
  .grid-3,
  .form-grid,
  .form-grid.cols-3 { grid-template-columns: 1fr !important; }
  .form-group.full { grid-column: 1 !important; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stat-card { padding: .85rem; }
  .stat-value { font-size: 1.4rem; }

  .card { padding: 1rem; }
  .card-header { flex-wrap: wrap; gap: .5rem; }

  /* Tables: horizontal scroll */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table { min-width: 520px; }

  /* Topbar buttons tight */
  .topbar-right .btn { padding: .4rem .6rem; font-size: .78rem; }

  /* Auth */
  .auth-card { padding: 1.5rem 1rem; margin: .5rem; }

  /* Timer */
  .timer-display { font-size: 2.5rem; padding: 1rem; }

  /* Signature canvas */
  #sigCanvas { height: 150px; }

  /* Modal full-width */
  .modal { max-width: calc(100vw - 2rem); }

  /* Photo grid tighter */
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

  /* Profile header stack */
  .profile-header { flex-direction: column; align-items: flex-start; }
  .profile-header > div:last-child { margin-left: 0 !important; display: flex; flex-wrap: wrap; }

  /* Detail list */
  .detail-item { flex-direction: column; gap: .15rem; }
  .detail-label { min-width: unset; }

  /* TD actions wrap */
  .td-actions { flex-wrap: wrap; }

  /* Filter tabs wrap */
  [style*="display:flex"][style*="gap:.5rem"] { flex-wrap: wrap; }

  /* Steps bar */
  .steps-bar { gap: .2rem; }
}

/* Small mobile (≤400px) */
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .timer-display { font-size: 2rem; }
  .btn-lg { padding: .65rem 1rem; font-size: .88rem; }
}

/* ── Mobile sidebar overlay ────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ── Touch-friendly tap targets ─────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 42px; }
  .sidebar-nav li a { padding: .8rem 1.5rem; }
  .form-control { padding: .75rem .9rem; font-size: 16px; } /* prevents iOS zoom */
  select.form-control { font-size: 16px; }
}

/* ── Print (for reports) ────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .form-actions { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; box-shadow: none; }
}
