:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --sidebar-bg: #1f2937;
  --sidebar-text: #e5e7eb;
  --bg: #f3f4f6;
  --card-bg: #fff;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .logo {
  padding: 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar nav a {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.main {
  margin-left: 240px;
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: calc(100vw - 240px);
}

h1 { font-size: 1.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
}
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.search-form { display: flex; gap: 0.5rem; align-items: center; }
.search-form input, .search-form select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  font-size: 0.9rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 0.9rem;
}
.data-table th, .data-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: #f9fafb;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.data-table tr:hover { background: #f9fafb; }

.btn {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 0.35rem;
  border: 1px solid transparent;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  background: #e5e7eb;
  color: var(--text);
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}
.badge.status-active { background: #d1fae5; color: #065f46; }
.badge.status-pending { background: #fef3c7; color: #92400e; }
.badge.status-inactive { background: #e5e7eb; color: #374151; }
.badge.status-draft { background: #f3f4f6; color: #6b7280; }
.badge.status-suspended { background: #fee2e2; color: #991b1b; }
.badge.status-rejected { background: #fee2e2; color: #991b1b; }

.pagination { margin-top: 1rem; display: flex; gap: 0.35rem; }
.pagination a {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  font-size: 0.85rem;
}
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.login-box {
  max-width: 360px;
  margin: 10vh auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 2rem;
}
.login-box h2 { margin-bottom: 1rem; }
.login-box label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.85rem; }
.login-box input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
}
.login-box button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.6rem;
  border: none;
  border-radius: 0.35rem;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 0.5rem; }

form label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.85rem; font-weight: 500; }
form input, form select, form textarea {
  width: 100%;
  max-width: 480px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  font-size: 0.9rem;
}
form input[type="checkbox"] { width: auto; display: inline; margin-right: 0.4rem; }
form button { margin-top: 1rem; }

@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; height: auto; }
  .main { margin-left: 0; max-width: 100%; }
  body { flex-direction: column; }
}
