/* BiroJodoh Admin UI polish */

:root {
  --admin-bg: #070a12;
  --admin-panel: rgba(15, 23, 42, 0.78);
  --admin-panel-strong: rgba(15, 23, 42, 0.94);
  --admin-border: rgba(148, 163, 184, 0.12);
  --admin-border-strong: rgba(148, 163, 184, 0.18);
  --admin-muted: #94a3b8;
  --admin-text: #e5e7eb;
  --admin-accent: #f43f5e;
  --admin-accent-soft: rgba(244, 63, 94, 0.13);
}

html,
body {
  background:
    radial-gradient(circle at 20% 0%, rgba(244, 63, 94, 0.10), transparent 28rem),
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.08), transparent 24rem),
    var(--admin-bg);
}

body {
  color: var(--admin-text);
}

.sidebar-base {
  width: 224px;
  background: rgba(2, 6, 23, 0.84);
  border-right: 1px solid var(--admin-border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease-out;
  overflow: hidden;
}

.sidebar-base.is-expanded {
  width: 224px;
}

.sidebar-base.is-collapsed {
  width: 68px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 65px;
  padding: 14px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.sidebar-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 10px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--admin-border);
  transition: all 0.15s ease;
}

.sidebar-toggle:hover {
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
}

.sidebar-label,
.sidebar-footer {
  transition: opacity 0.15s ease, transform 0.15s ease, width 0.15s ease;
}

.sidebar-base.is-collapsed .sidebar-head {
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}

.sidebar-base.is-collapsed .sidebar-brand {
  display: none;
}

.sidebar-base.is-collapsed .sidebar-label,
.sidebar-base.is-collapsed .sidebar-footer {
  width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
}

.sidebar-base.is-collapsed .nav-link {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-link.bg-slate-800 {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.16), rgba(15, 23, 42, 0.7)) !important;
  border-color: rgba(244, 63, 94, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.card {
  background: var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.20);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(2, 6, 23, 0.22);
}

.stat-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 38%),
    var(--admin-panel);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 18px;
  transition: all 0.2s ease;
  min-height: 120px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.stat-card:hover {
  border-color: var(--admin-border-strong);
  transform: translateY(-1px);
}

.th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

.td {
  padding: 12px 16px;
  color: #94a3b8;
  border-top: 1px solid rgba(148, 163, 184, 0.06);
}

tbody tr {
  transition: background-color 0.15s ease, color 0.15s ease;
}

tbody tr:hover {
  background: rgba(15, 23, 42, 0.78);
}

.input-field {
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.input-field:focus {
  border-color: rgba(244, 63, 94, 0.58);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
  background: rgba(2, 6, 23, 0.62);
}

.input-field option {
  background: #0f172a;
  color: #e2e8f0;
}

.icon-btn {
  padding: 8px;
  border-radius: 10px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--admin-border);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  color: white;
  background: rgba(30, 41, 59, 0.9);
}

.page-btn {
  padding: 6px;
  border-radius: 10px;
  color: #94a3b8;
  background: none;
  border: 1px solid var(--admin-border);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  color: white;
  background: #1e293b;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.admin-page {
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.chart-panel {
  min-height: 360px;
}

.settings-tab {
  border: 1px solid var(--admin-border);
}

.settings-tab.is-active {
  background: var(--admin-accent) !important;
  border-color: rgba(255, 255, 255, 0.16);
}

.switch-panel {
  background: rgba(2, 6, 23, 0.36);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
}

.fixed.inset-0.z-50 > div,
.fixed.inset-0.z-50 .bg-white,
.fixed.inset-0.z-50 [class*="bg-white"] {
  color: #111827;
}

.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: none;
  justify-content: space-around;
  align-items: center;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--admin-border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
}

.bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  min-width: 48px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.bottom-tab:active {
  transform: scale(0.92);
}

.bottom-tab.text-rose-400 {
  color: #ffffff !important;
}

.safe-top {
  padding-top: max(12px, env(safe-area-inset-top, 12px));
}

.animate-in {
  animation: animateIn 0.2s ease-out;
}

@keyframes animateIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.4); }

@media (min-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .dashboard-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .p-6 { padding: 14px !important; }

  .dashboard-grid {
    gap: 10px;
  }

  .stat-card { padding: 14px; min-height: 112px; }
  .stat-card p.text-2xl { font-size: 1.25rem; }

  .card-header {
    padding: 12px 14px;
    align-items: flex-start;
    gap: 10px;
  }

  .th { padding: 10px 12px; font-size: 10px; }
  .td { padding: 10px 12px; font-size: 13px; }

  .fixed.inset-0.z-50 .max-w-2xl,
  .fixed.inset-0.z-50 .max-w-lg {
    max-width: 100% !important;
    margin: 0 !important;
    height: 100vh;
    border-radius: 0 !important;
  }

  .page-btn { padding: 10px; min-width: 40px; min-height: 40px; }
  .icon-btn { padding: 10px; min-width: 40px; min-height: 40px; }

  .input-field { padding: 10px 12px; font-size: 16px; }
  textarea.input-field { font-size: 16px; }

  body { overscroll-behavior: none; }

  .bottom-tab-bar {
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    padding-left: 6px;
    padding-right: 6px;
  }

  .bottom-tab {
    flex: 0 0 64px;
  }

  a, button { -webkit-user-select: none; user-select: none; }
}
