:root {
  --blue-dark: #1e3270;
  --blue: #2b449c;
  --orange: #f58220;
  --orange-hover: #e5741a;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: 700;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
}

.admin-sidebar {
  background: var(--blue-dark);
  color: #fff;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
}
.admin-brand img { height: 36px; width: auto; }
.admin-brand strong { font-size: 0.95rem; letter-spacing: 0.03em; display: block; }
.admin-brand span { font-size: 0.75rem; color: rgba(255,255,255,.65); }

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.admin-nav a {
  color: rgba(255,255,255,.8);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 150ms, color 150ms;
}
.admin-nav a:hover,
.admin-nav a.is-active {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.admin-nav a.is-active {
  border-left: 3px solid var(--orange);
  padding-left: calc(0.85rem - 3px);
}

.admin-sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.admin-sidebar-footer a { color: rgba(255,255,255,.78); }

.admin-main {
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-header h1 { font-size: 1.65rem; color: var(--blue-dark); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.panel h2 { font-size: 1.15rem; margin-bottom: 1rem; color: var(--blue-dark); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: var(--blue); line-height: 1.1; }
.stat-card .stat-lbl { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert--success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert--warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms;
}
.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-hover); text-decoration: none; }
.btn--secondary { background: var(--blue); color: #fff; }
.btn--secondary:hover { background: var(--blue-dark); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg); text-decoration: none; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.field label { font-size: 0.825rem; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245,130,32,.15);
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.75rem 0.65rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge--green { background: #dcfce7; color: #166534; }
.badge--gray  { background: #e2e8f0; color: #475569; }
.badge--red   { background: #fee2e2; color: #991b1b; }
.badge--blue  { background: #dbeafe; color: #1e40af; }

.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 48px rgba(0,0,0,.22);
}
.login-card .login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.login-card .login-brand img { height: 40px; width: auto; }
.login-card h1 { font-size: 1.35rem; color: var(--blue-dark); }
