:root{
  --bg: #F5FAFC;
  --surface: #FFFFFF;
  --surface2: #f8fafc;
  --primary: #1F6F8B;
  --primary-dark: #0B2E3A;
  --accent: #2E8CA6;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;
  
  --sidebar-w: 260px;
  --topbar-h: 70px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-light: #334155;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
  background-color: var(--bg); 
  color: var(--text-main); 
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }

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

/* -------------------------------------
   SIDEBAR (Professional Dark Teal)
-------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  position: fixed;
  top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform 0.3s ease, width 0.3s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,0.06);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .logo {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.1);
}
.sidebar-brand .brand-text {
  font-size: 20px; font-weight: 800; color: #ffffff;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 20px 16px;
}
/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.nav-section {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  color: rgba(255,255,255,0.4);
  padding: 16px 12px 8px; text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 12px;
  cursor: pointer; transition: all 0.2s ease;
  color: rgba(255,255,255,0.65);
  font-size: 14.5px; font-weight: 500;
  margin-bottom: 4px;
}
.nav-item i { font-size: 18px; width: 24px; text-align: center; }
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}
.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: #ffffff; font-weight: 600;
  box-shadow: inset 4px 0 0 var(--accent);
}

.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}

.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.08);
}

/* -------------------------------------
   TOPBAR
-------------------------------------- */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; padding: 0 32px; gap: 24px;
  z-index: 150; transition: left 0.3s;
}

.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search input {
  width: 100%; padding: 10px 16px 10px 42px;
  background: #f1f5f9; border: 1px solid transparent; border-radius: 10px;
  color: var(--text-main); font-size: 14.5px;
  transition: all 0.3s;
}
.topbar-search input:focus {
  background: var(--surface); border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(46, 140, 166, 0.1);
  outline: none;
}
.topbar-search i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: 15px;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px;
  cursor: pointer; transition: all 0.2s; position: relative;
}
.icon-btn:hover { background: #f8fafc; color: var(--primary); border-color: #cbd5e1; }
.notif-dot {
  position: absolute; top: 8px; right: 8px;
  width: 10px; height: 10px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--surface);
}

/* -------------------------------------
   MAIN CONTENT
-------------------------------------- */
.main-content {
  flex: 1; width: calc(100% - var(--sidebar-w)); margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h); min-height: 100vh;
  transition: margin-left 0.3s, width 0.3s;
}
.page-content { padding: 32px 40px; }

/* -------------------------------------
   BADGES & UI ELEMENTS
-------------------------------------- */
.badge-status {
  padding: 6px 12px; border-radius: 30px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; letter-spacing: 0.3px;
}
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge-status.active { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-status.active::before { background: #10b981; }
.badge-status.inactive { background: rgba(148, 163, 184, 0.1); color: #475569; }
.badge-status.inactive::before { background: #94a3b8; }

.btn {
  padding: 10px 20px; border-radius: 10px; font-weight: 600; font-size: 14.5px;
  transition: all 0.2s;
}
.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31,111,139,0.2); }

/* -------------------------------------
   DATATABLES OVERRIDES
-------------------------------------- */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border-light); border-radius: 8px;
  padding: 6px 12px; font-size: 14px; margin-left: 8px;
  outline: none; background: var(--surface); color: var(--text-main);
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,140,166,0.1); }
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border-light); border-radius: 8px;
  padding: 4px 28px 4px 12px; font-size: 14px; outline: none;
  background: var(--surface); color: var(--text-main);
}
table.dataTable.no-footer { border-bottom: none !important; }
table.dataTable thead th {
  border-bottom: 1px solid var(--border-light) !important;
  background: var(--surface2); color: var(--text-muted);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; padding: 14px 16px;
}
table.dataTable tbody td {
  padding: 16px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle; font-size: 14.5px; background: var(--surface); color: var(--text-main);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important; padding: 6px 12px !important; font-size: 13px !important;
  border: 1px solid transparent !important; margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important; color: white !important;
  border: none !important; box-shadow: 0 4px 10px rgba(31,111,139,0.3) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):hover {
  background: var(--surface2) !important; border: 1px solid var(--border-light) !important; color: var(--text-main) !important;
}

/* -------------------------------------
   CUSTOM UTILITIES
-------------------------------------- */
.shadow-sm-soft { box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important; }
.card { background: var(--surface); transition: transform 0.2s, box-shadow 0.2s; border: 1px solid var(--border-light) !important; color: var(--text-main); }
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,0.05) !important; }

/* -------------------------------------
   MODAL OVERRIDES
-------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px); z-index: 1050; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--surface); border-radius: 20px; width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: slideUpModal 0.3s ease; border: 1px solid var(--border-light);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 32px 16px; border-bottom: 1px solid var(--border-light); }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-main); }
.modal-close {
  width: 32px; height: 32px; border-radius: 10px; background: var(--surface2);
  border: none; cursor: pointer; color: var(--text-muted); transition: all 0.2s;
}
.modal-close:hover { background: #fee2e2; color: #ef4444; }
.modal-body { padding: 24px 32px; }
.modal-footer { padding: 16px 32px 24px; display: flex; justify-content: flex-end; gap: 12px; }

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