:root {
  --color-bg-main: #0D1B2A;
  --color-bg-surface: #1B2838;
  --color-bg-card: #162232;
  --color-brand-primary: #00B4D8;
  --color-brand-dark: #0077A8;
  --color-brand-gradient: linear-gradient(135deg, #00B4D8, #0077A8);
  --color-text-primary: #FFFFFF;
  --color-text-secondary: #A8C8D8;
  --color-text-muted: rgba(168, 200, 216, 0.5);
  --color-border: rgba(0, 180, 216, 0.15);
  --color-success: #2DC653;
  --color-warning: #F59E0B;
  --color-danger: #E63946;
  --radius: 0.75rem;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--color-bg-main);
  color: var(--color-text-primary);
  min-height: 100vh;
}

a { color: var(--color-brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--color-bg-surface);
  border-right: 1px solid var(--color-border);
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-brand {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-brand img { height: 40px; }
.sidebar-brand-text h2 { font-size: 0.85rem; font-weight: 700; color: #fff; }
.sidebar-brand-text p { font-size: 0.7rem; color: var(--color-text-secondary); }
.sidebar-nav { list-style: none; padding: 0 0.75rem; }
.sidebar-nav li { margin-bottom: 0.25rem; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.sidebar-nav a:hover { background: rgba(0, 180, 216, 0.08); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: rgba(0, 180, 216, 0.12); color: var(--color-brand-primary); }
.sidebar-nav a i { width: 20px; text-align: center; }

/* Main content */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}
.topbar h1 { font-size: 1.5rem; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-user { font-size: 0.85rem; color: var(--color-text-secondary); }
.role-badge {
  background: rgba(0, 180, 216, 0.15);
  color: var(--color-brand-primary);
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-brand-primary);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.25rem; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--color-text-secondary); }

/* Cards & Panels */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}
.card-header h3 { font-size: 1rem; font-weight: 600; }

/* Tables */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 180, 216, 0.06);
  color: var(--color-text-primary);
}
tr:hover td { background: rgba(0, 180, 216, 0.03); }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-success { background: rgba(45, 198, 83, 0.15); color: var(--color-success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.badge-danger { background: rgba(230, 57, 70, 0.15); color: var(--color-danger); }
.badge-info { background: rgba(0, 180, 216, 0.15); color: var(--color-brand-primary); }
.badge-secondary { background: rgba(168, 200, 216, 0.1); color: var(--color-text-secondary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background: var(--color-brand-gradient); color: #0D1B2A; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-warning { background: var(--color-warning); color: #0D1B2A; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--color-bg-main);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}
select.form-control { appearance: none; }
textarea.form-control { min-height: 100px; resize: vertical; }

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.alert-success { background: rgba(45, 198, 83, 0.1); border: 1px solid rgba(45, 198, 83, 0.3); color: var(--color-success); }
.alert-danger { background: rgba(230, 57, 70, 0.1); border: 1px solid rgba(230, 57, 70, 0.3); color: var(--color-danger); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--color-warning); }
.alert-info { background: rgba(0, 180, 216, 0.1); border: 1px solid rgba(0, 180, 216, 0.3); color: var(--color-brand-primary); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
}
.modal h3 { margin-bottom: 1rem; }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.pagination a, .pagination span {
  padding: 0.4rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.pagination a:hover { background: rgba(0, 180, 216, 0.08); text-decoration: none; }
.pagination .active { background: var(--color-brand-primary); color: #0D1B2A; border-color: var(--color-brand-primary); }

/* Panels grid */
.panels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.panels-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-secondary);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* Utility */
.text-muted { color: var(--color-text-secondary); }
.text-sm { font-size: 0.8rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .panels-grid, .panels-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
