/* LaundryOps — app.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #2563eb; --blue-light: #dbeafe; --blue-mid: #93c5fd;
  --green: #16a34a; --green-light: #dcfce7;
  --amber: #d97706; --amber-light: #fef3c7;
  --red: #dc2626; --red-light: #fee2e2;
  --purple: #7c3aed; --purple-light: #ede9fe;
  --gray: #6b7280; --gray-light: #f3f4f6;
  --border: #e5e7eb; --white: #ffffff;
  --sidebar-w: 220px;
  --font: 'Inter', system-ui, sans-serif;
}

body { font-family: var(--font); background: #f0f2f5; color: #1a1a2e; min-height: 100vh; font-size: 14px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }

/* ── Layout ──────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: #1a1a2e; color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { padding: 20px 16px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand h1 { font-size: 15px; font-weight: 700; }
.sidebar-brand p  { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.nav-section { padding: 10px 0; }
.nav-label { font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.3); letter-spacing: 0.8px; padding: 0 16px 5px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px;
  cursor: pointer; font-size: 13px; color: rgba(255,255,255,0.62);
  transition: all .15s; border-left: 2px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(37,99,235,0.2); color: #93c5fd; border-left-color: #2563eb; }
.nav-item i { font-size: 15px; width: 16px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: #2563eb; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 10px; }
.staff-chip { cursor: default; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex-shrink: 0; color: #1d4ed8; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; position: sticky; top: 0; z-index: 100;
}
.topbar h2 { font-size: 16px; font-weight: 600; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.content { padding: 24px; flex: 1; overflow-y: auto; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; font-family: var(--font); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: transparent; color: var(--gray); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--gray-light); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ── Stats ───────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat-label { font-size: 11px; color: var(--gray); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 26px; font-weight: 700; margin: 4px 0 2px; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--gray); }
.stat-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-top: 4px; }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 20px; text-align: left; border-bottom: 1px solid var(--border); background: #fafafa; white-space: nowrap; }
td { padding: 11px 20px; font-size: 13px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafafa; }
.td-muted { color: var(--gray); font-size: 12px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-blue   { background: var(--blue-light);   color: #1d4ed8; }
.badge-green  { background: var(--green-light);  color: #15803d; }
.badge-amber  { background: var(--amber-light);  color: #b45309; }
.badge-red    { background: var(--red-light);    color: #b91c1c; }
.badge-purple { background: var(--purple-light); color: #6d28d9; }
.badge-gray   { background: var(--gray-light);   color: #374151; }

/* ── Forms ───────────────────────────────────────────────── */
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 5px; }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; font-family: var(--font); background: #fff; color: #111; }
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Filters / Search ─────────────────────────────────────── */
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--gray-light); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; border: 1px solid var(--border); }
.search-bar input { background: none; border: none; outline: none; font-size: 13px; flex: 1; font-family: var(--font); }
.search-bar i { color: var(--gray); font-size: 15px; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-tab { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--gray); transition: all .15s; }
.filter-tab:hover { background: var(--gray-light); }
.filter-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Progress ─────────────────────────────────────────────── */
.progress { height: 6px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; }

/* ── Status dots ──────────────────────────────────────────── */
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-green  { background: var(--green); }
.dot-amber  { background: var(--amber); }
.dot-red    { background: var(--red); }
.dot-gray   { background: #9ca3af; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 500px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.15); max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; }
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Equipment ───────────────────────────────────────────── */
.equip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
.equip-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; transition: all .15s; }
.equip-card:hover { border-color: var(--blue-mid); box-shadow: 0 2px 8px rgba(37,99,235,0.08); }
.equip-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.equip-meta { font-size: 11px; color: var(--gray); margin-bottom: 10px; }

/* ── Team ────────────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.team-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.team-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.team-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.team-name { font-size: 13px; font-weight: 600; }
.team-role { font-size: 11px; color: var(--gray); }

/* ── Utilities ───────────────────────────────────────────── */
.util-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; padding: 16px; }
.util-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.util-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 10px; }
.util-label { font-size: 12px; color: var(--gray); font-weight: 500; margin-bottom: 2px; }
.util-value { font-size: 22px; font-weight: 700; margin-bottom: 6px; }

/* ── Alert banner ─────────────────────────────────────────── */
.alert { padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-red { background: var(--red-light); color: #b91c1c; }
.alert-amber { background: var(--amber-light); color: #b45309; }
.alert-green { background: var(--green-light); color: #15803d; }

/* ── Timeclock banner ─────────────────────────────────────── */
.clock-banner { background: #1a1a2e; border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; color: #fff; display: flex; align-items: center; justify-content: space-between; }
.clock-time { font-size: 36px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 2px; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray); }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ── Toast ───────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 24px; background: #1a1a2e; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px; z-index: 9998; transform: translateY(80px); opacity: 0; transition: all .3s; display: flex; align-items: center; gap: 8px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast i { color: #4ade80; }

/* ── Misc ─────────────────────────────────────────────────── */
.text-muted  { color: var(--gray); }
.text-sm     { font-size: 12px; }
.text-right  { text-align: right; }
.fw-600      { font-weight: 600; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.d-flex { display: flex; } .align-center { align-items: center; }
code { background: #f3f4f6; padding: 1px 6px; border-radius: 4px; font-size: 12px; color: var(--blue); }

/* ── Mobile responsive ───────────────────────────────────── */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.mobile-only { display: none; }

@media (max-width: 768px) {
  body { font-size: 13px; }
  .mobile-topbar { display: flex; }
  .mobile-only { display: block; }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 150;
    transition: left .25s ease;
    width: 240px;
  }
  .sidebar.open { left: 0; }

  .main { width: 100%; }

  .content { padding: 12px; }

  .stats { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
  .stat-value { font-size: 20px; }

  .topbar { padding: 0 12px; height: 48px; }
  .topbar h2 { font-size: 14px; }
  .topbar-actions .btn { padding: 5px 8px; font-size: 12px; }

  table th, table td { padding: 8px 10px; font-size: 12px; }

  /* Hide non-essential columns on mobile */
  .hide-mobile { display: none; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }

  .equip-grid { grid-template-columns: 1fr 1fr; }
  .team-grid  { grid-template-columns: 1fr; }
  .util-grid  { grid-template-columns: 1fr; }

  .modal { width: 95vw !important; margin: 0 auto; }

  /* Reports responsive */
  .stats[style*="grid-template-columns:repeat(4"] { grid-template-columns: 1fr 1fr !important; }

  /* Cards stack on mobile */
  div[style*="grid-template-columns:1.6fr 1fr"],
  div[style*="grid-template-columns:1.4fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Bigger touch targets */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 30px; }
  .nav-item { padding: 10px 16px; }

  .filter-tabs { flex-wrap: wrap; gap: 4px; }
  .filter-tab { font-size: 11px; padding: 4px 8px; }

  /* Bug button moves left on mobile so it doesn't cover content */
  a[href*="bug-tracker"] { bottom: 12px !important; right: 12px !important; padding: 8px 12px !important; font-size: 12px !important; }
}

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