/* SGS Visitor — Unified theme system (dark / light)
 *
 * Single source of truth for ALL colors. Uses the same semantic var names
 * as index.html (--bg-primary, --text-primary, --accent, etc.) plus
 * legacy --c-* aliases that the per-page Tailwind configs reference.
 *
 * Activated by setting [data-theme="dark"] or [data-theme="light"] on <html>.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root,
:root[data-theme="dark"] {
  /* === DARK (default) — index.html palette === */
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #242836;
  --bg-card: #1e2230;
  --bg-card-hover: #252a3a;
  --border-color: #2d3348;
  --text-primary: #e8eaf0;
  --text-secondary: #9ca3b8;
  --text-muted: #6b7394;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-muted: rgba(99, 102, 241, 0.15);
  --success: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-muted: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-muted: rgba(59, 130, 246, 0.15);

  /* === LEGACY ALIASES — used by per-page tailwind.config blocks === */
  --c-deep: var(--bg-primary);
  --c-bg: var(--bg-primary);
  --c-bg2: var(--bg-secondary);
  --c-bg3: var(--bg-tertiary);
  --c-bg4: var(--bg-card-hover);
  --c-panel: var(--bg-secondary);
  --c-surface: var(--bg-card);
  --c-surface2: var(--bg-card-hover);
  --c-tx: var(--text-primary);
  --c-tx2: var(--text-secondary);
  --c-tx3: var(--text-muted);
  --c-dim: var(--text-secondary);
  --c-muted: var(--text-muted);
  --c-bdr: var(--border-color);
  --c-bdr2: var(--border-color);
  --c-accent: var(--accent);
  --c-accent2: var(--accent-hover);
  --c-accent-dim: var(--accent-muted);
  --c-blue: var(--info);
  --c-blue-dim: var(--info-muted);
  --c-red: var(--danger);
  --c-red-dim: var(--danger-muted);
  --c-orange: var(--warning);
  --c-purple: #a78bfa;
  --c-green: var(--success);
  --c-yellow: var(--warning);
  --c-accent-alt: var(--accent);
}

:root[data-theme="light"] {
  /* === LIGHT === */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef2f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f9fc;
  --border-color: #e1e6ee;
  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent: #5b5cf7;
  --accent-hover: #4548e3;
  --accent-muted: rgba(91, 92, 247, 0.12);
  --success: #16a34a;
  --success-muted: rgba(22, 163, 74, 0.12);
  --warning: #d97706;
  --warning-muted: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-muted: rgba(220, 38, 38, 0.12);
  --info: #2563eb;
  --info-muted: rgba(37, 99, 235, 0.12);
}

/* === GLOBAL FULL HEIGHT + RESPONSIVE + UNIFIED FONT === */
html, body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
/* Force all interactive elements to inherit the unified font */
input, select, textarea, button, table, th, td {
  font-family: inherit !important;
}

