/* ==========================================================================
   EasyTrac v2 - South African Security Workforce Management System
   Corporate Brand Stylesheet (Midrange Green Corporate Theme)
   ========================================================================== */

:root {
  /* Corporate Midrange Green Theme */
  --primary: #15803d;         /* Midrange rich corporate green */
  --primary-light: #16a34a;   /* Bright emerald green */
  --primary-dark: #14532d;    /* Deep forest green */
  --primary-subtle: #dcfce7;  /* Soft green background */
  
  --accent: #0284c7;          /* Professional cobalt accent */
  --accent-hover: #0369a1;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0284c7;
  --info-light: #e0f2fe;

  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  
  --bg-main: #f4f7f5;
  --bg-card: #ffffff;
  --bg-sidebar: #0f2417;      /* Dark green-slate sidebar */
  --bg-sidebar-hover: #1b3d29;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-main: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg-main: #0a140e;
  --bg-card: #112217;
  --bg-card-header: #162c1e;
  --bg-sidebar: #07120a;
  --bg-sidebar-hover: #1c3826;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1f3d29;
  --neutral-50: #112217;
  --neutral-100: #0d1e14;
  --neutral-200: #1f3d29;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: #0d1e14;
  color: #f8fafc;
  border-color: #1f3d29;
}

[data-theme="dark"] .table th {
  background-color: #0d1e14;
  color: #94a3b8;
}

[data-theme="dark"] .table td {
  background-color: #112217;
}

[data-theme="dark"] .table tbody tr:hover td {
  background-color: #162c1e;
}

[data-theme="dark"] .modal-card {
  background-color: #112217;
  border-color: #1f3d29;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar Navigation */
#sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
  border-right: 1px solid rgba(22, 163, 74, 0.15);
}

.brand-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

.brand-info h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-info span {
  font-size: 0.72rem;
  color: #86efac;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
}

.nav-section-title {
  padding: 18px 20px 6px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6ee7b7;
  font-weight: 700;
  opacity: 0.85;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.28), transparent);
  color: #fff;
  border-left-color: var(--primary-light);
  font-weight: 700;
}

.nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: rgba(22, 163, 74, 0.25);
  color: #86efac;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compliance-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 163, 74, 0.2);
  color: #86efac;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.72rem;
}

#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
}

.app-header {
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--neutral-100);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  width: 340px;
  gap: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.header-search:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  width: 100%;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-btn {
  background: var(--neutral-100);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: var(--neutral-200);
}

.header-btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.header-btn.primary:hover {
  background: var(--primary-dark);
}

.header-btn.accent {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}

.header-btn.accent:hover {
  background: var(--primary);
}

.screen-container {
  padding: 28px;
  flex: 1;
  display: none;
}

.screen-container.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-bar h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-bar p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.kpi-card:active {
  transform: scale(0.98);
}

.kpi-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.kpi-card.accent::after { background: var(--accent); }
.kpi-card.success::after { background: var(--success); }
.kpi-card.warning::after { background: var(--warning); }
.kpi-card.danger::after { background: var(--danger); }
.kpi-card.info::after { background: var(--info); }

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--neutral-100);
}

.kpi-card.accent .kpi-icon { background: var(--info-light); color: var(--accent); }
.kpi-card.success .kpi-icon { background: var(--success-light); color: var(--success); }
.kpi-card.warning .kpi-icon { background: var(--warning-light); color: var(--warning); }
.kpi-card.danger .kpi-icon { background: var(--danger-light); color: var(--danger); }
.kpi-card.info .kpi-icon { background: var(--primary-subtle); color: var(--primary); }

.kpi-content h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-content .kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 4px 0 2px;
}

.kpi-content .kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h2, .card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 22px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background: var(--neutral-100);
  color: var(--neutral-700);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: rgba(21, 128, 61, 0.04);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-primary { background: #dcfce7; color: #15803d; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-gray { background: #f1f5f9; color: #475569; }

.grade-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.75rem;
  text-align: center;
  min-width: 26px;
}

.grade-A { background: #047857; color: #fff; }
.grade-B { background: #0284c7; color: #fff; }
.grade-C { background: #16a34a; color: #fff; }
.grade-D { background: #d97706; color: #fff; }
.grade-E { background: #64748b; color: #fff; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-bar input, .filter-bar select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.15);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--neutral-50);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neutral-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.15);
}

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--neutral-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 280px;
  border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media print {
  #sidebar, .app-header, .filter-bar, .header-actions, .no-print, .btn, .header-btn {
    display: none !important;
  }
  #main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .screen-container {
    padding: 0 !important;
    display: block !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   Dual-Mode Portal & Real-Time Sync Styles
   ========================================================================== */
.mode-switcher-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--neutral-100);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.mode-switcher-container select {
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sync-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: syncPulse 1.8s infinite;
}

@keyframes syncPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.75); }
}

.syncing .sync-pulse-dot {
  background: #0284c7;
  animation: fastSync 0.4s infinite;
}

@keyframes fastSync {
  0%, 100% { transform: scale(1.4); }
  50% { transform: scale(0.8); }
}

