/* =========================
   CSS VARIABLES
========================= */
:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;

  --primary: #2563eb;
  --primary-dark: #1d4ed8;

  --success: #16a34a;
  --danger: #ef4444;
  --warning: #f59e0b;

  --sidebar: #0b2a4a;
  --sidebar-dark: #0f3a66;

  --radius: 14px;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* =========================
   RESET & BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  text-decoration: none;
  color: inherit;
}

input,
button {
  font-family: inherit;
}

button {
  cursor: pointer;
}

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

/* =========================
   SIDEBAR
========================= */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-dark));
  color: #eaf2ff;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.nav {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav a {
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.9;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.sidebar .spacer {
  flex: 1;
}

/* =========================
   MAIN CONTENT
========================= */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* =========================
   TOPBAR
========================= */
.topbar {
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title h2 {
  font-size: 18px;
}

.page-title span {
  font-size: 12px;
  color: var(--muted);
}

/* =========================
   BUTTONS
========================= */
.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* =========================
   CONTENT AREA
========================= */
.content {
  padding: 20px;
}

/* =========================
   CARDS
========================= */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

/* =========================
   BADGES
========================= */
.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: #ecfdf3;
  color: var(--success);
}

.badge-danger {
  background: #fef2f2;
  color: var(--danger);
}

.badge-warning {
  background: #fffbeb;
  color: var(--warning);
}

/* =========================
   TABLES
========================= */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

thead th {
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: #f9fafb;
}

.actions {
  display: flex;
  gap: 8px;
}

/* =========================
   FORMS
========================= */
input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
}

/* =========================
   LIST ITEMS (LOGS, ACTIVITY)
========================= */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
}
