/* ============================================================
   eHADIR VOKSA — NEOBRUTALISM UTILITARIAN DESIGN SYSTEM
   ============================================================ */
:root {
  --bg: #FFFDF7;
  --surface: #FFFFFF;
  --ink: #0F172A;
  --muted: #475569;
  --accent: #FACC15;       /* Mustard Yellow */
  --accent-teal: #14B8A6;  /* In-Zone / Success */
  --accent-coral: #FB7185; /* Out-Zone / Spoof / Danger */
  --accent-blue: #38BDF8;  /* Info */
  --border: 2.5px solid #0F172A;
  --shadow: 4px 4px 0px #0F172A;
  --shadow-sm: 3px 3px 0px #0F172A;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(#CBD5E1 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: 84px;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.mono, .tabular-nums {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 3px solid var(--ink);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--ink);
}

.brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.clock-pill {
  background: var(--ink);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid var(--ink);
}

/* DESKTOP NAV */
.desktop-nav {
  display: none;
  background: var(--surface);
  border-bottom: 3px solid var(--ink);
  padding: 10px 16px;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 44px;
  background: var(--surface);
  color: var(--ink);
  border: var(--border);
  border-radius: var(--radius);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.nav-btn:hover { background: #FEF9C3; }
.nav-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.nav-btn.active { background: var(--accent); }

/* MOBILE BOTTOM NAV */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--surface);
  border-top: 3px solid var(--ink);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  gap: 6px;
}

.mnav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 6px 4px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  cursor: pointer;
}

.mnav-btn.active {
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

/* CONTAINER & CARDS */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.neo-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.card-head h2, .card-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

/* GRID HELPERS */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* STAT BOXES */
.stat-box {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
}

.stat-box.yellow { background: #FEF08A; }
.stat-box.teal { background: #CCFBF1; }
.stat-box.coral { background: #FFE4E6; }
.stat-box.blue { background: #E0F2FE; }

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 4px;
}

/* FORM CONTROLS */
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
  background: var(--surface);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-primary { background: var(--accent); }
.btn-teal { background: var(--accent-teal); color: #042F2E; }
.btn-coral { background: var(--accent-coral); color: #4C0519; }
.btn-dark { background: var(--ink); color: #FFFFFF; }
.btn-blue { background: var(--accent-blue); color: #082F49; }
.btn-sm { min-height: 36px; padding: 6px 10px; font-size: 0.78rem; box-shadow: 2px 2px 0 var(--ink); }
.btn-block { width: 100%; }

/* SHIFT SELECTOR PILLS */
.shift-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.shift-opt {
  border: var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.shift-opt.selected {
  background: var(--accent);
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-teal { background: #99F6E4; color: #042F2E; }
.badge-coral { background: #FECDD3; color: #881337; }
.badge-yellow { background: #FEF08A; color: #422006; }
.badge-gray { background: #E2E8F0; color: #1E293B; }
.badge-spoof { background: #BE123C; color: #FFFFFF; border-color: #0F172A; }

/* TABLES */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  background: var(--surface);
}

th, td {
  padding: 10px 10px;
  border-bottom: 2px solid var(--ink);
  border-right: 1px solid #CBD5E1;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--ink);
  color: #FFFFFF;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  white-space: nowrap;
}

tbody tr:nth-child(even) { background: #F8FAFC; }
tbody tr.spoof-row { background: #FFF1F2 !important; }

/* FILTER BAR */
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: end;
}

.filter-row > div { flex: 1; min-width: 170px; }

/* FLOATING BLUR NOTIFICATIONS & MODALS */
.float-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.float-backdrop.show { display: flex; }

.float-box {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 7px 7px 0 var(--ink);
  padding: 22px;
  animation: popIn 0.16s ease-out;
}

.toast-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.toast-overlay.show { display: flex; }

.toast-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 7px 7px 0 var(--ink);
  padding: 22px;
  text-align: center;
  animation: popIn 0.16s ease-out;
}

.toast-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 0 var(--ink);
}

.toast-icon.success { background: var(--accent-teal); }
.toast-icon.error { background: var(--accent-coral); }
.toast-icon.loading { background: var(--accent); }
.toast-icon.info { background: var(--accent-blue); }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* OFFLINE BANNER */
.offline-bar {
  display: none;
  background: var(--accent-coral);
  color: #4C0519;
  border-bottom: 3px solid var(--ink);
  padding: 8px 16px;
  text-align: center;
  font-weight: 800;
  font-size: 0.84rem;
}

.offline-bar.show { display: block; }

/* RESPONSIVE DESKTOP */
@media (min-width: 768px) {
  body { padding-bottom: 24px; }
  .desktop-nav { display: flex; }
  .mobile-nav { display: none; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   A4 PRINT LAYOUT (RELIEF & ADMIN REPORTS)
   ============================================================ */
.print-only { display: none; }

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body {
    background: #FFFFFF !important;
    background-image: none !important;
    color: #000000 !important;
    padding: 0 !important;
    font-size: 10pt;
  }
  .topbar, .desktop-nav, .mobile-nav, .offline-bar,
  .no-print, .float-backdrop, .toast-overlay {
    display: none !important;
  }
  .container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .neo-card, .stat-box {
    box-shadow: none !important;
    border: 1px solid #333333 !important;
    border-radius: 0 !important;
    background: #FFFFFF !important;
    padding: 10px !important;
    margin-bottom: 10px !important;
    break-inside: avoid;
  }
  .print-only { display: block !important; }
  .print-header {
    border-bottom: 2px solid #000000;
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .table-wrap { overflow: visible !important; border: 1px solid #000 !important; border-radius: 0 !important; }
  table { font-size: 8.5pt !important; width: 100% !important; }
  th { background: #1E293B !important; color: #FFFFFF !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 5px 6px !important; }
  td { padding: 4px 6px !important; border: 1px solid #94A3B8 !important; }
  .badge { border: 1px solid #333 !important; background: #F1F5F9 !important; color: #000 !important; font-size: 7.5pt !important; }
  .print-hide-gps { display: none !important; }
  .grid-4 { grid-template-columns: repeat(4, 1fr) !important; gap: 6px !important; }
  .grid-2 { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
}