/* Site Terminal Header Banner */
#site-terminal-banner {
  background: linear-gradient(90deg, #14532d, #15803d);
  color: #fff;
  padding: 12px 28px;
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.terminal-title-area h3 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.terminal-title-area span {
  font-size: 0.8rem;
  color: #bbf7d0;
}

/* ==========================================================================
   Configurable Company Name Header Badge
   ========================================================================== */
.header-company-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--neutral-100);
  border: 1px solid var(--border-color);
  padding: 5px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.header-company-badge:hover {
  background: var(--primary-subtle);
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.company-badge-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.company-badge-info {
  display: flex;
  flex-direction: column;
}

.company-badge-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  line-height: 1;
}

.company-badge-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.company-badge-edit-hint {
  font-size: 0.72rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.header-company-badge:hover .company-badge-edit-hint {
  opacity: 1;
}

/* ==========================================================================
   AUTHENTICATION & USER PROFILE STYLES
   ========================================================================== */
body.auth-locked #sidebar,
body.auth-locked #main-content {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--card-bg, #ffffff);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 32px 28px;
  animation: authFadeIn 0.3s ease-out;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #fff;
  font-weight: 900;
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.4);
}

.auth-brand h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary-dark, #0f172a);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 8px;
}

.auth-compliance-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 10px;
  border-radius: 20px;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark, #1e293b);
  margin-bottom: 6px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-icon {
  position: absolute;
  left: 12px;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.7;
}

.auth-input-wrapper input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s;
  background: #f8fafc;
}

.auth-input-wrapper input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted, #64748b);
  cursor: pointer;
}

.auth-hint-text {
  color: #2563eb;
  font-weight: 600;
  font-size: 0.75rem;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}

.auth-submit-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.76rem;
  color: var(--text-muted, #94a3b8);
  border-top: 1px solid var(--border-color, #e2e8f0);
  padding-top: 14px;
}

/* Header User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--bg-surface, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e40af;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-dark, #0f172a);
}

.user-role {
  font-size: 0.65rem;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  font-weight: 600;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border-color, #cbd5e1);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #dc2626;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: 4px;
}

.logout-btn:hover {
  background: #fee2e2;
}

/* Biometrics & Hardware Ingestion Hub Styles */
.biometric-status-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card-header);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.status-indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
  position: relative;
}

.status-indicator-dot.online {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.header-btn.gold {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border-color: rgba(234, 179, 8, 0.4);
}

.header-btn.gold:hover {
  background: rgba(234, 179, 8, 0.25);
}

.header-btn.client {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.4);
}

.header-btn.client:hover {
  background: rgba(59, 130, 246, 0.25);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Application Footer
   ========================================================================== */
.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 16px 28px;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-separator {
  color: var(--neutral-400);
}
.footer-copy strong, .footer-credit strong {
  color: var(--text-main);
  font-weight: 700;
}
.footer-version {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--primary-light);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.leaflet-pulse-icon {
  background: transparent !important;
  border: none !important;
  cursor: pointer;
}
.pulse-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  left: 5px;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 2;
}
.pulse-dot:hover {
  transform: scale(1.3);
}
.pulse-dot.green { 
  background: #10b981; 
  box-shadow: 0 0 10px #10b981; 
}
.pulse-dot.red { 
  background: #ef4444; 
  box-shadow: 0 0 14px #ef4444; 
  animation: flashRedDot 0.8s infinite alternate ease-in-out;
}
.pulse-dot.orange { 
  background: #f59e0b; 
  box-shadow: 0 0 12px #f59e0b; 
  animation: flashOrangeDot 1s infinite alternate ease-in-out;
}

@keyframes flashRedDot {
  0% { transform: scale(0.9); opacity: 0.85; box-shadow: 0 0 8px #ef4444; }
  100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 22px #ef4444; }
}

@keyframes flashOrangeDot {
  0% { transform: scale(0.9); opacity: 0.85; box-shadow: 0 0 6px #f59e0b; }
  100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 20px #f59e0b; }
}

.pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  pointer-events: none;
}
.pulse-ring.red {
  border: 2px solid #ef4444;
  animation: leafletPulseRing 1.2s infinite ease-out;
}
.pulse-ring.orange {
  border: 2px solid #f59e0b;
  animation: leafletPulseRing 1.4s infinite ease-out;
}
@keyframes leafletPulseRing {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ==========================================================================
   Live Manning Status Banners & Officer Assignment Chips in Modals
   ========================================================================== */
.site-manning-status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}
.site-manning-status-banner.banner-red {
  background: rgba(220, 38, 38, 0.08);
  border: 1.5px solid #ef4444;
  color: #991b1b;
}
.site-manning-status-banner.banner-orange {
  background: rgba(245, 158, 11, 0.08);
  border: 1.5px solid #f59e0b;
  color: #92400e;
}
.site-manning-status-banner.banner-green {
  background: rgba(22, 163, 74, 0.08);
  border: 1.5px solid #16a34a;
  color: #14532d;
}
[data-theme="dark"] .site-manning-status-banner.banner-red {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
}
[data-theme="dark"] .site-manning-status-banner.banner-orange {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}
[data-theme="dark"] .site-manning-status-banner.banner-green {
  background: rgba(22, 163, 74, 0.2);
  color: #86efac;
}

.status-banner-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.status-banner-content {
  flex: 1;
}
.status-banner-content h4 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}
.status-banner-details {
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Officer Assignment Chips inside Modal */
.live-officer-chip {
  background: var(--neutral-100);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 10px;
}
.live-officer-chip.is-reliever {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}
.live-unmanned-chip {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
}

