:root {
  --bg-dark: #1a1a1a;
  --bg-card: #242424;
  --bg-sidebar: #1e1e1e;
  --bg-input: #2e2e2e;
  --border: #333;
  --text: #e0e0e0;
  --text-muted: #888;
  --red: #c0392b;
  --red-hover: #a93226;
  --green: #27ae60;
  --yellow: #f39c12;
  --blue: #2980b9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  font-size: 14px;
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-brand {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; }
.sidebar-brand span { font-size: 18px; font-weight: 700; color: var(--red); letter-spacing: 1px; }

.sidebar-section { padding: 8px 0; border-bottom: 1px solid var(--border); }

.sidebar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 16px 4px;
}

/* DROPDOWN TOGGLE */
.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}

.dropdown-toggle:hover {
  background: rgba(192,57,43,.1);
  color: var(--text);
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform .2s;
}

.dropdown-toggle.open .dropdown-icon {
  transform: rotate(180deg);
}

/* DROPDOWN MENU */
.dropdown-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .2s ease;
  display: flex;
  flex-direction: column;
}

.dropdown-menu.open {
  max-height: 500px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 32px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .2s;
  font-size: 13px;
}

.sidebar a:hover, .sidebar a.active {
  background: rgba(192,57,43,.15);
  color: var(--text);
  border-left: 3px solid var(--red);
}

.sidebar a svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* MAIN */
.main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right .user-name { color: var(--text-muted); font-size: 13px; }

.content { padding: 24px; flex: 1; overflow-y: auto; }

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* GRID */
.row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.col { flex: 1; min-width: 200px; }
.col-2 { flex: 0 0 calc(50% - 8px); }
.col-3 { flex: 0 0 calc(33.333% - 11px); }
.col-4 { flex: 0 0 calc(25% - 12px); }

/* STAT CARDS */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  border-left: 3px solid var(--red);
}
.stat-card.green { border-left-color: var(--green); }
.stat-card.yellow { border-left-color: var(--yellow); }
.stat-card.blue { border-left-color: var(--blue); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-label { display: block; margin-bottom: 5px; font-size: 13px; color: var(--text-muted); }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
  transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--red); }
select.form-control option { background: var(--bg-input); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: #7b241c; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #1e1e1e;
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 10px 12px; border-bottom: 1px solid #2a2a2a; font-size: 13px; }
tbody tr:hover { background: rgba(255,255,255,.03); }
tbody tr:last-child td { border-bottom: none; }

/* BADGES */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green { background: rgba(39,174,96,.2); color: var(--green); }
.badge-red { background: rgba(192,57,43,.2); color: var(--red); }
.badge-yellow { background: rgba(243,156,18,.2); color: var(--yellow); }
.badge-blue { background: rgba(41,128,185,.2); color: var(--blue); }
.badge-gray { background: rgba(136,136,136,.2); color: var(--text-muted); }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: rgba(39,174,96,.15); border: 1px solid var(--green); color: var(--green); }
.alert-error { background: rgba(192,57,43,.15); border: 1px solid var(--red); color: #e74c3c; }
.alert-warning { background: rgba(243,156,18,.15); border: 1px solid var(--yellow); color: var(--yellow); }

/* TOOLBAR */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.search-box { display: flex; gap: 8px; }

/* PAGINATION */
.pagination { display: flex; gap: 4px; list-style: none; margin-top: 16px; }
.page-link {
  display: block;
  padding: 5px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}
.page-item.active .page-link { background: var(--red); border-color: var(--red); }

/* LOGIN PAGE */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-dark); }
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo span { font-size: 32px; font-weight: 800; color: var(--red); letter-spacing: 2px; }
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* HAMBURGER */
.hamburger { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .col-2, .col-3, .col-4 { flex: 0 0 100%; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
}

/* OVERLAY */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
.overlay.open { display: block; }

/* MODAL */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.btn-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; line-height: 1; }
