/* ---- Vision Management Platform - style.css, part 1 of 5 ---- */
/* Phase 12 of frontend modularization: style.css was split into 5 files
   at safe boundaries (verified comment/string/brace-aware, each file ends
   right after a fully-closed rule) and loaded via 5 <link> tags in the
   same order as the original file. This preserves the exact CSS cascade
   order byte-for-byte -- selectors are NOT grouped by feature/component
   because the original file interleaves the same component's rules across
   thousands of lines (e.g. .mpx-* grid rules appear from line ~4320 to
   ~18367), so a semantic regrouping would require re-deriving cascade
   order by hand and risk silently changing which rule wins. See
   frontend_modularization_plan.md Phase 12 for the deferred full reorg. */

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

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Vision Management Platform ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â- Cortex Design System -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --transition: all 0.15s ease;
  --sidebar-w: 240px;
  --sidebar-collapsed-w: 50px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #ffffff;
  --sidebar-muted: rgba(255, 255, 255, 0.62);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-border: #2d3748;
  --sidebar-active: #2563eb;
}

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

body {
  font-family: "Poppins", "Inter", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Scrollbar -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Premium Modern Login -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
/* ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ Premium Split Login Overlay (Strict No Scroll, 100vh Viewport) ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ÃƒÂ¢Ã¢â‚¬ÂÃ¢â€šÂ¬ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #ffffff;
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden !important;
}

/* Multi-page routing: paired with the early inline script in base.html's
   <head> that adds vp-has-token before <body> renders, so a returning user
   never sees the login form flash on a fresh page load / navigation.
   app.js's showApp() still does the real async auth check and removes
   #app's own .hidden class once that resolves; these rules only cover the
   instant before app.js has even loaded. */
html.vp-has-token #login-overlay {
  display: none !important;
}
html.vp-has-token #app.hidden {
  /* #app has no display rule of its own (a bare div defaults to block;
     .main-layout, its child, is what's actually display:flex) -- match
     that default rather than guessing flex here. */
  display: block !important;
}

.login-container {
  width: 100%;
  height: 100vh;
  display: flex;
  overflow: hidden !important;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

/* Left Hero Branding Side */
.login-branding {
  flex: 1.1;
  background: #141A26;
  padding: 44px 52px;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.brand-header-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #4F46E5;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.brand-logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1;
}

.brand-logo-sub {
  font-size: 11px;
  font-weight: 500;
  color: #94A3B8;
  margin-top: 3px;
}

.branding-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 20px;
}

.branding-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  color: #FFFFFF;
  margin: 0 0 14px 0;
  letter-spacing: -0.02em;
}

.branding-subtitle {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.6;
  color: #94A3B8;
  margin: 0 0 28px 0;
  max-width: 520px;
}

/* Stacked Feature List */
.login-feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.login-feature-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #818CF8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-feature-item h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #F8FAFC;
  margin: 0 0 3px 0;
}

.login-feature-item p {
  font-size: 12px;
  line-height: 1.45;
  color: #94A3B8;
  margin: 0;
}

/* Right Form Side */
.login-form-side {
  flex: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #FFFFFF;
  box-sizing: border-box;
}

.form-wrapper {
  width: 100%;
  max-width: 380px;
}

.form-title {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.form-subtitle {
  font-size: 13px;
  color: #64748B;
  margin-bottom: 20px;
}

.demo-auth-bar {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: #64748B;
}

.demo-auth-btn {
  border: none;
  background: transparent;
  color: #4F46E5;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12.5px;
  font-family: inherit;
  transition: color 0.15s ease;
}

.demo-auth-btn:hover {
  color: #3730A3;
  text-decoration: underline;
}

.demo-sep {
  color: #CBD5E1;
}

.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748B;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  background: #EEF2FF;
  border: 1px solid #E0E7FF;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #0F172A;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.input-group input:focus {
  background: #FFFFFF;
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

#toggle-password-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94A3B8;
  font-size: 15px;
  padding: 4px;
}

#toggle-password-btn:hover {
  color: #4F46E5;
}

.btn-signin {
  width: 100%;
  height: 44px;
  background: #4F46E5;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  margin-top: 20px;
}

.btn-signin:hover {
  background: #4338CA;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.account-cta {
  margin-top: 24px;
  background: #F8FAFC;
  border: 1px solid #F1F5F9;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.account-cta h3 {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 4px 0;
}

.account-cta p {
  font-size: 12px;
  color: #64748B;
  line-height: 1.5;
  margin: 0;
}

