:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-hover: #1e293b;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-soft: #f0fdfa;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success-bg: #dcfce7;
  --success-fg: #166534;
  --warning-bg: #fef9c3;
  --warning-fg: #854d0e;
  --danger-bg: #fee2e2;
  --danger-fg: #991b1b;
  --info-bg: #e0f2fe;
  --info-fg: #075985;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 265px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-badge {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #0284c7);
  color: #fff;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}

.brand-title { font-weight: 700; color: #fff; font-size: 16px; }
.brand-sub { font-size: 12px; color: #94a3b8; }

.nav-menu { padding: 14px 12px; flex: 1; }
.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 14px 10px 6px;
  font-weight: 700;
}
.nav-label:first-child { margin-top: 4px; }

.nav-link {
  display: flex; align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.nav-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; font-weight: 600; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-card { background: rgba(255,255,255,0.05); padding: 10px 12px; border-radius: 8px; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* Main area */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { flex: 1; }
.topbar-title h1 { margin: 0; font-size: 19px; font-weight: 700; }
.topbar-title p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.date-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.menu-toggle {
  display: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
}

.page-body { padding: 24px; flex: 1; max-width: 1360px; width: 100%; margin: 0 auto; }

.page-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
  display: flex; justify-content: space-between;
}

/* Grid & Cards */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.card-title { margin: 0; font-size: 16px; font-weight: 700; }

.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.stat-value { font-size: 28px; font-weight: 800; margin: 6px 0 2px; color: var(--text); }
.stat-sub { font-size: 12px; color: var(--muted); }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge-success { background: var(--success-bg); color: var(--success-fg); }
.badge-warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge-danger  { background: var(--danger-bg); color: var(--danger-fg); }
.badge-info    { background: var(--info-bg); color: var(--info-fg); }
.badge-primary { background: var(--primary-soft); color: var(--primary); border: 1px solid #99f6e4; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.alert-success { background: var(--success-bg); color: var(--success-fg); border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warning-bg); color: var(--warning-fg); border: 1px solid #fef08a; }
.alert-danger  { background: var(--danger-bg); color: var(--danger-fg); border: 1px solid #fecaca; }
.alert-info    { background: var(--info-bg); color: var(--info-fg); border: 1px solid #bae6fd; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: #f8fafc; font-weight: 700; color: #334155; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: #f8fafc; }

/* Forms & Buttons */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-group.full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #334155; }
input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="time"], input[type="number"], select, textarea, input[type="file"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #334155; color: #fff; }
.btn-outline { background: transparent; border-color: #475569; color: #e2e8f0; }
.btn-outline:hover { background: rgba(255,255,255,0.08); }
.btn-light { background: #f8fafc; border-color: var(--border); color: var(--text); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-muted { color: var(--muted); font-size: 12.5px; }
.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #115e59 100%);
}
.login-box {
  width: 100%; max-width: 430px;
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.login-header { text-align: center; margin-bottom: 22px; }
.login-header h2 { margin: 8px 0 4px; font-size: 21px; }
.login-header p { margin: 0; font-size: 13px; color: var(--muted); }

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
}

@media print {
  .sidebar, .topbar, .page-footer, .no-print { display: none !important; }
  .page-body { padding: 0; max-width: 100%; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
