/* ==========================================================================
   VNMAP AI CHATBOT — ADMIN PANEL OPERATE STYLESHEET
   Brand: VNMAP Civic AI Green (#0a7a55), High Contrast, Light Theme
   Responsive: Desktop (1440px) to Mobile (390px)
   ========================================================================== */

:root {
  --primary: #0a7a55;
  --primary-hover: #065c40;
  --primary-light: #e6f6ee;
  --primary-glow: #10b981;
  --primary-border: #b2cfbe;

  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;

  --bg-body: #f8faf9;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f3;
  --bg-sidebar: #ffffff;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --success: #0a7a55;
  --success-bg: #e6f6ee;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-border: #fca5a5;
  --info: #0284c7;
  --info-bg: #e0f2fe;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Utility classes */
.hidden {
  display: none !important;
}

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

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

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-mono {
  font-family: var(--font-mono);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--muted);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background-color: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.alert-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success);
  border-color: var(--primary-border);
}

.alert-info {
  background-color: var(--info-bg);
  color: var(--info);
  border-color: #bae6fd;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 38px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(10, 122, 85, 0.25);
}

.btn-outline {
  background-color: var(--bg-surface);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-subtle);
  color: var(--ink);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background-color: #b91c1c;
}

.btn-sm {
  padding: 5px 12px;
  min-height: 30px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.btn-icon:hover {
  background-color: var(--bg-subtle);
  color: var(--ink);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Spinner inside button */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}

.btn-outline .btn-spinner, .btn-ghost .btn-spinner {
  border-color: rgba(15, 23, 42, 0.2);
  border-top-color: var(--ink);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

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

.form-label-inline {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-right: 8px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  min-height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--ink);
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 122, 85, 0.12);
  outline: none;
}

.form-input-sm {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13px;
}

.form-range {
  width: 100%;
  accent-color: var(--primary);
}

.input-with-action {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-action .form-input {
  flex: 1;
}

.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

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

.form-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.form-actions-stacked {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   AUTH OVERLAY (Login & Must-Change-Password)
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, rgba(16, 185, 129, 0.08) 0%, #f8faf9 80%);
  backdrop-filter: blur(8px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.auth-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.auth-title {
  font-size: 20px;
  font-weight: 750;
  color: var(--primary);
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 12.5px;
  color: var(--muted);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-light);
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.25, 1);
  z-index: 50;
}

.sidebar-header {
  padding: 16px 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  height: 32px;
  width: auto;
}

.sidebar-title-wrap {
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--primary);
  line-height: 1.2;
}

.sidebar-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
}

.nav-link:hover {
  background-color: var(--bg-subtle);
  color: var(--ink);
  text-decoration: none;
}

.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot-online {
  background-color: var(--primary-glow);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.sidebar-version {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-body);
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-title {
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
}

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

.admin-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.user-details {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.user-role-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* Content Container */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.view-panel {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.15s ease-out;
}

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

.panel-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}

.panel-title {
  font-size: 20px;
  font-weight: 750;
  color: var(--ink);
}

.panel-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Content Box / Card */
.content-box {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  padding: 20px;
  margin-bottom: 20px;
}

.box-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}

/* ==========================================================================
   VIEW: OVERVIEW (KPIs & Traffic)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  font-feature-settings: "tnum";
}

.kpi-value.kpi-status-ok {
  font-size: 18px;
  color: var(--success);
  margin-top: 6px;
  font-weight: 750;
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted-light);
  margin-top: 6px;
}

.traffic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.traffic-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.traffic-label {
  font-weight: 600;
  color: var(--ink-secondary);
}

.traffic-val {
  font-weight: 750;
  font-size: 16px;
  color: var(--primary);
  font-family: var(--font-mono);
}

/* ==========================================================================
   VIEW: CONFIG
   ========================================================================== */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.config-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

.config-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.config-card-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.test-result-box {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.test-result-box.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--primary-border);
}

.test-result-box.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

/* ==========================================================================
   VIEW: DOCUMENTS & UPLOAD
   ========================================================================== */
.upload-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  color: var(--primary);
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.dropzone-link {
  color: var(--primary);
  text-decoration: underline;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.progress-wrap {
  margin-top: 16px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.data-table th {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.data-table tr:hover td {
  background-color: #fafbfb;
}

.table-footer-actions {
  display: flex;
  justify-content: center;
  padding: 16px 0 4px;
}

/* Filter toolbars */
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  max-width: 320px;
}

/* ==========================================================================
   TABS NAV (LOGS)
   ========================================================================== */
.tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  gap: 8px;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 750;
}

.tab-pane {
  display: none;
}

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

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.toggle-control input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
  max-width: 800px;
}

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

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

.modal-title {
  font-size: 17px;
  font-weight: 750;
  color: var(--ink);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(90vh - 130px);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Sensitive PII Warning Banner */
.pii-warning-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--warning);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  color: #92400e;
}

.pii-warning-title {
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

/* Conversation Transcript UI */
.transcript-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  max-width: 90%;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-bubble.user {
  align-self: flex-end;
  background-color: var(--primary-light);
  color: var(--primary-hover);
  border-bottom-right-radius: 2px;
}

.message-bubble.assistant {
  align-self: flex-start;
  background-color: var(--bg-subtle);
  color: var(--ink);
  border-bottom-left-radius: 2px;
  border: 1px solid var(--border);
}

.message-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

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

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

.toast-message {
  flex: 1;
  color: var(--ink);
}

.toast-close {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.toast-close:hover {
  color: var(--ink);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Desktop to Mobile 390px)
   ========================================================================== */
.mobile-only {
  display: none !important;
}

@media (max-width: 900px) {
  .mobile-only {
    display: inline-flex !important;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

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

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

  .app-content {
    padding: 16px;
  }

  .panel-header-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-actions {
    justify-content: flex-start;
  }

  .auth-card {
    padding: 24px 18px;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0 14px;
  }

  .admin-user-badge .user-details {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kpi-card {
    padding: 12px 14px;
  }

  .kpi-value {
    font-size: 22px;
  }

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

  .modal-card {
    margin: 10px;
    max-height: 95vh;
  }

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