/* TMTT - Tekno Maintenance Tool Tracker */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ───────────────────────────── */
:root {
  --accent: #00d4ff;
  --accent2: #7c3aed;
  --accent3: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  /* Dark theme (default) */
  --bg: #0a0e1a;
  --bg2: #111827;
  --bg3: #1a2035;
  --bg4: #1e2d45;
  --surface: #141c2e;
  --surface2: #1c2840;
  --border: rgba(0,212,255,0.12);
  --border2: rgba(0,212,255,0.25);
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --glow: 0 0 20px rgba(0,212,255,0.15);
  --card-bg: rgba(20,28,46,0.9);
  --nav-bg: rgba(10,14,26,0.95);
  --input-bg: rgba(26,32,53,0.8);
}

[data-theme="light"] {
  --bg: #f0f4ff;
  --bg2: #e8edf8;
  --bg3: #dde4f5;
  --bg4: #d0d9f0;
  --surface: #ffffff;
  --surface2: #f5f8ff;
  --border: rgba(99,102,241,0.15);
  --border2: rgba(99,102,241,0.3);
  --text: #1e2d4a;
  --text2: #475569;
  --text3: #94a3b8;
  --shadow: 0 4px 24px rgba(99,102,241,0.1);
  --glow: 0 0 20px rgba(99,102,241,0.08);
  --card-bg: rgba(255,255,255,0.95);
  --nav-bg: rgba(240,244,255,0.95);
  --input-bg: rgba(245,248,255,0.9);
  --accent: #4f46e5;
}

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

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

body {
  font-family: 'Exo 2', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ── BG Pattern ──────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(0,212,255,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(124,58,237,0.05) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(79,70,229,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(124,58,237,0.04) 0%, transparent 60%);
}

/* ── Layout ──────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: 240px; min-height: 100vh;
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), width 0.3s;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  display: flex; align-items: center; gap: 0.75rem;
}

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 20px rgba(0,212,255,0.3);
  flex-shrink: 0;
}

.logo-text { line-height: 1.1; }
.logo-text strong {
  display: block;
  font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #fff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 0.05em;
}
[data-theme="light"] .logo-text strong {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-text small { font-size: 0.6rem; color: var(--text3); letter-spacing: 0.15em; text-transform: uppercase; }

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

.nav-section { padding: 0.5rem 1.25rem 0.25rem; font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text3); }

.nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s;
  position: relative;
  border-radius: 0;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(0,212,255,0.06);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(0,212,255,0.08);
}

.nav-link.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

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

/* ── Theme Toggle ────────────────────────── */
.theme-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem;
  cursor: pointer;
}

.theme-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  cursor: pointer; border: none;
  background: transparent; color: var(--text3);
  transition: all 0.2s;
}

.theme-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 8px rgba(0,212,255,0.4);
}

/* ── Main Content ────────────────────────── */
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  height: 60px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}

.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--text); cursor: pointer;
  padding: 0.25rem;
}

.topbar-title { font-size: 1rem; font-weight: 600; flex: 1; }
.topbar-title small { display: block; font-size: 0.7rem; color: var(--text3); font-weight: 400; }

.page-body { flex: 1; padding: 1.5rem; max-width: 1400px; width: 100%; }

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--border2); box-shadow: var(--glow); }

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
}

.card-title { font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.card-body { padding: 1.25rem; }

/* ── Stats Grid ──────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--accent));
}

.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); box-shadow: var(--glow); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-info { min-width: 0; }
.stat-value { font-size: 1.75rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text3); margin-top: 0.2rem; }

/* ── Equipment Grid ──────────────────────── */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.eq-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.eq-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), var(--glow);
}

