/* ==========================================================================
   VITIA BACK OFFICE STYLING
   Matches the project theme (Dark Navy / Bright Blue / Clean Admin UI)
   ========================================================================== */

:root {
  --navy: #003d5b;
  --dark-navy: #020b18;
  --panel-bg: #071b30;
  --panel-border: #163b5a;
  --input-bg: #08182a;
  --bright-blue: #46b5ff;
  --blue-hover: #1e90ff;
  --text-main: #e6f1ff;
  --text-muted: #a9bfd7;
  --healthy: #22c55e;
  --healthy-bg: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --critical: #ef4444;
  --critical-bg: rgba(239, 68, 68, 0.15);
  --inactive-gray: #64748b;
  --inactive-bg: rgba(100, 116, 139, 0.15);
}

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

body {
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(ellipse at top left, #09243c 0%, transparent 40%), var(--dark-navy);
  color: var(--text-main);
  min-height: 100vh;
}

/* ------------------------------
   Header / Navigation Bar
------------------------------ */
.topbar {
  height: 80px;
  background: var(--navy);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 35px;
  border-bottom: 2px solid var(--panel-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 1px;
}

.brand-logo {
  color: #58a3ff;
  font-size: 40px;
  font-weight: 900;
  transform: skew(-15deg);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-link {
  color: var(--bright-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  transition: all 0.2s;
}

.topbar-link:hover {
  background: rgba(70, 181, 255, 0.1);
  border-color: var(--bright-blue);
}

.btn-logout {
  background: transparent;
  color: var(--critical);
  border: 1px solid var(--critical);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--critical);
  color: white;
}

/* ------------------------------
   Login Gate Modal / Screen
------------------------------ */
.auth-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 11, 24, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 40px;
  width: 90%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.auth-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.auth-card h2 {
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.auth-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ------------------------------
   Main Layout & Container
------------------------------ */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}

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

.page-header h1 {
  font-size: 28px;
  color: var(--text-main);
}

.page-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* ------------------------------
   Buttons
------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--bright-blue);
  color: #020b18;
}

.btn-primary:hover {
  background: var(--blue-hover);
  color: #fff;
}

.btn-secondary {
  background: #163b5a;
  color: var(--text-main);
  border: 1px solid var(--panel-border);
}

.btn-secondary:hover {
  background: #1f4f78;
}

.btn-danger {
  background: var(--critical);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* ------------------------------
   Panels & Cards
------------------------------ */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 30px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.panel-header h2 {
  font-size: 20px;
  color: var(--bright-blue);
}

.panel-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ------------------------------
   Data Tables
------------------------------ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background: #081d33;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--panel-border);
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

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

.data-table code {
  background: #04101e;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--bright-blue);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge-active {
  background: var(--healthy-bg);
  color: var(--healthy);
  border: 1px solid var(--healthy);
}

.badge-inactive {
  background: var(--inactive-bg);
  color: var(--inactive-gray);
  border: 1px solid var(--inactive-gray);
}

.method-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 11px;
  background: #14385a;
  color: #8cc9ff;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ------------------------------
   Forms & Modals
------------------------------ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 11, 24, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  padding: 30px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 20px;
  color: var(--text-main);
}

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

.modal-close:hover {
  color: var(--text-main);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group .form-hint {
  font-size: 12px;
  color: #7995b5;
  margin-top: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--bright-blue);
  box-shadow: 0 0 0 2px rgba(70, 181, 255, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 10px;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--bright-blue);
}

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

/* ------------------------------
   Alerts & Notifications
------------------------------ */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}

.alert-success {
  background: var(--healthy-bg);
  border: 1px solid var(--healthy);
  color: #a7f3d0;
}

.alert-danger {
  background: var(--critical-bg);
  border: 1px solid var(--critical);
  color: #fca5a5;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  color: #fde68a;
}
