:root {
  --nitro-red: #E01A1A;
  --nitro-yellow: #FFC910;
  --nitro-dark: #14181F;
  --nitro-dark-2: #1b212b;
  --nitro-border: #262d3a;
  --nitro-text-muted: #8792a3;
}

body {
  background: #f4f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Sidebar ---------- */
.nitro-sidebar {
  width: 250px;
  height: 100vh;
  height: 100dvh; /* mobile browsers: 100vh ignores the address bar and undercounts the visible area — 100dvh fixes that */
  background: var(--nitro-dark);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
}

.nitro-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--nitro-border);
}

.nitro-sidebar .brand img {
  height: 40px;
  width: auto;
}

.nitro-sidebar .brand-text {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.1;
  color: #fff;
}
.nitro-sidebar .brand-text span {
  display: block;
  font-weight: 500;
  font-size: 0.68rem;
  color: var(--nitro-text-muted);
  letter-spacing: 0.04em;
}

.nitro-sidebar nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: var(--nitro-red) var(--nitro-dark-2);
}
.nitro-sidebar nav::-webkit-scrollbar {
  width: 8px;
}
.nitro-sidebar nav::-webkit-scrollbar-track {
  background: var(--nitro-dark-2);
}
.nitro-sidebar nav::-webkit-scrollbar-thumb {
  background: var(--nitro-red);
  border-radius: 4px;
}

.nav-scroll-btn {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  background: var(--nitro-dark-2);
  color: #fff;
  border: none;
  border-top: 1px solid var(--nitro-border);
  border-bottom: 1px solid var(--nitro-border);
  font-size: 1rem;
  flex-shrink: 0;
  cursor: pointer;
}
.nav-scroll-btn:hover { background: var(--nitro-red); }
.nav-scroll-up { border-bottom: 1px solid var(--nitro-border); }
.nav-scroll-down { border-top: 1px solid var(--nitro-border); }

.nitro-sidebar .nav-section {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--nitro-text-muted);
  padding: 14px 10px 6px;
}

.nitro-sidebar .nav-link {
  color: #c7cdd6;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.nitro-sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.nitro-sidebar .nav-link:hover { background: var(--nitro-dark-2); color: #fff; }
.nitro-sidebar .nav-link.active {
  background: var(--nitro-red);
  color: #fff;
  font-weight: 600;
}

.nitro-sidebar .user-box {
  border-top: 1px solid var(--nitro-border);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--nitro-text-muted);
  flex-shrink: 0;
}
.nitro-sidebar .user-box strong { color: #fff; display:block; font-size: 0.86rem;}

/* ---------- Main content ---------- */
.nitro-main {
  margin-left: 250px;
  padding: 26px 30px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  color: #1a1f27;
}
.topbar .subtitle { color: #8792a3; font-size: 0.88rem; }

/* ---------- Cards / stat tiles ---------- */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid #e7e9ee;
  box-shadow: 0 1px 2px rgba(20,24,31,0.04);
  height: 100%;
}
.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: #1a1f27;
  line-height: 1.1;
}
.stat-card .stat-label {
  color: #8792a3;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.stat-card .stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 10px;
}
.bg-nitro-red { background: var(--nitro-red); }
.bg-nitro-yellow { background: var(--nitro-yellow); color: #1a1f27 !important; }
.bg-nitro-dark { background: var(--nitro-dark); }
.bg-nitro-green { background: #1f9d55; }

.panel {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e7e9ee;
  box-shadow: 0 1px 2px rgba(20,24,31,0.04);
  padding: 20px;
}
.panel h2 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #1a1f27;
}

/* ---------- Tables ---------- */
.table-nitro thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8792a3;
  border-bottom: 2px solid #e7e9ee;
  font-weight: 700;
  white-space: nowrap;
}
.table-nitro td { vertical-align: middle; font-size: 0.88rem; }
.table-nitro tbody tr:hover { background: #fafbfc; }

.badge-status { font-size: 0.72rem; font-weight: 600; padding: 5px 10px; border-radius: 20px; }
.badge-working { background: #e6f7ee; color: #1f9d55; }
.badge-defective { background: #fdeaea; color: #c62828; }
.badge-repair { background: #fff4e0; color: #b8720a; }
.badge-sold, .badge-disposed { background: #eef0f3; color: #5f6b7a; }
.badge-lost { background: #f3e6fb; color: #7b2fbe; }
.badge-unassigned { background: #eef0f3; color: #5f6b7a; }

/* Buttons */
.btn-nitro {
  background: var(--nitro-red);
  border-color: var(--nitro-red);
  color: #fff;
  font-weight: 600;
}
.btn-nitro:hover { background: #b81414; border-color: #b81414; color: #fff; }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #14181F 0%, #1f2530 60%, #2a1414 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 34px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-card img { height: 76px; display:block; margin: 0 auto 14px; }

/* ---------- Sidebar toggle (mobile/narrow screens) ---------- */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1060;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: none;
  background: var(--nitro-dark);
  color: #fff;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1040;
}
.sidebar-backdrop.open { display: block; }

@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .nitro-sidebar { transform: translateX(-100%); transition: transform .2s; z-index: 1050; }
  .nitro-sidebar.open { transform: translateX(0); }
  .nitro-main { margin-left: 0; padding-top: 70px; }
}

/* ---------- Print ---------- */
/* .print-only content (report headers, etc.) is hidden on screen and only shown
   when printing; .no-print is the opposite — visible on screen, hidden on paper. */
.print-only { display: none; }

@media print {
  .sidebar-toggle, .sidebar-backdrop, .nitro-sidebar, .no-print { display: none !important; }
  .print-only { display: block !important; }
  body { background: #fff !important; }
  .nitro-main { margin-left: 0 !important; padding: 0 !important; }
  .panel {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  a[href]::after { content: none !important; }
}
