:root {
  --brand: #0d6efd;
  --brand-dark: #0a58ca;
  --bg: #f4f6f9;
  --sidebar-bg: #14213d;
  --sidebar-text: #b9c2d4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  background: var(--bg);
  color: #1e293b;
}

#app-shell { min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand i { font-size: 26px; color: #4dabf7; }
.brand-title { font-weight: 700; font-size: 17px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--sidebar-text); }

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7a99;
  padding: 14px 12px 4px;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .nav-link i { width: 18px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }

.sidebar-footer {
  font-size: 11px;
  color: #5b6b8c;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Main content */
#main-content { max-width: 1400px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.page-title { font-size: 22px; font-weight: 700; margin: 0; }
.page-sub { color: #64748b; font-size: 13px; }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid var(--brand);
}
.stat-card .stat-value { font-size: 26px; font-weight: 700; }
.stat-card .stat-label { color: #64748b; font-size: 13px; }
.stat-card.warn { border-left-color: #f59e0b; }
.stat-card.danger { border-left-color: #dc3545; }
.stat-card.success { border-left-color: #198754; }

.card-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}
table.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: middle;
}
table.data-table tr:hover td { background: #f8fafc; }

.badge-status {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.status-pending, .status-waiting, .status-scheduled, .status-unpaid { background:#fef3c7; color:#92400e; }
.status-done, .status-completed, .status-paid, .status-delivered, .status-dispatched, .status-administered, .status-reviewed, .status-signedoff { background:#dcfce7; color:#166534; }
.status-inprocess, .status-collected, .status-inconsultation, .status-occupied, .status-senttolab, .status-partial { background:#dbeafe; color:#1e40af; }
.status-rejected, .status-missed, .status-cancelled, .status-maintenance { background:#fee2e2; color:#991b1b; }
.status-vacant, .status-received, .status-na { background:#e2e8f0; color:#334155; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input[type="text"] { max-width: 280px; }

.empty-state { text-align:center; padding: 40px 20px; color: #94a3b8; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.action-btns button { margin-right: 4px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 1000; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
}