.eq-thumb {
  height: 160px;
  background: var(--bg3);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

.eq-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.eq-card:hover .eq-thumb img { transform: scale(1.05); }

.eq-thumb-placeholder {
  font-size: 3rem; opacity: 0.3;
}

.eq-status-dot {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.eq-cat-badge {
  position: absolute; top: 0.75rem; left: 0.75rem;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  display: flex; align-items: center; gap: 0.3rem;
}

.eq-body { padding: 1rem; }
.eq-name { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.eq-code { font-size: 0.7rem; font-family: 'JetBrains Mono', monospace; color: var(--accent); }

.eq-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.72rem; color: var(--text3);
}

.eq-meta span { display: flex; align-items: center; gap: 0.25rem; }

.eq-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; color: var(--text3);
}

/* ── Badges ──────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-active { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.badge-danger  { background: rgba(239,68,68,0.15);  color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.badge-inactive{ background: rgba(100,116,139,0.15); color: #64748b; border: 1px solid rgba(100,116,139,0.3); }
.badge-info    { background: rgba(0,212,255,0.12); color: var(--accent); border: 1px solid rgba(0,212,255,0.25); }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem; font-weight: 600;
  font-family: 'Exo 2', sans-serif;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.2s; white-space: nowrap;
}

.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0099bb);
  color: #000; border-color: transparent;
  box-shadow: 0 0 16px rgba(0,212,255,0.2);
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(0,212,255,0.4); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg3); color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border2); background: var(--bg4); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger); border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
.btn-icon { padding: 0.4rem; border-radius: 6px; }
.btn-icon svg { width: 15px; height: 15px; }

/* ── Forms ───────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text2); margin-bottom: 0.4rem; letter-spacing: 0.02em; }
.form-label .req { color: var(--danger); }

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.875rem;
  color: var(--text);
  font-size: 0.875rem;
  font-family: 'Exo 2', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.form-control::placeholder { color: var(--text3); }

select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* Image Upload ─── */
.img-upload-area {
  border: 2px dashed var(--border2);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.img-upload-area:hover, .img-upload-area.dragover {
  border-color: var(--accent);
  background: rgba(0,212,255,0.04);
}

.img-upload-area input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1;
}

.img-preview {
  width: 100%; max-height: 200px;
  object-fit: cover; border-radius: 8px;
  display: none;
}

.upload-placeholder { color: var(--text3); font-size: 0.8rem; }
.upload-placeholder svg { width: 32px; height: 32px; margin-bottom: 0.5rem; opacity: 0.5; }

/* ── Tables ──────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

[data-theme="light"] td { border-bottom: 1px solid rgba(0,0,0,0.05); }

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

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(0,212,255,0.04); }

/* ── Log Timeline ────────────────────────── */
.timeline { position: relative; }

.timeline::before {
  content: '';
  position: absolute; left: 1.25rem; top: 0.5rem; bottom: 0.5rem;
  width: 1px; background: var(--border);
}

.timeline-item {
  display: flex; gap: 1rem;
  padding: 0.75rem 0;
  position: relative;
}

.timeline-dot {
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 0.9rem;
  position: relative; z-index: 1;
  border: 2px solid currentColor;
  background: var(--bg);
}

.timeline-content {
  flex: 1; min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  transition: border-color 0.2s;
}

.timeline-content:hover { border-color: var(--border2); }

.timeline-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.timeline-title { font-size: 0.875rem; font-weight: 600; }
.timeline-date { font-size: 0.72rem; color: var(--text3); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.timeline-desc { font-size: 0.8rem; color: var(--text2); margin-top: 0.4rem; }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.timeline-meta .chip {
  font-size: 0.68rem; padding: 0.15rem 0.5rem;
  background: var(--bg3); border-radius: 20px; color: var(--text3);
  display: flex; align-items: center; gap: 0.3rem;
}
.timeline-actions { display: flex; gap: 0.25rem; margin-top: 0.5rem; }

/* Log photo thumbnail */
.log-thumb {
  width: 60px; height: 44px;
  border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer; transition: transform 0.2s;
}
.log-thumb:hover { transform: scale(1.05); }

/* ── Alert / Flash ───────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  display: flex; align-items: center; gap: 0.625rem;
  margin-bottom: 1rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.alert-error   { background: rgba(239,68,68,0.12);  color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.alert-warning { background: rgba(245,158,11,0.12); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }

/* ── Filters ─────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.25rem; align-items: center;
}

.filter-bar .form-control { width: auto; min-width: 120px; }

.search-input-wrap { position: relative; flex: 1; min-width: 180px; max-width: 300px; }
.search-input-wrap svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text3); pointer-events: none; }
.search-input-wrap input { padding-left: 2.25rem; }

/* ── Monthly Summary ─────────────────────── */
.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.month-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem;
  cursor: pointer; transition: all 0.2s;
  text-align: center;
}

.month-card:hover { border-color: var(--accent); background: var(--bg4); }
.month-card.active { border-color: var(--accent); background: rgba(0,212,255,0.08); }
.month-name { font-size: 0.75rem; font-weight: 600; color: var(--text2); }
.month-count { font-size: 1.5rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--accent); }
.month-cost { font-size: 0.65rem; color: var(--text3); margin-top: 0.1rem; }

/* ── Upcoming alerts ─────────────────────── */
.alert-list { display: flex; flex-direction: column; gap: 0.5rem; }

.alert-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--surface2);
  border-left: 3px solid var(--accent);
  font-size: 0.8rem;
}

.alert-item.overdue { border-left-color: var(--danger); }
.alert-item.soon    { border-left-color: var(--warning); }

.alert-item-icon { font-size: 1rem; flex-shrink: 0; }
.alert-item-body { flex: 1; min-width: 0; }
.alert-item-title { font-weight: 600; }
.alert-item-sub { color: var(--text3); font-size: 0.72rem; }
.alert-item-days {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; font-weight: 700;
  white-space: nowrap;
}

/* ── Quick Stats (Equipment Detail) ──────── */
.qs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.qs-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem;
}

.qs-type { font-size: 0.7rem; color: var(--text3); margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.3rem; }
.qs-date { font-size: 0.85rem; font-weight: 600; }
.qs-next { font-size: 0.68rem; color: var(--text3); margin-top: 0.2rem; }
.qs-days { font-size: 0.7rem; font-family: 'JetBrains Mono', monospace; }

/* ── Breadcrumb ──────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--text3);
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb svg { width: 12px; height: 12px; }

/* ── Lightbox ────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.9);
  display: none; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }

/* ── Empty State ─────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text3);
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.3; margin-bottom: 0.75rem; }
.empty-state h3 { font-size: 0.95rem; color: var(--text2); margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.8rem; }

/* ── Equipment Photo Header ──────────────── */
.eq-detail-hero {
  height: 200px;
  background: var(--bg3);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.25rem;
  display: flex; align-items: center; justify-content: center;
}
.eq-detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.eq-detail-hero .placeholder { font-size: 4rem; opacity: 0.2; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.5); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .equipment-grid { grid-template-columns: 1fr; }
  .page-body { padding: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 1rem; }
}

/* ── Overlay ─────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  z-index: 99; background: rgba(0,0,0,0.5);
}
.sidebar-overlay.open { display: block; }

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

/* ── Misc ────────────────────────────────── */
.mono { font-family: 'JetBrains Mono', monospace; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text3); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-warning{ color: var(--warning); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-1 { flex: 1; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.fw-600 { font-weight: 600; }
