/* Admin Portal Styling */
:root {
  --admin-bg: #02120e;
  --admin-card: rgba(8, 38, 30, 0.75);
  --admin-card-hover: rgba(12, 52, 42, 0.9);
  --admin-border: rgba(212, 175, 55, 0.25);
  --admin-border-subtle: rgba(255, 255, 255, 0.08);
  --admin-gold: #d4af37;
  --admin-gold-light: #f5cf62;
  --admin-gold-gradient: linear-gradient(135deg, #f5cf62 0%, #d4af37 50%, #aa821d 100%);
  --admin-text: #f8fafc;
  --admin-muted: #94a3b8;
  --admin-danger: #ef4444;
  --admin-success: #10b981;
}

body.admin-body {
  font-family: 'Inter', sans-serif;
  background-color: var(--admin-bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, #02120e 0%, #010a08 100%);
  background-attachment: fixed;
  color: var(--admin-text);
  min-height: 100vh;
}

/* Admin Login Modal / Card */
.login-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.4));
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--admin-gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-desc {
  font-size: 0.88rem;
  color: var(--admin-muted);
  margin-bottom: 25px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--admin-border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

/* Time Selector Dropdown Group (Hour, Minute, AM/PM) */
.time-selector-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.time-selector-group select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(6, 35, 28, 0.95) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23f5cf62' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  color: var(--admin-gold-light, #f5cf62) !important;
  font-family: 'Outfit', 'Inter', monospace, sans-serif !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  padding: 10px 24px 10px 12px !important;
  border-radius: 10px !important;
  text-align: center !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-selector-group select.form-control:focus {
  border-color: #f5cf62 !important;
  box-shadow: 0 0 12px rgba(245, 207, 98, 0.3) !important;
  outline: none;
}

.time-selector-group select.time-sel-hour,
.time-selector-group select.time-sel-minute {
  flex: 1 1 0 !important;
  min-width: 64px !important;
}

.time-selector-group .time-sel-colon {
  font-family: 'Outfit', monospace;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--admin-gold-light, #f5cf62);
  user-select: none;
  line-height: 1;
}

.time-selector-group select.time-sel-ampm {
  flex: 1.1 1 0 !important;
  min-width: 74px !important;
  background-color: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  color: #34d399 !important;
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Admin Dashboard Topbar */
.admin-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--admin-border-subtle);
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.admin-nav-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-nav-title h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Admin Tabs Navigation */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--admin-border-subtle);
  margin-bottom: 30px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: var(--admin-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: #ffffff;
}

.admin-tab-btn.active {
  color: var(--admin-gold-light);
  border-bottom-color: var(--admin-gold);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--admin-border);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--admin-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
}

/* Dispatcher Layout */
.dispatcher-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 25px;
}

@media (max-width: 900px) {
  .dispatcher-grid {
    grid-template-columns: 1fr;
  }
}

.card-box {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}

.card-box-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Notification Preview */
.notif-preview-box {
  background: #1e293b;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  margin-top: 15px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.preview-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.preview-appname {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 500;
}

.preview-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}

.preview-body {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.preview-btn {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #cbd5e1;
}

/* Data Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--admin-border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 14px 16px;
  color: var(--admin-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--admin-border-subtle);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border-subtle);
  color: #e2e8f0;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-device {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(212, 175, 55, 0.12);
  color: var(--admin-gold-light);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.badge-device.mobile {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
}