/* === UNIFIED SCROLLBAR === */
* { scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === UNIFIED FORMS (inputs/selects/textareas) — overrides all per-page styles === */
input[type="text"]:not([class*="bg-"]),
input[type="email"]:not([class*="bg-"]),
input[type="password"]:not([class*="bg-"]),
input[type="tel"]:not([class*="bg-"]),
input[type="number"]:not([class*="bg-"]),
input[type="date"]:not([class*="bg-"]),
input[type="search"]:not([class*="bg-"]),
select:not([class*="bg-"]),
textarea:not([class*="bg-"]) {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus:not([class*="bg-"]),
select:focus:not([class*="bg-"]),
textarea:focus:not([class*="bg-"]) {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* === UNIFIED TABLES === */
table { color: var(--text-primary); border-collapse: collapse; }
table th {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
  font-weight: 700;
}
table td { border-bottom: 1px solid var(--border-color) !important; color: var(--text-primary); }
table tbody tr:hover td { background: var(--bg-card-hover) !important; }

/* === UNIFIED MODAL OVERLAY === */
.modal-overlay,
.modal-backdrop,
[class*="bg-black/"][class*="fixed"][class*="inset-0"] {
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(4px);
}
:root[data-theme="light"] .modal-overlay,
:root[data-theme="light"] .modal-backdrop,
:root[data-theme="light"] [class*="bg-black/"][class*="fixed"][class*="inset-0"] {
  background: rgba(15, 23, 42, 0.45) !important;
}
.modal,
.modal-content,
[class*="bg-dark-"][class*="rounded"][class*="border"] {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary);
}

/* === UNIFIED TOASTS (handles both .ok/.err/.nfo and .success/.error/.warning/.info) === */
.toast-wrap, #toasts, #toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 9999;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  padding: 0.6rem 1rem !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #fff !important;
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid transparent;
  animation: sgsToastIn 0.25s ease;
}
.toast.ok, .toast.success { background: var(--success) !important; color: #fff !important; }
.toast.err, .toast.error { background: var(--danger) !important; color: #fff !important; }
.toast.nfo, .toast.info  { background: var(--info) !important; color: #fff !important; }
.toast.warning           { background: var(--warning) !important; color: #fff !important; }
@keyframes sgsToastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* === UNIFIED CARDS / PANELS — overrides per-page bg classes === */
.bg-panel, .bg-bg2, .bg-surface, .bg-dark-800, .bg-bg3 {
  background-color: var(--bg-secondary) !important;
}
.bg-bg, .bg-deep, .bg-dark-900 {
  background-color: var(--bg-primary) !important;
}
.bg-bg4, .bg-surface2, .bg-dark-700, .bg-bg-card-hover {
  background-color: var(--bg-tertiary) !important;
}
.border-bdr, .border-bdr2, .border-border, .border-border2,
.border-white\/10, .border-white\/\[0\.06\], .border-white\/\[0\.08\], .border-white\/\[0\.12\] {
  border-color: var(--border-color) !important;
}
.text-tx, .text-txt, .text-white { color: var(--text-primary) !important; }
.text-tx2, .text-tx3, .text-gray-300, .text-gray-400, .text-slate-300, .text-slate-400 { color: var(--text-secondary) !important; }
.text-dim, .text-muted, .text-gray-500, .text-gray-600, .text-slate-500, .text-slate-600 { color: var(--text-muted) !important; }

/* Light theme — boxicons can be too dark on white */
:root[data-theme="light"] .text-white { color: var(--text-primary) !important; }
/* When the unified topbar is injected, content below should fill the rest */
body.sgs-unified-nav > #sgsTopbar { flex-shrink: 0 !important; height: 56px !important; }
/* Children of body don't auto-grow — they keep their natural height.
 * Each page is responsible for its own internal layout. The body bg fills any
 * remaining vertical space because of html,body { height:100% }. */
body.sgs-unified-nav > *:not(#sgsTopbar):not(.nav-sidebar):not(.nav-sidebar-overlay):not(#liaWidget):not(#sgsPanicBtn):not(#sgsPanicModal):not(#sgsPanicToast):not(#toast-container):not(.toast-wrap):not(#toast) {
  flex-shrink: 0;
}

/* === HIDE LEGACY PER-PAGE TOPBARS when unified is active === */
/* The unified topbar is injected by nav-menu.js as <nav id="sgsTopbar">.
 * These rules hide ANY <nav> or <header> that is NOT our injected one.
 * Combined with the JS hideLegacyTopbars() in nav-menu.js for guaranteed coverage. */
body.sgs-unified-nav nav:not(#sgsTopbar):not(.nav-sidebar),
body.sgs-unified-nav header:not(#sgsTopbar) {
  display: none !important;
}
/* Also hide top-level <div> "topbars" used by some pages (users/companies/billing/reports/roles) —
 * detected as: first big flex container with justify-between + border-b */
body.sgs-unified-nav > div.flex.items-center.justify-between.border-b,
body.sgs-unified-nav > div[class*="border-b"][class*="justify-between"][class*="flex"]:first-of-type {
  display: none !important;
}

/* The dropdown arrow used by topbar selects */
.sgs-select-arrow {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239ca3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* === PRINTABLE BADGE CARD (calcomanía del visitante) === */
.badge-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: #fff;
  border: 2px solid #1a2332;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-family: 'Inter', system-ui, sans-serif;
  color: #1a2332;
}
.badge-card-header {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}
.badge-card-header i { font-size: 1.1rem; }
.badge-card-header .badge-card-date {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0;
}
.badge-card-body {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem;
  align-items: flex-start;
  background: #fff;
}
.badge-card-photo {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef2f7;
  border: 2px solid #1a2332;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.badge-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.badge-card-initials {
  font-size: 2rem;
  font-weight: 800;
  color: #6366f1;
  font-family: 'Inter', sans-serif;
}
.badge-card-info {
  flex: 1;
  min-width: 0;
}
.badge-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a2332;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}
.badge-card-id {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', Consolas, monospace;
  color: #4a5568;
  margin-bottom: 0.4rem;
  letter-spacing: 0.3px;
}
.badge-card-company,
.badge-card-visiting,
.badge-card-parking {
  font-size: 0.72rem;
  color: #2d3348;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.25;
}
.badge-card-company i,
.badge-card-visiting i,
.badge-card-parking i { color: #6366f1; font-size: 0.85rem; flex-shrink: 0; }
.badge-card-parking { background: #fef3c7; padding: 3px 6px; border-radius: 4px; margin-top: 0.25rem; }
.badge-card-parking i { color: #d97706; }
.badge-card-footer {
  background: #1a2332;
  color: #fff;
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.badge-card-number {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #00f28e;
}
.badge-card-purpose {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Print: only the badge card visible, full-page centered */
@media print {
  body * { visibility: hidden !important; }
  .badge-card, .badge-card * { visibility: visible !important; }
  .badge-card { position: absolute; top: 1cm; left: 50%; transform: translateX(-50%); }
}

/* Light mode tweaks for utility classes that hardcode rgba whites/blacks
 * commonly used by the existing pages */
:root[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: #c5cdd8;
}
:root[data-theme="light"] *::-webkit-scrollbar-track {
  background: transparent;
}

/* Inputs / selects in light mode get a visible border + light bg */
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background-color: var(--c-bg) !important;
  color: var(--c-tx) !important;
  border-color: var(--c-bdr2) !important;
}

/* Tables in light mode */
:root[data-theme="light"] table th {
  background-color: var(--c-bg2) !important;
  color: var(--c-tx2) !important;
}
:root[data-theme="light"] table td {
  border-color: var(--c-bdr) !important;
}
:root[data-theme="light"] table tr:hover td {
  background-color: rgba(0, 0, 0, 0.025) !important;
}

/* Modal overlays (rgba black) — soften in light mode */
:root[data-theme="light"] .modal-overlay,
:root[data-theme="light"] [class*="bg-black/"] {
  background-color: rgba(20, 30, 50, 0.45) !important;
}

/* === FLOATING BUBBLES (panic + theme toggle) === */
.sgs-bubble {
  position: fixed;
  bottom: 1rem;
  z-index: 99997;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}
.sgs-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* Panic button — Lia-edge style: small tab at right edge, expands on hover */
#sgsPanicBtn.sgs-bubble {
  position: fixed !important;
  right: 0 !important;
  bottom: 110px !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px 0 0 6px !important;
  background: rgba(240, 72, 72, 0.85) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  opacity: 0.65;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(240, 72, 72, 0.4);
  animation: panicPulse 2.4s ease-in-out infinite;
  z-index: 99996;
}
#sgsPanicBtn.sgs-bubble:hover {
  width: 36px !important;
  opacity: 1;
  background: linear-gradient(135deg, #ff5757, #d63333) !important;
  box-shadow: 0 4px 18px rgba(240, 72, 72, 0.7) !important;
  transform: none;
}
@keyframes panicPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(240, 72, 72, 0.4), 0 0 0 0 rgba(240, 72, 72, 0.5); }
  50%      { box-shadow: 0 2px 8px rgba(240, 72, 72, 0.4), 0 0 0 8px rgba(240, 72, 72, 0); }
}

/* === GLOBAL PANIC ALERT STATE ===
 * When data-panic="active" is set on <html> by theme.js, the entire page
 * shows a pulsating red border + a banner at top + the panic bubble
 * comes out fully and pulses intensely. Visible to ALL connected users
 * via WebSocket broadcast. */

/* Banner at the top of body (above the unified topbar) */
.sgs-panic-banner {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff !important;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 99998;
  box-shadow: 0 4px 24px rgba(239, 68, 68, 0.6);
  animation: panicBannerPulse 1.2s ease-in-out infinite;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.35;
}
.sgs-panic-banner > i {
  font-size: 1.6rem;
  flex-shrink: 0;
  animation: panicIconShake 0.6s ease-in-out infinite;
}
.sgs-panic-banner-info {
  flex: 1;
  min-width: 0;
}
.sgs-panic-banner-line1 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: baseline;
}
.sgs-panic-banner-line1 strong { font-weight: 800; font-size: 0.9rem; letter-spacing: 0.3px; }
.sgs-panic-banner-line1 span { color: rgba(255, 255, 255, 0.92); }
.sgs-panic-banner-line2 {
  margin-top: 0.25rem;
  font-style: italic;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
}
.sgs-panic-banner:hover { filter: brightness(1.08); }
.sgs-panic-banner-hint {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.9;
}
.sgs-panic-time { font-size: 0.72rem; opacity: 0.85; font-variant-numeric: tabular-nums; }
.sgs-panic-count {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
}
@keyframes panicBannerPulse {
  0%, 100% { background: linear-gradient(135deg, #ef4444, #b91c1c); }
  50%      { background: linear-gradient(135deg, #ff5252, #d32f2f); }
}
@keyframes panicIconShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
@media (max-width: 640px) {
  .sgs-panic-banner { font-size: 0.75rem; padding: 0.55rem 0.85rem; }
  .sgs-panic-banner-line1 strong { font-size: 0.78rem; }
  .sgs-panic-banner > i { font-size: 1.3rem; }
}

/* Pulsating red border around viewport when alert is active */
:root[data-panic="active"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99994;
  animation: panicBorderPulse 1.2s ease-in-out infinite;
  box-shadow: inset 0 0 0 6px rgba(239, 68, 68, 0.85);
}
@keyframes panicBorderPulse {
  0%, 100% { box-shadow: inset 0 0 0 4px rgba(239, 68, 68, 0.5), inset 0 0 60px rgba(239, 68, 68, 0.15); }
  50%      { box-shadow: inset 0 0 0 9px rgba(239, 68, 68, 1.0),  inset 0 0 80px rgba(239, 68, 68, 0.35); }
}

/* Intensify the panic bubble — fully out, bigger, hot pulse */
:root[data-panic="active"] #sgsPanicBtn.sgs-bubble {
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px 0 0 12px !important;
  opacity: 1 !important;
  background: linear-gradient(135deg, #ff0000, #cc0000) !important;
  font-size: 1.2rem !important;
  animation: panicBtnHotPulse 0.7s ease-in-out infinite !important;
}
@keyframes panicBtnHotPulse {
  0%, 100% { transform: scale(1);    box-shadow: -2px 2px 12px rgba(255, 0, 0, 0.7), 0 0 0 0  rgba(255, 0, 0, 0.7); }
  50%      { transform: scale(1.1);  box-shadow: -2px 2px 16px rgba(255, 0, 0, 1.0), 0 0 0 18px rgba(255, 0, 0, 0); }
}

/* Theme toggle button — injected by nav-menu.js into the topbar right section */
.sgs-theme-toggle {
  background: var(--c-bg3);
  color: var(--c-tx);
  border: 1px solid var(--c-bdr2);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.15s ease;
  font-family: inherit;
  flex-shrink: 0;
}
.sgs-theme-toggle:hover {
  background: var(--c-bg4);
  border-color: var(--c-accent);
  color: var(--c-accent);
}
:root[data-theme="light"] .sgs-theme-toggle {
  background: var(--c-bg2);
  color: var(--c-tx2);
}

/* Panic confirmation modal */
.sgs-panic-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.sgs-panic-modal.open { display: flex; }
.sgs-panic-modal-inner {
  background: var(--c-panel);
  border: 2px solid #f04848;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
  color: var(--c-tx);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.sgs-panic-modal h3 { font-size: 1rem; font-weight: 800; color: #f04848; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.sgs-panic-modal p { font-size: 0.78rem; color: var(--c-tx2); margin-bottom: 1rem; line-height: 1.5; }
.sgs-panic-modal label { display: block; font-size: 0.65rem; font-weight: 700; color: var(--c-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.3rem; }
.sgs-panic-modal input,
.sgs-panic-modal textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  background: var(--c-bg);
  border: 1px solid var(--c-bdr2);
  border-radius: 8px;
  color: var(--c-tx);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 0.8rem;
}
.sgs-panic-modal input:focus,
.sgs-panic-modal textarea:focus { border-color: #f04848; }
.sgs-panic-modal-actions { display: flex; gap: 0.5rem; }
.sgs-panic-modal-actions button {
  flex: 1;
  padding: 0.6rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.sgs-panic-cancel { background: var(--c-bg2); color: var(--c-tx2); border: 1px solid var(--c-bdr2) !important; }
.sgs-panic-confirm { background: linear-gradient(135deg, #f04848, #c92929); color: #fff; }
.sgs-panic-confirm:hover { background: linear-gradient(135deg, #ff5757, #d63333); }
.sgs-panic-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #00d67e, #00b368);
  color: #000;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.8rem;
  z-index: 99999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: none;
}
.sgs-panic-toast.show { display: block; animation: panicToastIn 0.3s ease; }
@keyframes panicToastIn {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
