:root {
  --primary: #00b1f2;
  --ink: #0a1118;
  --ink-soft: #5b6472;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--ink);
  color: rgba(255,255,255,0.85);
  padding: 24px 16px;
  flex-shrink: 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 50;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; }
.sidebar__brand img { width: 34px; height: 34px; background: var(--primary); border-radius: 10px; padding: 6px; }
.sidebar__brand span { font-weight: 700; font-size: 1.1rem; color: #fff; }
.sidebar__section { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.35); margin: 18px 8px 6px; }
.sidebar__link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 0.92rem; margin-bottom: 2px;
  color: rgba(255,255,255,0.75);
}
.sidebar__link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar__link.is-active { background: var(--primary); color: #fff; }

.main { margin-left: 250px; flex: 1; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 1.2rem; margin: 0; }
.topbar__user { display: flex; align-items: center; gap: 14px; font-size: 0.88rem; color: var(--ink-soft); }
.sidebar-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 38px; height: 38px; cursor: pointer; }

.content { padding: 28px; max-width: 1100px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card h2 { margin-top: 0; font-size: 1.05rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .num { font-size: 1.8rem; font-weight: 700; }
.stat-card .lbl { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: none;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0089c2; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; border: 1px solid #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 8px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.badge-on { background: #dcfce7; color: #16a34a; }
.badge-off { background: #f3f4f6; color: #6b7280; }

.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-row .hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=password],
.form-row input[type=date], .form-row input[type=number], .form-row input[type=time],
.form-row textarea, .form-row select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.95rem; font-family: inherit; background: #fff;
}
.form-row textarea { resize: vertical; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,177,242,0.15);
}
.form-row .checkbox-row { display: flex; align-items: center; gap: 8px; }
.form-row .checkbox-row input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.current-image { max-width: 160px; border-radius: 10px; margin-bottom: 10px; display: block; border: 1px solid var(--border); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 0.9rem; }
.alert-success { background: #dcfce7; color: #15803d; }
.alert-error { background: #fee2e2; color: #b91c1c; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.login-card { background: #fff; border-radius: 20px; padding: 40px; width: 100%; max-width: 380px; text-align: center; }
.login-card img { width: 56px; height: 56px; background: var(--ink); border-radius: 16px; padding: 10px; margin: 0 auto 16px; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 24px; }

.empty { color: var(--ink-soft); text-align: center; padding: 40px 0; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: block; }
}
