:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --bg: #eef2f7;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
}

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

/* Login */
.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top left, #ccfbf1 0%, #f8fafc 45%, #e0e7ff 100%);
}

.page__cotainer {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.ta-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-5 { margin-top: 2rem; }
.form { width: 100%; }

/* Admin shell */
.admin-body {
  min-height: 100vh;
}

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

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f3f3c 0%, #0f766e 100%);
  color: #ecfeff;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  transition: transform 0.25s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.sidebar__logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar__brand strong {
  display: block;
  font-size: 1rem;
}

.sidebar__brand span {
  font-size: 0.75rem;
  opacity: 0.8;
}

.sidebar__section {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  color: #ecfeff;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.sidebar__link.is-active {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.sidebar__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.sidebar__user strong {
  display: block;
  font-size: 0.9rem;
}

.sidebar__user span {
  font-size: 0.75rem;
  opacity: 0.8;
}

.sidebar__logout {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #ecfeff;
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.55rem 0.2rem;
  opacity: 0.9;
}

.sidebar__logout:hover {
  opacity: 1;
}

.admin-content-wrap {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__menu {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.topbar__title h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.topbar__title p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topbar__actions {
  margin-left: auto;
}

.topbar__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 600;
}

.topbar__badge i {
  font-size: 0.45rem;
}

.admin-page {
  padding: 1.25rem 1.5rem 2rem;
}

.admin-container {
  max-width: 1240px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.page-header__actions {
  display: flex;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.chip--info {
  background: #e0f2fe;
  color: #075985;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.stat-card--success {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.stat-card--danger {
  border-color: #fecaca;
  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.stat-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-card__icon--primary {
  background: #ccfbf1;
  color: #0f766e;
}

.stat-card__icon--success {
  background: #dcfce7;
  color: #166534;
}

.stat-card__icon--danger {
  background: #fee2e2;
  color: #991b1b;
}

.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 800;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.panel-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.panel-card__subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.panel-card__meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  background: #f1f5f9;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.85rem;
}

.search-box i {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
}

.filter-group {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  border-color: #99f6e4;
  color: var(--primary);
}

.filter-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.9rem;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.cell-id {
  font-weight: 700;
  color: var(--primary);
}

.user-badge {
  font-weight: 600;
}

.bool-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.bool-badge.is-yes {
  background: #ecfdf5;
  color: #047857;
}

.bool-badge.is-no {
  background: #f1f5f9;
  color: #64748b;
}

.ip-badge,
.date-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
}

.ip-badge {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  font-family: Consolas, Monaco, "Courier New", monospace;
}

.date-text {
  color: var(--text-muted);
}

.status-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pill.is-active {
  background: #dcfce7;
  color: #166534;
}

.status-pill.is-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  transition: 0.25s ease;
  border-radius: 999px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  transition: 0.25s ease;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.btn-icon--danger {
  color: var(--danger);
  border-color: #fecaca;
  background: #fff5f5;
}

.btn-icon--danger:hover {
  background: #fee2e2;
  color: #991b1b;
}

.btn-icon--success {
  color: var(--success);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.text-center { text-align: center; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem !important;
}

.empty-state i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.empty-state p {
  margin: 0;
}

.toast-alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 1.25rem 0;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: slideIn 0.25s ease;
}

.toast-alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.toast-alert--success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.toast-alert.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  transition: all 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification {
  margin: 1rem 1.25rem 0;
  border-radius: 10px;
}

.icon--button { cursor: pointer; }

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .admin-content-wrap {
    margin-left: 0;
  }

  .topbar__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }
}