.account-cta a {
  color: #4F46E5;
  text-decoration: none;
  font-weight: 600;
}

.account-cta a:hover {
  text-decoration: underline;
}

.error-text {
  color: #ef4444;
  font-size: 12px;
  text-align: center;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
  .login-branding {
    flex: auto;
    padding: 40px 24px;
  }
  .branding-title {
    font-size: 24px;
  }
  .branding-content {
    gap: 20px;
  }
  .cognecto-logo svg {
    width: 160px;
    height: auto;
  }
  .feature-card {
    margin-top: 32px;
    padding: 16px;
  }
  .feature-text h3 {
    font-size: 14px;
  }
  .login-form-side {
    flex: auto;
    padding: 40px 24px;
  }
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Forms -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}

/* Asset-camera toggle card (camera create/edit forms) */
.asset-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
}
.asset-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin: 0;
}
.asset-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.asset-toggle span {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}
.asset-toggle small {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}
.asset-fields {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.asset-fields .form-group:last-child {
  margin-bottom: 0;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Buttons -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-outline {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.btn-accent {
  background: var(--accent);
  color: white;
  font-size: 12px;
  padding: 5px 12px;
}

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

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

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

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 14px;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Layout -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.main-layout {
  display: flex;
  height: 100vh;
  background: var(--bg-secondary);
  overflow: hidden;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Sidebar -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  z-index: 10;
  overflow: hidden; /* the inner .sidebar-nav-main scrolls, not the rail itself */
  position: relative;
  flex-shrink: 0;
  color: var(--sidebar-text);
  font-family: "Poppins", "Inter", sans-serif;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
  min-width: var(--sidebar-collapsed-w);
  cursor: pointer;
}

.sidebar.collapsed * {
  pointer-events: none;
}

.sidebar.collapsed .sidebar-toggle,
.sidebar.collapsed .logout-minimal,
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-item-link,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .sidebar-header {
  pointer-events: auto;
}

.sidebar-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  min-height: 60px;
  flex-shrink: 0;
}

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

.brand-icon {
  color: white;
  font-size: 16px;
  transition: var(--transition);
}

.brand-text {
  font-size: 15px;
  font-weight: 500;
  color: white;
  letter-spacing: -0.3px;
  flex: 1;
  transition: var(--transition);
}

.sidebar-toggle {
  background: var(--sidebar-hover);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: var(--transition);
  font-size: 13px;
}

.sidebar-toggle:hover {
  background: #3a3a3c;
  color: white;
  border-color: var(--accent);
}

/* Collapsed states for internal elements */
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-search input,
.sidebar.collapsed .user-identity span,
.sidebar.collapsed .sidebar-header h3 span,
.sidebar.collapsed .btn-accent,
.sidebar.collapsed .tree-container,
.sidebar.collapsed .stats-overview,
.sidebar.collapsed .brand-icon {
  display: none !important;
}

.sidebar.collapsed .sidebar-header-main {
  justify-content: center;
  padding: 12px 0;
}

.sidebar.collapsed .sidebar-brand {
  display: flex !important;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-toggle {
  display: none !important;
}

.sidebar.collapsed #toggle-icon {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .profile-row {
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
  border: none !important;
  background: transparent !important;
  width: 100%;
  display: flex;
}

.sidebar.collapsed .search-box {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  background: transparent;
  border-radius: 12px;
  border: none;
  margin: 0 auto;
}

.sidebar.collapsed .search-box i {
  margin-right: 0;
  color: #a1a1aa;
  font-size: 16px;
}

.sidebar.collapsed .profile-row {
  padding: 12px 0;
  background: transparent !important;
  border: none !important;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: center;
}

.sidebar.collapsed .logout-minimal {
  font-size: 18px;
  background: transparent;
  color: var(--sidebar-muted);
}

.sidebar.collapsed .logout-minimal:hover {
  color: var(--danger);
}

.sidebar.collapsed .sidebar-header {
  border: none;
}

.sidebar.collapsed .sidebar-header h3 {
  margin: 0;
}

.sidebar.collapsed .sidebar-header i {
  font-size: 18px;
  color: var(--sidebar-muted);
}

.sidebar.collapsed .user-identity i {
  font-size: 20px;
  color: var(--sidebar-muted);
}

.sidebar-nav-main {
  padding: 12px 14px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto; /* scroll the whole menu so Settings is always reachable */
  overflow-x: hidden;
}

/* Keep every top-level nav item at natural height; the menu scrolls instead of
   squishing/clipping the groups (which pushed Settings off-screen). */
.sidebar-nav-main > .nav-group-label,
.sidebar-nav-main > .sidebar-item-link,
.sidebar-nav-main > .sidebar-group {
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-nav-main {
  padding: 12px 0 4px 0 !important;
}

.sidebar-search {
  padding: 8px 14px 12px 14px;
  background: transparent;
  transition: var(--transition);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--sidebar-hover);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  background: #3a3a3c;
}

.search-box i {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.search-box input {
  border: none;
  background: transparent;
  font-size: 13px;
  color: white;
  width: 100%;
  outline: none;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--sidebar-muted);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px 8px 16px;
  transition: var(--transition);
}

.sidebar-header.clickable:hover {
  background: var(--sidebar-hover);
}

.sidebar-header h3 {
  font-size: 11px;
  font-weight: 500;
  color: white;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
}

.sidebar-header h3 i {
  font-size: 14px;
  color: white;
}

.tree-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  background: transparent;
}

.table-actions {
  width: 1%;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.table-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.table-actions div {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  justify-content: center;
}

th.text-right {
  text-align: right !important;
  white-space: nowrap;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Video Modal Specialties -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.video-modal-content {
  width: 80%;
  max-width: 1000px;
  padding: 0 !important;
  overflow: hidden;
  background: #000;
}

.video-preview-player {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.modal-header h2 {
  color: var(--text-primary);
  font-weight: 500;
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Tree -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.tree-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 12px;
  text-align: center;
  line-height: 1.6;
}

.tree-node {
  margin-left: 0;
}

.tree-node .tree-node {
  margin-left: 18px;
  border-left: none;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  user-select: none;
  color: var(--sidebar-muted);
}

.tree-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.tree-item.selected {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px #7ea1ea;
}

.tree-toggle {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #ffffff;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.tree-toggle.expanded {
  transform: rotate(90deg);
}

.tree-icon {
  color: white;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.tree-item.selected .tree-icon {
  color: white;
}

.tree-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-badge {
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.tree-badge.active,
.tree-badge.online {
  background: #d1fae5;
  color: #065f46;
}

.tree-badge.inactive {
  background: #fee2e2;
  color: #991b1b;
}

.tree-badge.offline {
  background: #fef3c7;
  color: #92400e;
}

.tree-badge.processed {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.tree-badge.raw {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.tree-children {
  display: none;
  margin-top: 2px;
}

.tree-children.expanded {
  display: block;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Sidebar Footer (legacy ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â- groups now inline in sidebar-nav-main) -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.sidebar-footer {
  padding: 8px 12px 12px 12px;
  background: transparent;
  flex-shrink: 0;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Cortex-style group labels & branding -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 14px 4px 14px;
}

.sidebar.collapsed .nav-group-label {
  display: none !important;
}

.brand-textwrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-sub {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.sidebar.collapsed .brand-textwrap {
  display: none !important;
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
  animation: brand-pulse 2.6s ease-in-out infinite;
}

@keyframes brand-pulse {
  0%, 100% { filter: drop-shadow(0 0 1px var(--accent)); opacity: 0.9; }
  50% { filter: drop-shadow(0 0 7px var(--accent)); opacity: 1; }
}

.sidebar-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--sidebar-muted);
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.sidebar-item-link:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-item-link.active {
  background: var(--sidebar-active);
  color: #ffffff;
  box-shadow: none;
}

.sidebar-item-link i,
.sidebar-svg-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  color: inherit !important;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Collapsed Sidebar Adjustments -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.sidebar.collapsed .sidebar-item-link {
  padding: 10px 0;
  justify-content: center;
}

.sidebar.collapsed .sidebar-item-link span {
  display: none !important;
}

.sidebar.collapsed .sidebar-divider {
  margin: 8px 10px !important;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 12px 16px;
  opacity: 0.5;
}

.sidebar.collapsed .sidebar-divider {
  margin: 8px 10px !important;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 0;
}

.sidebar.collapsed .sidebar-item-link {
  width: 38px;
  height: 38px;
  margin: 4px auto;
  padding: 0;
  border-radius: 12px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-item-link span {
  display: none !important;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Sidebar Group ("Operations") ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â- click-to-open side flyout -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.sidebar-group {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-group-toggle {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.8;
}

.sidebar-group.has-active-child > .sidebar-group-header {
  background: var(--sidebar-hover);
}

.sidebar-group.has-active-child > .sidebar-group-header > span {
  font-weight: 600;
}

/* Flattened inline group (Cortex manner): items sit under the "Operations"
   nav-group-label as normal nav rows, no click-to-open flyout. */
.sidebar-group-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Flattened Operations items behave like any nav row: labels show when the
   sidebar is expanded, and hide (icon-only) when it is collapsed ÃƒÂ¢Ã¢â€šÂ¬Ã¢â‚¬Â handled by
   the general `.sidebar.collapsed .sidebar-item-link span { display:none }`. */

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Hierarchy: collapsible camera-picker nested under Video Wall -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.sidebar-hierarchy {
  display: none;
  flex-direction: column;
  /* Natural height (bounded by the tree's max-height) so it opens inline and the
     Media/Insights/System groups flow right below it instead of being pushed off. */
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden; /* the inner .tree-container scrolls */
}

.sidebar-hierarchy.expanded {
  display: flex;
}

/* Bound the camera tree so it scrolls inside its own area rather than growing
   unbounded and shoving the rest of the menu down. */
.sidebar-hierarchy .tree-container {
  flex: 0 0 auto;
  max-height: 40vh;
  overflow-y: auto;
}

.sidebar-hierarchy-toggle {
  margin-left: auto;
  width: auto !important;
  font-size: 11px !important;
  transition: transform 0.2s;
}

.sidebar-hierarchy-toggle.expanded {
  transform: rotate(90deg); /* ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œ- ÃƒÂ¢Ã¢â‚¬Â Ã¢â‚¬â„¢ ÃƒÂ¢Ã¢â€šÂ¬Ã…â€œ- */
}

/* Collapsed rail: icon only, no chevron. */
.sidebar.collapsed .sidebar-hierarchy-toggle {
  display: none !important;
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.user-identity i {
  font-size: 18px;
  color: white;
}

.logout-minimal {
  border: none;
  background: transparent;
  color: white;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 14px;
}

.logout-minimal:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Main Content -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Top Navigation (Tab Bar) -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: white;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
  flex-shrink: 0;
}

.breadcrumb-area {
  flex-shrink: 0;
  min-width: 140px;
}

.breadcrumb-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Main Tab Bar -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.main-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
  flex: 1;
  justify-content: flex-start;
  margin-left: 20px;
}

.main-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.main-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.main-tab.active {
  background: #eff6ff;
  color: #2563eb;
  box-shadow: none;
}

.main-tab.active i {
  color: #2563eb;
}

.main-tab i {
  font-size: 13px;
}

.tab-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

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

.main-tab.tab-action:hover {
  background: #fee2e2;
  color: var(--danger);
}

.grid-layout-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.grid-layout-selector label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Header Shortcuts -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.header-shortcut-btn {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.header-shortcut-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--accent);
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- User Profile Nav -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.user-profile-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
  position: relative;
  user-select: none;
}

.user-profile-nav:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.user-profile-nav i.avatar {
  font-size: 18px;
  color: #475569;
}

.user-profile-nav span {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 2000;
  padding: 8px;
  display: none;
  text-align: left;
}

.user-profile-dropdown.active {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dropdown-item.danger {
  color: #ef4444;
}

.dropdown-item.danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 8px 0;
}

.grid-layout-selector select {
  padding: 6px 36px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  transition: var(--transition);
  min-width: 90px;
}

.grid-layout-selector select:hover {
  border-color: #cbd5e1;
}

.grid-layout-selector select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Tab Content -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.tab-content {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Video Wall: keep the grid as the scroll surface */
#tab-grid.active {
  overflow: hidden;
}

#tab-grid .camera-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Camera Grid -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.camera-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 24px;
  padding: 24px;
  overflow-y: auto;
  background: #f1f5f9;
}

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

.camera-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: min-content;
}

.camera-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: min-content;
}

.camera-grid.grid-4 {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: min-content;
}

.grid-cell {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  background-clip: padding-box;
  height: 100%;
}

.grid-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.grid-cell-video-container {
  background: #000;
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 14px 14px 0 0;
}

.grid-cell-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
}

.grid-cell-top-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.ai-badge {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(8px);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ai-badge i {
  font-size: 10px;
  color: #60a5fa;
}

.grid-cell-footer {
  background: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border-radius: 0 0 14px 14px;
}

.footer-icon-circle {
  width: 32px;
  height: 32px;
  background: #f0fdf4;
  color: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}

.footer-icon-circle.offline {
  background: #fef2f2;
  color: #ef4444;
}

.footer-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.footer-name {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.footer-refresh {
  width: 28px;
  height: 28px;
  background: #eff6ff;
  color: #3b82f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 10px;
}

.footer-refresh:hover {
  background: #3b82f6;
  color: white;
  transform: rotate(180deg);
}

.grid-cell-live {
  background: var(--danger);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.recording-dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 5px #ef4444;
}

.grid-cell video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Using contain to ensure the whole feed is visible without distortion or cropping */
  background: #000;
  display: block;
}

.grid-cell-empty {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  gap: 16px;
}

.grid-cell-empty i {
  font-size: 48px;
  color: #94a3b8;
  opacity: 0.8;
}

.grid-cell-empty span {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

.grid-cell-alert {
  position: absolute;
  top: 40px;
  right: 12px;
  z-index: 3;
  background: var(--danger);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 15px var(--danger);
  animation: alertPulse 1s infinite;
}

.grid-cell.has-alert {
  border: 3px solid var(--danger) !important;
  animation: cellBorderPulse 1s infinite;
}

@keyframes alertPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes cellBorderPulse {
  0% {
    border-color: var(--danger);
    box-shadow: 0 0 5px var(--danger);
  }

  50% {
    border-color: #ff0000;
    box-shadow: 0 0 20px var(--danger);
  }

  100% {
    border-color: var(--danger);
    box-shadow: 0 0 5px var(--danger);
  }
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Analytics / Detail Panel -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.detail-panel {
  padding: 32px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
}

.placeholder-text {
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 20px;
  text-align: center;
}

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

.detail-header h2 {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.detail-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.detail-card label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.detail-card .value {
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
  color: var(--text-primary);
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Setup Tab -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.setup-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.setup-subtab-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 26px;
  background: white;
  border-bottom: 1px solid #e5e9f0;
  flex-shrink: 0;
}

.setup-subtab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  background: transparent;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans','Inter',inherit;
  color: #94a3b8;
  cursor: pointer;
  transition: color .14s;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  letter-spacing: -0.01em;
  /* Multi-page routing: these are <a> elements now, not <button onclick>. */
  text-decoration: none;
}

.setup-subtab:hover {
  color: #334155;
  background: transparent;
}

.setup-subtab.active {
  color: #2563eb;
  font-weight: 700;
  border-bottom-color: #2563eb;
  background: transparent;
}

.setup-subtab i {
  font-size: 12px;
  opacity: .75;
}
.setup-subtab.active i { opacity: 1; }

.setup-section {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  padding: 0; /* Removing padding to allow tables to scroll correctly */
  gap: 0;
  min-height: 0;
}

.setup-section.active {
  display: flex;
}

.setup-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.setup-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin-left: -16px;
}

.setup-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 16px;
}

.alert-stats-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: #f8fafc;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.stat-pill:hover {
  border-color: var(--accent);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-pill i {
  opacity: 0.8;
}

.stat-pill b {
  color: var(--text-primary);
  font-weight: 600;
  margin-left: 2px;
}

.setup-table-wrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
}

.setup-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.setup-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.setup-table th {
  text-align: left;
  padding: 14px 16px;
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.setup-table th i {
  margin-right: 8px;
  color: var(--accent);
  opacity: 0.8;
  font-size: 12px;
}

.setup-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
  transition: background 0.2s ease;
}

.setup-table tr:hover td {
  background: rgba(22, 83, 171, 0.02);
  color: var(--text-primary);
}

.setup-table tr:last-child td {
  border-bottom: none;
}

.table-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
}

.table-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill.active {
  background: #d1fae5;
  color: #065f46;
}

.status-pill.offline {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.online {
  background: #d1fae5;
  color: #065f46;
}

.status-pill.unknown {
  background: #fef9c3;
  color: #854d0e;
}

.td-mono {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- AI Config Tab -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.config-container {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.config-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.config-nav-item {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.config-nav-item.active {
  background: var(--accent);
  color: white;
}

.config-nav-item i {
  width: 16px;
  text-align: center;
}

.config-content {
  flex: 1;
  background: white;
  overflow-y: auto;
}

.config-section {
  display: none;
}

.config-section.active {
  display: block;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Detail Table -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.message-cell {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.detail-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.detail-table tr:last-child td {
  border-bottom: none;
}

.detail-table tr:hover td {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Modal -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 520px;
  max-height: 90vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.modal-header h3 {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: #fee2e2;
  color: var(--danger);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 70vh;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- AI Models Extension -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.setup-tabs-inner {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  gap: 4px;
}

.setup-tabs-inner .setup-subtab {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  border-bottom: none;
  margin-bottom: 0;
}

.setup-tabs-inner .setup-subtab.active {
  background: white;
  box-shadow: var(--shadow);
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-outline {
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #e0f2fe;
  color: #0c4a6e;
}

.badge-gray {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge-blue {
  background: var(--accent-light);
  color: var(--accent-hover);
}

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

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- AI Models Flex Fix -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.aim-tab-section {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.aim-tab-section.active {
  display: flex;
}

.badge-accent {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.severity-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.severity-tag.critical {
  background: #450a0a;
  color: #fecaca;
}

.severity-tag.high {
  background: #fee2e2;
  color: #991b1b;
}

.severity-tag.medium {
  background: #fef3c7;
  color: #92400e;
}

.severity-tag.low {
  background: #dcfce7;
  color: #166534;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Advanced Archive Viewer -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.archive-viewer {
  background: white;
  border-radius: var(--radius-xl);
  width: 95vw;
  height: 90vh;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: modalAppear 0.3s ease-out;
}

.av-header {
  background: #fff;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.av-title-group h2 {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.av-title-group p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.av-header-actions {
  display: flex;
  gap: 8px;
}

.av-header-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}

.av-header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.av-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Columns */
.av-col-left {
  width: 320px; /* Slightly wider for better alert readability */
  border-right: 1px solid var(--border);
  padding: 0; /* Removing padding to allow internal sections to manage it */
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}

.av-col-mid {
  width: 140px;
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.av-col-main {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fafafa;
}

.av-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.av-section-header i {
  color: var(--accent);
}

/* Calendar */
.av-calendar-nav {
  display: flex;
  align-items: center;
  gap: 4px; /* Tighter gap */
}

.av-calendar-nav span {
  font-size: 14px;
  font-weight: 700;
  min-width: 100px;
  text-align: center;
  color: var(--text-primary);
}

.av-calendar-nav button {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.av-calendar-nav button:hover {
  background: var(--bg-tertiary);
  color: var(--accent);
}

.av-calendar-nav button i {
  font-size: 12px;
}

.av-icon-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.av-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--accent);
}

.av-icon-btn i {
  font-size: 14px;
}

.av-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 20px;
  padding: 0 4px;
  /* Added padding */
}

.av-day-name {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
  font-weight: 500;
}

.av-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  background: #f8fafc;
  border: 1px solid transparent;
}

.av-day:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.av-day.other-month {
  opacity: 0.1;
  cursor: default;
  pointer-events: none;
}

.av-day.selected {
  background: var(--accent);
  color: white;
  font-weight: 600;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(22, 83, 171, 0.3);
  border-color: var(--accent);
}

/* Day Status Dots */
.av-day .dot-pos {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.av-day.has-video::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--success);
}

.av-day.has-alert::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 4px var(--danger);
}

.av-legend {
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border);
  background: #fcfcfc;
}

.av-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.av-legend-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.av-legend-item .dot.available {
  background: var(--success);
}

.av-legend-item .dot.no-data {
  background: #e2e8f0;
}

.av-legend-item .dot.alert {
  background: var(--danger);
}

.av-selected-info {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.av-selected-info label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.av-selected-info p {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

/* Archive Slots */
.av-slot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 2px;
}

.av-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  transition: var(--transition);
  flex-shrink: 0;
}

.av-slot-row.active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 2px 8px rgba(22, 83, 171, 0.1);
}

.av-slot-time {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.av-slot-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.av-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: var(--transition);
}

.av-action-btn.raw {
  color: #3b82f6;
}

.av-action-btn.proc {
  color: #10b981;
}

.av-action-btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.av-action-btn.active {
  color: white;
  border-color: transparent;
}

.av-action-btn.raw.active {
  background: #3b82f6;
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
}

.av-action-btn.proc.active {
  background: #10b981;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
}

.av-type-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
}

.av-type-badge.processed {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.av-type-badge.raw {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #3b82f6;
}

.av-empty-msg {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 20px;
  font-style: italic;
}

/* Player Main Area */
.av-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.av-player-header h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.av-player-wrapper {
  flex: 1;
  background: #000;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.av-video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.av-player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.av-player-placeholder .placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* Timezone Selector */
.tz-selector-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tz-selector-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

#global-timezone {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  width: 160px;
  outline: none;
  transition: var(--transition);
}

#global-timezone:focus {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Controls */
.av-controls {
  background: #fff;
  padding-top: 20px;
  flex-shrink: 0;
}

.av-progress-group {
  margin-bottom: 16px;
}

.av-time-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.av-progress-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.av-seekbar {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.av-seekbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
}

.av-control-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.av-footer-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.av-play-btn {
  background: var(--accent-light);
  color: var(--accent);
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.av-play-btn:hover {
  background: var(--accent);
  color: white;
}

.av-speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.av-speed-control select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  font-weight: 500;
}

.av-footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.av-mute-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
}

.av-push-btn {
  background: #16a34a;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.av-push-btn:hover {
  background: #15803d;
}

.av-push-btn.active {
  background: #dc2626;
}

.av-push-btn.active:hover {
  background: #b91c1c;
}

.current-frame-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.current-frame-box label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.current-frame-box span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: monospace;
}

.av-day-alerts {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.av-alert-item {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.av-alert-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--accent);
}

.av-alert-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.av-alert-msg {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.av-alert-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  padding: 0;
  border-radius: 0;
  width: auto;
}

.alert-image-frame {
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.5) !important;
  animation: modalAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-details-row span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-details-row i {
  color: var(--accent);
  opacity: 0.8;
}

.btn-av-alert-img {
  background: white !important;
  border-radius: 50% !important;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.btn-av-alert-img:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light) !important;
  transform: scale(1.1);
}

#alert-image-el {
  transition: transform 0.3s ease;
}

.alert-image-container:hover #alert-image-el {
  transform: scale(1.02);
}

#alert-image-el {
  transition: transform 0.3s ease;
}

.alert-image-container:hover #alert-image-el {
  transform: scale(1.02);
}
/* --- Pagination Premium Styles ------------------ */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  border-top: 1px solid #f1f5f9;
  background: white;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.pagination-range {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  margin-left: 16px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pag-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px;
}

.pag-btn:hover:not(:disabled) {
  color: #1e293b;
  background: #f1f5f9;
}

.pag-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.pag-status {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  margin: 0 12px;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Column Filtering & Nice Table Styles -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
.table-container {
  padding: 0;
  margin: 0;
  flex: 1;
  overflow: auto;
}

.nice-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.nice-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nice-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f8fafc;
  font-size: 13px;
  font-weight: 400;
  color: #1e293b;
  vertical-align: middle;
}

.time-label {
  font-weight: 400;
  color: #475569;
  white-space: nowrap;
}

.camera-label {
  font-weight: 400;
  color: #1e293b;
  white-space: nowrap;
}

.event-label {
  font-weight: 400;
  color: #334155;
  font-size: 13px;
}

.message-label {
  font-weight: 400;
  color: #64748b;
  font-size: 13px;
  max-width: 250px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-row {
  background: var(--bg-secondary);
}

.filter-row th {
  padding: 6px 12px 8px 12px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  vertical-align: middle !important;
}

.filter-input {
  width: 100%;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  color: #475569;
  transition: all 0.2s ease;
  outline: none;
  font-weight: 400;
}

.filter-input::placeholder {
  color: #94a3b8;
  opacity: 0.6;
}

.filter-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
  background: white;
}

/* --- Category Tag Styles ----------------------- */
.category-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
}

.category-tag.safety,
.category-tag.safety-violation {
  background: #dcfce7;
  color: #166534;
}

/* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Video Wall & Sidebar Mobile Responsiveness -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
@media (max-width: 768px) {
  body,
  html {
    overflow: visible !important;
    height: auto !important;
  }

  .main-layout {
    position: relative;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  /* Make the content and video wall containers natively scrollable on mobile */
  .main-content, 
  .tab-content,
  .tab-content.active, 
  #tab-grid.active, 
  #tab-grid .camera-grid {
    overflow: visible !important;
    height: auto !important;
  }

  /* Top Nav tweaks */
  .top-nav {
    flex-wrap: wrap;
    padding: 10px 16px;
    min-height: auto;
    gap: 12px;
  }

  #grid-controls {
    width: 100%;
    justify-content: space-between;
    margin-left: 0 !important;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .breadcrumb-area {
    min-width: 0;
    flex: 1;
  }

  .breadcrumb-label {
    font-size: 14px;
  }

  /* Sidebar Off-canvas */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 2000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 85%;
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }

  .sidebar:not(.collapsed) {
    transform: translateX(0);
    width: var(--sidebar-w) !important;
  }

  /* Reveal Floating Toggle for mobile */
  #floating-sidebar-toggle.hidden {
    display: flex !important;
  }
  #floating-sidebar-toggle {
    display: flex !important;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--accent);
    border-radius: 50%;
    width: 54px;
    height: 54px;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    cursor: pointer;
  }
  #floating-sidebar-toggle svg path {
    fill: white !important;
  }

  /* Camera Grid (Video Wall) */
  .camera-grid.grid-1,
  .camera-grid.grid-2,
  .camera-grid.grid-3,
  .camera-grid.grid-4 {
    grid-template-columns: 1fr !important;
    padding: 12px;
    gap: 16px;
  }

  .grid-cell {
    min-height: 250px;
  }

  /* -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- Alerts & Archive Tabs -ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡-ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡- */
  #tab-alerts,
  #tab-archive {
    padding: 12px !important;
  }

  .setup-section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 16px !important;
    gap: 16px !important;
  }

  /* Target the button container inside the setup section header */
  .setup-section-header > div:nth-child(2) {
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 10px !important;
    justify-content: flex-start !important;
  }

  .setup-section-header .btn {
    flex: 1 1 calc(50% - 10px); /* Side by side buttons mapping nicely */
    justify-content: center;
    padding: 12px 10px !important;
    font-size: 13px !important;
  }

  .setup-section-header .switch-container {
    width: 100%;
    margin-top: 4px;
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
  }

  /* Mobile Card Layout for Tables */
  .table-container {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 4px;
  }

  .nice-table,
  .nice-table tbody,
  .nice-table tr,
  .nice-table td {
    display: block;
    width: 100%;
  }

  .nice-table thead,
  .nice-table .filter-row {
    display: none !important;
  }

  .nice-table tr {
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    padding: 12px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  /* Make the entire row look nice, clear the borders */
  .nice-table tr:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .nice-table td {
    border: none !important;
    padding: 6px 0 6px 30% !important;
    position: relative;
    min-height: 32px;
    text-align: left !important;
    display: flex;
    align-items: flex-start;
    border-radius: 0 !important;
  }

  .nice-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    width: 28%;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    top: 8px; /* align with the first line of text visually */
  }

  /* Reposition check box to top right */
  .nice-table td:nth-child(1) {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0 !important;
    min-height: auto;
    width: auto !important;
    display: block;
  }
  .nice-table td:nth-child(1)::before {
    content: "";
    display: none;
  }

  /* Specific data labels for alerts-table */
  #alerts-table td:nth-child(2)::before {
    content: "Time";
  }
  #alerts-table td:nth-child(3)::before {
    content: "Camera";
  }
  #alerts-table td:nth-child(4)::before {
    content: "Category";
  }
  #alerts-table td:nth-child(5)::before {
    content: "Event";
  }
  #alerts-table td:nth-child(6)::before {
    content: "Severity";
  }
  #alerts-table td:nth-child(7)::before {
    content: "Message";
  }

  #alerts-table td:nth-child(8) {
    padding: 12px 0 0 0 !important;
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
    border-top: 1px dashed #e2e8f0 !important;
  }
  #alerts-table td:nth-child(8)::before {
    display: none;
  }
  #alerts-table td:nth-child(8) > div {
    justify-content: flex-start !important;
    width: 100%;
  }

  /* Specific data labels for archives-table */
  #archives-table td:nth-child(2)::before {
    content: "Time";
  }
  #archives-table td:nth-child(3)::before {
    content: "Camera";
  }
  #archives-table td:nth-child(4)::before {
    content: "Category";
  }
  #archives-table td:nth-child(5)::before {
    content: "Severity";
  }
  #archives-table td:nth-child(6)::before {
    content: "Status";
  }

  #archives-table td:nth-child(7) {
    padding: 12px 0 0 0 !important;
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
    border-top: 1px dashed #e2e8f0 !important;
  }
  #archives-table td:nth-child(7)::before {
    display: none;
  }
  #archives-table td:nth-child(7) > div {
    justify-content: flex-start !important;
    width: 100%;
  }

  /* Pagination container tweaks */
  .pagination-container {
    flex-direction: column;
    gap: 16px;
    align-items: center;
    justify-content: center !important;
    padding: 16px 0 !important;
  }

  .pagination-controls {
    flex-wrap: wrap;
    width: 100%;
  }
}
