/* =========================================================
   AutoReserva - Design System Principal
   Paleta: Dark slate + Indigo/Violet accent + Emerald success
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ─── */
:root {
  --bg-900:       #0f172a;
  --bg-800:       #1e293b;
  --bg-700:       #334155;
  --bg-glass:     rgba(30, 41, 59, 0.75);
  --border:       rgba(148, 163, 184, 0.12);

  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-light:#818cf8;
  --secondary:    #8b5cf6;
  --accent:       #06b6d4;

  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #3b82f6;

  --text-primary: #f1f5f9;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;

  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    18px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);

  --sidebar-w:    260px;
  --transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-900);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-800); }
::-webkit-scrollbar-thumb { background: var(--bg-700); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

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

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-800);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sidebar-logo .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sidebar-logo .brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar-logo .brand-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 400;
  -webkit-text-fill-color: var(--text-dim);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 10px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-light);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
}
.sidebar-user .avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .user-role {
  font-size: 0.7rem;
  color: var(--text-dim);
}
.btn-logout {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 1rem;
  padding: 4px; border-radius: 6px;
  transition: color var(--transition);
}
.btn-logout:hover { color: var(--danger); }

/* ─── Main Content ─── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--bg-800);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  box-sizing: border-box;
}
.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}
.topbar-breadcrumb {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.topbar-breadcrumb a { color: var(--primary-light); text-decoration: none; }
.topbar-breadcrumb a:hover { text-decoration: underline; }

.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.3rem;
}

.page-content { padding: 28px; flex: 1; }

/* ─── Cards ─── */
.card {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Stat Cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), border-color var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.indigo  { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.stat-icon.emerald { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-icon.amber   { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-icon.cyan    { background: rgba(6,182,212,0.15);  color: var(--accent); }
.stat-icon.rose    { background: rgba(239,68,68,0.15);  color: var(--danger); }
.stat-icon.violet  { background: rgba(139,92,246,0.15); color: var(--secondary); }

.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr {
  transition: background var(--transition);
}
.table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success   { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-warning   { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-danger    { background: rgba(239,68,68,0.15);  color: #f87171; }
.badge-info      { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-primary   { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.badge-secondary { background: rgba(100,116,139,0.15);color: #94a3b8; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.4); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #059669; transform: translateY(-1px); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; transform: translateY(-1px); }

.btn-warning {
  background: var(--warning);
  color: #1a1a1a;
}
.btn-warning:hover:not(:disabled) { background: #d97706; transform: translateY(-1px); }

.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Forms ─── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-control::placeholder { color: var(--text-dim); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 0.76rem; color: var(--text-dim); margin-top: 4px; }
.form-error { font-size: 0.76rem; color: var(--danger); margin-top: 4px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* ─── Alerts / Flash ─── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert-success { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.alert-error   { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.alert-warning { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.alert-info    { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.alert-icon    { font-size: 1.1rem; margin-top: 1px; }

/* ─── Page Header ─── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.page-header-left p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Action Buttons (tabela) ─── */
.actions { display: flex; align-items: center; gap: 6px; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.empty-state p  { font-size: 0.85rem; color: var(--text-dim); }

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Signature Canvas ─── */
.signature-wrap {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-900);
  overflow: hidden;
  position: relative;
}
.signature-wrap canvas { display: block; touch-action: none; cursor: crosshair; }
.signature-wrap .sig-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

/* ─── Modal Overlay ─── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scaleIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 1.2rem;
  padding: 4px; border-radius: 6px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ─── Modals ─── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.3s ease-out;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.2rem;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }

/* ─── Login Page ─── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at top left, rgba(99,102,241,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at bottom right, rgba(139,92,246,0.1) 0%, transparent 60%),
              var(--bg-900);
}
.login-box {
  width: 100%;
  max-width: 420px;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-logo p {
  font-size: 0.85rem;
  color: var(--text-dim);
  -webkit-text-fill-color: var(--text-dim);
  margin-top: 4px;
}

.login-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* ─── Dashboard ─── */
.recent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.6);
  }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .page-content { padding: 12px 10px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar-title, .topbar-breadcrumb { max-width: none; white-space: normal; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .col-span-2, .col-span-3 { grid-column: span 1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 12px; }
  .page-header h1 { font-size: 1.25rem; word-break: break-word; }
  .card { padding: 12px; width: 100%; box-sizing: border-box; }
  .modal { padding: 15px; }
}

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

/* ─── Notifications ─── */
.topbar-actions { display: flex; align-items: center; }
.notification-dropdown { position: relative; }
.btn-notification {
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
  position: relative; padding: 8px; color: var(--text-muted);
  transition: color var(--transition);
}
.btn-notification:hover { color: var(--primary-light); }
.notification-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 6px; border-radius: 99px;
  border: 2px solid var(--bg-800);
}
.notification-menu {
  position: absolute; top: 100%; right: 0; width: 320px;
  background: var(--bg-800); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow);
  display: none; flex-direction: column; z-index: 300;
  margin-top: 12px; animation: slideInUp 0.2s ease;
}
.notification-menu.open { display: flex; }
.notification-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 0.9rem;
}
.btn-link { background: none; border: none; color: var(--primary-light); cursor: pointer; font-size: 0.75rem; }
.notification-list { max-height: 360px; overflow-y: auto; }
.notification-item {
  display: block; padding: 12px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none; transition: background var(--transition);
}
.notification-item:hover { background: rgba(255,255,255,0.03); }
.notif-title { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); margin-bottom: 2px; }
.notif-text { font-size: 0.8rem; color: var(--text-dim); line-height: 1.4; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.notification-empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
@keyframes slideInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   Grupo Rocha Cavalcante - Visual refresh
   Tema claro corporativo com acento laranja da marca
   ========================================================= */

:root {
  --bg-900:       #f4f6f8;
  --bg-800:       #ffffff;
  --bg-700:       #e7ecf1;
  --bg-glass:     rgba(255, 255, 255, 0.9);
  --border:       #dfe5eb;

  --primary:      #f45113;
  --primary-dark: #d63f0b;
  --primary-light:#ff7a3d;
  --secondary:    #1f2933;
  --accent:       #0f7f8c;

  --success:      #168457;
  --warning:      #d97706;
  --danger:       #c9352b;
  --info:         #2563a8;

  --text-primary: #18202a;
  --text-muted:   #566574;
  --text-dim:     #7a8794;

  --radius:       8px;
  --radius-sm:    6px;
  --radius-lg:    12px;
  --shadow:       0 18px 45px rgba(24, 32, 42, 0.12);
  --shadow-sm:    0 8px 22px rgba(24, 32, 42, 0.07);
}

body {
  background:
    linear-gradient(180deg, #eef2f5 0%, #f8fafb 38%, #f4f6f8 100%);
  color: var(--text-primary);
}

::-webkit-scrollbar-track { background: #eef2f5; }
::-webkit-scrollbar-thumb { background: #b8c2cc; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8ee;
  box-shadow: 6px 0 24px rgba(24, 32, 42, 0.05);
}

.sidebar-logo {
  padding: 24px 22px 22px;
  background: #ffffff;
}

.sidebar-logo .brand img {
  max-height: 128px !important;
  object-fit: contain;
}

.nav-section-title {
  color: #8995a1;
  letter-spacing: 0.07em;
}

.nav-item {
  color: #4f5d6b;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: #fff3ed;
  color: #202833;
  border-color: #ffd7c5;
}

.nav-item.active {
  background: #f45113;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(244, 81, 19, 0.18);
}

.nav-item.active::before { display: none; }

.sidebar-user {
  background: #f7f9fb;
  border: 1px solid #e3e9ef;
}

.sidebar-user .avatar {
  background: #202833;
  color: #ffffff;
}

.sidebar-user .user-role,
.sidebar-user .user-name {
  color: #202833;
}

.btn-logout { color: #8a95a1; }

.main-content {
  background: transparent;
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e1e7ed;
  box-shadow: 0 8px 20px rgba(24, 32, 42, 0.04);
  backdrop-filter: blur(16px);
}

.topbar-title {
  color: #18202a;
  font-size: 1rem;
  font-weight: 700;
}

.topbar-breadcrumb,
.topbar-breadcrumb a {
  color: #6a7682;
}

.hamburger { color: #28313b; }

.page-content {
  padding: 30px;
}

.page-header {
  padding-bottom: 18px;
  border-bottom: 1px solid #e4eaf0;
}

.page-header-left h1 {
  color: #171f28;
  font-weight: 800;
}

.page-header-left p {
  color: #697684;
}

.card,
.stat-card,
.login-card,
.modal,
.notification-menu {
  background: #ffffff;
  border: 1px solid #e0e7ee;
  box-shadow: var(--shadow-sm);
}

.card {
  padding: 22px;
}

.card-title {
  color: #1e2732;
  font-weight: 700;
}

.stat-card {
  align-items: flex-start;
}

.stat-card:hover {
  border-color: #ffc8b2;
  transform: translateY(-2px);
}

.stat-icon {
  border-radius: 8px;
}

.stat-icon.indigo  { background: #fff0e8; color: #f45113; }
.stat-icon.emerald { background: #e8f6ef; color: var(--success); }
.stat-icon.amber   { background: #fff6df; color: var(--warning); }
.stat-icon.cyan    { background: #e6f5f7; color: var(--accent); }
.stat-icon.rose    { background: #fdeceb; color: var(--danger); }
.stat-icon.violet  { background: #eef1f4; color: #344252; }

.stat-value {
  color: #17202a;
  font-weight: 800;
}

.stat-label {
  color: #697684;
}

.table th {
  background: #f7f9fb;
  color: #647180;
  border-bottom-color: #dfe6ed;
}

.table td {
  border-bottom-color: #e7edf2;
  color: #25303b;
}

.table tbody tr:hover {
  background: #fff8f4;
}

.badge {
  border-radius: 999px;
  border: 1px solid currentColor;
}

.badge-success   { background: #eaf7f0; color: #147a50; }
.badge-warning   { background: #fff4dd; color: #a85f00; }
.badge-danger    { background: #fdebea; color: #b8322a; }
.badge-info      { background: #e8f1fb; color: #245f9f; }
.badge-primary   { background: #fff0e8; color: #d63f0b; }
.badge-secondary { background: #eef2f5; color: #5f6d7a; }

.btn {
  border-radius: 6px;
  box-shadow: none;
}

.btn-primary {
  background: #f45113;
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #d63f0b;
  box-shadow: 0 8px 20px rgba(244, 81, 19, 0.22);
}

.btn-success { background: #168457; }
.btn-danger { background: #c9352b; }
.btn-warning {
  background: #f59e0b;
  color: #20160a;
}

.btn-ghost {
  background: #ffffff;
  color: #334252;
  border: 1px solid #d8e0e8;
}

.btn-ghost:hover:not(:disabled) {
  background: #f7f9fb;
  color: #111827;
  border-color: #c8d2dc;
}

.form-label {
  color: #394655;
}

.form-control {
  background: #ffffff;
  border: 1px solid #cfd8e2;
  color: #1b2530;
}

.form-control:focus {
  border-color: #f45113;
  box-shadow: 0 0 0 3px rgba(244, 81, 19, 0.14);
}

.form-control::placeholder { color: #9aa5af; }

.alert-success { background: #eaf7f0; color: #126b47; border-color: #bfe5d0; }
.alert-error   { background: #fdebea; color: #a92f27; border-color: #f3c6c1; }
.alert-warning { background: #fff4dd; color: #8f5300; border-color: #f8db9b; }
.alert-info    { background: #e9f2fb; color: #245f9f; border-color: #c9def4; }

.filter-btn {
  background: #ffffff;
  color: #465463;
  border: 1px solid #d8e0e8;
}

.filter-btn:hover,
.filter-btn.active {
  background: #202833;
  color: #ffffff;
  border-color: #202833;
}

.signature-wrap {
  background: #fbfcfd;
  border-color: #cbd5df;
}

.modal-overlay {
  background: rgba(24, 32, 42, 0.42);
}

.login-page {
  background:
    linear-gradient(135deg, rgba(244, 81, 19, 0.12) 0%, rgba(244, 81, 19, 0.02) 32%, rgba(15, 127, 140, 0.10) 100%),
    #f6f8fa;
}

.login-box {
  max-width: 430px;
}

.login-logo p {
  color: #566574;
  -webkit-text-fill-color: #566574;
  font-weight: 600;
}

.login-card {
  backdrop-filter: none;
  border-top: 4px solid #f45113;
}

.notification-badge {
  border-color: #ffffff;
}

.notification-item:hover {
  background: #fff8f4;
}

.notif-title { color: #1e2732; }
.notif-text { color: #5f6d7a; }
.notif-time { color: #87939f; }

@media (max-width: 768px) {
  .sidebar.open {
    box-shadow: 14px 0 34px rgba(24, 32, 42, 0.18);
  }

  .page-content {
    padding: 14px 12px;
  }

  .topbar {
    padding: 11px 12px;
  }
}
