/* ============================================
   Frontline Integrated Security — Design System
   ============================================ */

   :root {
    /* Warm charcoal — intentionally NOT cool blue-slate (#0F172A style) */
    --bg-primary: #131210;
    --bg-elevated: #1a1816;
    --bg-sidebar: #0f0e0c;
    --bg-topbar: rgba(15, 14, 12, 0.94);
    --bg-card: #1f1d1b;
    --bg-card-hover: #272522;
    --bg-input: #181614;
  
    /* Emerald + bronze — distinct from reference blue/cyan SaaS palette */
    --accent-primary: #059669;
    --accent-primary-dim: rgba(5, 150, 105, 0.14);
    --accent-secondary: #c9a227;
    --accent-secondary-dim: rgba(201, 162, 39, 0.12);
    --accent-gradient: linear-gradient(135deg, #059669 0%, #0d9488 50%, #b8860b 100%);
  
    --success: #22c55e;
    --warning: #e8a838;
    --danger: #e05252;
  
    --text-primary: #f5f2eb;
    --text-secondary: #9c9588;
    --text-muted: #5c564e;
  
    --border: rgba(201, 162, 39, 0.12);
    --border-subtle: rgba(245, 242, 235, 0.06);
    --border-accent: rgba(5, 150, 105, 0.45);
  
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 72px;
    --topbar-height: 64px;
    --notif-width: 380px;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 10px 36px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 48px rgba(5, 150, 105, 0.1);
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
  }
  
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
  }
  
  body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
  }
  
  a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition);
  }
  
  a:hover {
    color: #34d399;
  }
  
  button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
  }
  
  input, select, textarea {
    font-family: inherit;
  }
  
  /* ============================================
     LOGIN PAGE
     ============================================ */
  
  /* Login — centered, atmospheric */
  .login-page {
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
  }
  
  .login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
  }
  
  .login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
  }
  
  .login-orb.orb-1 {
    width: 500px;
    height: 500px;
    background: rgba(5, 150, 105, 0.22);
    top: -15%;
    right: -10%;
    animation: floatOrb 12s ease-in-out infinite;
  }
  
  .login-orb.orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(201, 162, 39, 0.12);
    bottom: -10%;
    left: -5%;
    animation: floatOrb 14s ease-in-out infinite reverse;
  }
  
  .login-grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(201, 162, 39, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(201, 162, 39, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
  }
  
  @keyframes floatOrb {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -30px); }
  }
  
  .login-layout-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
    z-index: 1;
  }
  
  .login-form-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
  }
  
  .login-brand-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
  }
  
  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.35);
  }
  
  .brand-name {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
  }
  
  .brand-tag {
    display: block;
    font-size: 0.7rem;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
  }
  
  .login-tagline {
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
  }
  
  .secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-elevated);
    border-radius: 20px;
    border: 1px solid var(--border);
  }
  
  .secure-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
  }
  
  .login-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-md), var(--shadow-glow);
  }
  
  .login-card .brand-logo{
    text-align: center;
  }
 .login-card .brand-logo img {
    width: 40%;
    max-width: 100% !important;
    max-height: 100% !important;
}
  
  .login-card-header {
    margin-bottom: 32px;
  }
  
  .login-card-header h2 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
  }
  
  .login-card-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
  }
  
  .form-group {
    margin-bottom: 20px;
  }
  
  .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
  }
  
  .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
  }
  
  .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    pointer-events: none;
  }
  
  .input-wrapper input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
  }
  
  .input-wrapper input::placeholder {
    color: var(--text-muted);
  }
  
  .input-wrapper input:focus {
    border-color: var(--accent-primary);
    background: var(--accent-primary-dim);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.22);
  }
  
  .toggle-password {
    position: absolute;
    right: 12px;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    transition: color var(--transition);
  }
  
  .toggle-password:hover {
    color: var(--text-primary);
  }
  
  .form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
  }
  
  .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
  }
  
  .checkbox-label input {
    display: none;
  }
  
  .checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
  }
  
  .checkbox-label input:checked + .checkbox-custom {
    background: var(--accent-gradient);
    border-color: transparent;
  }
  
  .checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
  }
  
  .link {
    font-size: 0.875rem;
    color: var(--accent-secondary);
  }
  
  .link:hover {
    color: var(--accent-secondary);
  }
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition);
  }
  
  .btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.3);
    border: none;
  }
  
  .btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 28px rgba(5, 150, 105, 0.4);
    transform: translateY(-1px);
  }
  
  .btn-primary:active {
    transform: translateY(0);
  }
  
  .btn-full {
    width: 100%;
  }
  
  .btn-ghost {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
  }
  
  .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
  }
  
  .btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  
  /* ============================================
     DASHBOARD LAYOUT
     ============================================ */
  
  .dashboard-page {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-primary);
    background-image:
      radial-gradient(ellipse 90% 70% at 80% -10%, rgba(5, 150, 105, 0.06), transparent 55%),
      radial-gradient(ellipse 60% 50% at 0% 100%, rgba(201, 162, 39, 0.05), transparent 50%);
  }
  
  .dashboard-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
  }
  
  /* Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform var(--transition);
    overflow: hidden;
  }
  
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
  }
  
  .sidebar-header .brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
  }
  
  .brand-logo img {
    width: 70%;
  }

body.dashboard-page.sidebar-collapsed .brand-logo img {
    width: 100%;
    max-width: 60px;
    max-height: 60px;
}
  
  .brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
  }
  
  .brand-title {
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
  }
  
  .brand-subtitle {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
  }
  
  .brand-logo-login img {
    max-height: 52px;
    max-width: 160px;
  }
  
  body.sidebar-collapsed .brand-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
  }
  
  body.sidebar-collapsed .brand-logo img {
    max-width: 36px;
    max-height: 36px;
  }
  
  .sidebar-close {
    display: none;
    padding: 6px;
    color: var(--text-secondary);
    border-radius: 8px;
  }
  
  .sidebar-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
  }
  
  .sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all var(--transition);
  }
  
  .sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
  }
  
  .sidebar-collapse-btn .collapse-icon {
    transition: transform 0.25s ease;
  }
  
  /* Collapsed sidebar (icon-only) */
  body.sidebar-collapsed {
    --sidebar-width: var(--sidebar-width-collapsed);
  }
  
  body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 12px;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  body.sidebar-collapsed .sidebar-header .brand-logo {
    justify-content: center;
    width: 100%;
  }
  
  body.sidebar-collapsed .sidebar-header .nav-label,
  body.sidebar-collapsed .nav-item .nav-label,
  body.sidebar-collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    pointer-events: none;
  }
  
  body.sidebar-collapsed .sidebar-collapse-btn {
    width: 100%;
    order: 3;
  }
  
  body.sidebar-collapsed .sidebar-collapse-btn .collapse-icon {
    transform: rotate(180deg);
  }
  
  body.sidebar-collapsed .sidebar-nav {
    padding: 16px 10px;
  }
  
  body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px;
    gap: 0;
  }
  
  body.sidebar-collapsed .nav-item.active {
    border-radius: var(--radius-md);
  }
  
  body.sidebar-collapsed .nav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 8px;
    width: 8px;
    height: 8px;
    padding: 0;
    margin: 0;
    font-size: 0;
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
  }
  
  body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 10px 8px;
  }
  
  body.sidebar-collapsed .sidebar-footer {
    padding: 12px 10px;
  }
  
  /* Tooltips when collapsed */
  body.sidebar-collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    background: var(--bg-topbar);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 300;
    box-shadow: var(--shadow-md);
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }
  
  body.sidebar-collapsed .nav-item:hover::after {
    opacity: 1;
    visibility: visible;
  }
  
  .sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    /*overflow-y: auto;*/
  }
  
  .nav-label {
    flex: 1;
    min-width: 0;
    transition: opacity 0.2s ease, width 0.25s ease;
    white-space: nowrap;
  }
  
  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 2px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    border: 1px solid transparent;
    position: relative;
  }
  
  .nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
  }
  
  .nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
  }
  
  .nav-item:hover svg {
    opacity: 1;
  }
  
  .nav-item.active {
    color: var(--text-primary);
    background: var(--accent-primary-dim);
    border-color: var(--border-accent);
  }
  
  .nav-item.active svg {
    opacity: 1;
    color: var(--accent-secondary);
  }
  
  .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
  }
  
  .sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
  }
  
  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
  }
  
  .sidebar-user strong {
    display: block;
    font-size: 0.85rem;
  }
  
  .sidebar-user span {
    font-size: 0.75rem;
    color: var(--text-secondary);
  }
  
  /* Avatar */
  .avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
  }
  
  .avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }
  
  /* Main wrapper */
  .main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
  }
  
  /* Top bar */
  .topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    z-index: 100;
  }
  
  .live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--success);
  }
  
  .live-pulse {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
  }
  
  @keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  }
  
  .page-eyebrow {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-secondary);
    margin-bottom: 2px;
  }
  
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
  }
  
  .menu-toggle {
    display: none;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-secondary);
  }
  
  .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
  }
  
  .page-title h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .topbar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
  }
  
  .topbar-search svg {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    pointer-events: none;
  }
  
  .topbar-search input {
    width: 100%;
    padding: 10px 80px 10px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition);
  }
  
  .topbar-search input:focus {
    border-color: var(--border-accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--accent-primary-dim);
  }
  
  .topbar-search input::placeholder {
    color: var(--text-muted);
  }
  
  .topbar-search kbd {
    position: absolute;
    right: 12px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 6px;
    font-family: inherit;
  }
  
  .topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  
  .icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
  }
  
  .icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
  }
  
  .notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-topbar);
  }
  
  /* Profile dropdown */
  .profile-dropdown {
    position: relative;
  }
  
  .profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
  }
  
  .profile-btn:hover {
    background: rgba(255, 255, 255, 0.06);
  }
  
  .profile-name {
    font-size: 0.875rem;
    font-weight: 500;
  }
  
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 300;
  }
  
  .dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all var(--transition);
  }
  
  .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
  }
  
  .dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
  }
  
  .dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
  }
  
  /* Dashboard content */
  .dashboard-content {
    padding: 28px;
    flex: 1;
  }
  
  /* Metric cards */
  .metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
  }
  
  .metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
    position: relative;
    overflow: hidden;
  }
  
  .metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition);
  }
  
  .metric-card:nth-child(1)::before { opacity: 1; background: linear-gradient(90deg, #059669, #0d9488); }
  .metric-card:nth-child(2)::before { opacity: 1; background: linear-gradient(90deg, #c9a227, #e8a838); }
  .metric-card:nth-child(3)::before { opacity: 1; background: linear-gradient(90deg, #e8a838, #e05252); }
  .metric-card:nth-child(4)::before { opacity: 1; background: linear-gradient(90deg, #22c55e, #059669); }
  
  .metric-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
  }
  
  .metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .metric-icon-blue { background: var(--accent-primary-dim); color: var(--accent-primary); }
  .metric-icon-cyan { background: var(--accent-secondary-dim); color: var(--accent-secondary); }
  .metric-icon-warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
  .metric-icon-success { background: rgba(52, 211, 153, 0.12); color: var(--success); }
  
  .metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
  }
  
  .metric-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    display: block;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
  }
  
  .metric-sub {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
  }
  
  .metric-change {
    font-size: 0.75rem;
    margin-top: 6px;
    display: block;
  }
  
  .metric-change.positive { color: var(--success); }
  .metric-change.negative { color: var(--danger); }
  
  /* ============================================
     DASHBOARD VIEW TABS (Live Map / Guards / Sites)
     ============================================ */
  
  .dashboard-view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }
  
  .view-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    transition: all var(--transition);
    cursor: pointer;
  }
  
  .view-tab svg {
    opacity: 0.6;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
  }
  
  .view-tab:hover {
    color: var(--text-primary);
  }
  
  .view-tab:hover svg {
    opacity: 1;
  }
  
  .view-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-accent);
  }
  
  .view-tab.active svg {
    opacity: 1;
    color: var(--accent-secondary);
  }
  
  /* Tab panels */
  .tab-panels {
    margin-bottom: 28px;
  }
  
  .tab-panel {
    display: none;
    animation: tabFadeIn 0.25s ease;
  }
  
  .tab-panel.active {
    display: block;
  }
  
  @keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* SOC layout (map + sidebar) */
  .soc-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
  }
  
  .card-map {
    min-height: 480px;
    overflow: hidden;
  }
  
  .map-container {
    position: relative;
    height: 480px;
    background: linear-gradient(165deg, #1a1816 0%, #131210 100%);
    overflow: hidden;
  }

  .map-container {
    position: relative;
}

.map-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.25);
    pointer-events: none;
}
  
 /* .map-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at center, rgba(5, 150, 105, 0.1) 1px, transparent 1px);
    background-size: 24px 24px;
  }*/
  
  .map-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse 70% 50% at 25% 35%, rgba(5, 150, 105, 0.14), transparent),
      radial-gradient(ellipse 50% 40% at 75% 65%, rgba(201, 162, 39, 0.08), transparent);
  }
  
  .map-marker {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    transform: translate(-50%, -50%);
    z-index: 2;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
  
  .map-marker:hover {
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 3;
  }
  
  .map-marker.marker-danger {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25), 0 4px 12px rgba(239, 68, 68, 0.4);
    animation: markerPulse 2s ease-in-out infinite;
  }
  
  .map-marker.marker-safe {
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.28);
  }
  
  .map-marker.marker-warning {
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  }
  
  @keyframes markerPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25), 0 4px 12px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15), 0 4px 16px rgba(239, 68, 68, 0.5); }
  }
  
  .map-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    gap: 16px;
    padding: 8px 14px;
    background: rgba(31, 29, 27, 0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    z-index: 2;
  }
  
  .map-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .legend-dot.danger { background: var(--danger); }
  .legend-dot.success { background: var(--success); }
  
  /* SOC sidebar */
  .soc-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .card-header.compact {
    padding: 16px 20px;
  }
  
  .card-header.compact h2 {
    font-size: 0.9rem;
    margin: 0;
  }
  
  .roster-count {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-weight: 500;
  }
  
  /* Alert feed */
  .alert-feed {
    padding: 8px 0;
    max-height: 220px;
    overflow-y: auto;
  }
  
  .alert-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
  }
  
  .alert-item:last-child {
    border-bottom: none;
  }
  
  .alert-item:hover {
    background: rgba(255, 255, 255, 0.02);
  }
  
  .alert-item.critical {
    background: rgba(239, 68, 68, 0.06);
    border-left: 3px solid var(--danger);
  }
  
  .alert-item.warning {
    border-left: 3px solid var(--warning);
  }
  
  .alert-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
  }
  
  .alert-item p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
  }
  
  .alert-item.critical p {
    color: #fca5a5;
  }
  
  .alert-item.critical strong {
    color: #fecaca;
  }
  
  .alert-item strong {
    color: var(--text-primary);
    font-weight: 600;
  }
  
  /* Field roster */
  .field-roster {
    padding: 4px 0;
  }
  
  .roster-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    transition: background var(--transition);
  }
  
  .roster-item:hover {
    background: rgba(255, 255, 255, 0.02);
  }
  
  .roster-info {
    flex: 1;
    min-width: 0;
  }
  
  .roster-info strong {
    display: block;
    font-size: 0.85rem;
  }
  
  .roster-site {
    font-size: 0.75rem;
    color: var(--text-secondary);
  }
  
  .status-dot.alert {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
  }
  
  /* Table user cell */
  .table-user {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  /* Sites grid */
  .sites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .site-card {
    padding: 0;
  }
  
  .site-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
  }
  
  .site-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-primary-dim);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .site-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
  }
  
  .site-card-header .badge {
    margin-left: auto;
    flex-shrink: 0;
  }
  
  .site-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 24px;
    gap: 16px;
  }
  
  .site-stats div {
    text-align: center;
  }
  
  .site-stats strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2px;
  }
  
  .site-stats span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  
  /* Secondary dashboard grid */
  .dashboard-grid-secondary {
    margin-top: 0;
  }
  
  /* Dashboard grid */
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
  }
  
  .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition);
  }
  
  .card:hover {
    border-color: var(--border);
  }
  
  .card-table {
    grid-column: 1 / -1;
  }
  
  .card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
  }
  
  .card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
  }
  
  .card-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
  }
  
  /* Table */
  .table-wrapper {
    overflow-x: auto;
  }
  
  table {
    width: 100%;
    border-collapse: collapse;
  }
  
  thead th {
    text-align: left;
    padding: 12px 24px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
  }
  
  tbody td {
    padding: 14px 24px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
  }
  
  tbody tr {
    transition: background var(--transition);
  }
  
  tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
  }
  
  tbody tr:last-child td {
    border-bottom: none;
  }
  
  .mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-secondary);
  }
  
  .text-muted {
    color: var(--text-secondary);
    font-size: 0.8rem;
  }
  
  /* Badges */
  .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  
  .badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
  .badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
  .badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
  
  /* Patrol list */
  .patrol-list {
    padding: 8px 0;
  }
  
  .patrol-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    transition: background var(--transition);
  }
  
  .patrol-item:hover {
    background: rgba(255, 255, 255, 0.02);
  }
  
  .patrol-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  
  .patrol-status.active {
    background: var(--accent-secondary);
    box-shadow: 0 0 8px rgba(5, 150, 105, 0.45);
    animation: pulse-dot 2s infinite;
  }
  
  .patrol-status.complete { background: var(--success); }
  .patrol-status.pending { background: var(--text-secondary); opacity: 0.5; }
  
  @keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }
  
  .patrol-info {
    flex: 1;
    min-width: 0;
  }
  
  .patrol-info strong {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 2px;
  }
  
  .patrol-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
  }
  
  .patrol-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
  }
  
  /* Guard stats */
  .guard-stats {
    padding: 20px 24px;
  }
  
  .guard-stat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
  }
  
  .guard-stat-row:last-child {
    margin-bottom: 0;
  }
  
  .guard-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 110px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  
  .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
  }
  
  .status-dot.online { background: var(--success); }
  .status-dot.patrol { background: #c9a227; }
  .status-dot.break { background: var(--warning); }
  .status-dot.offline { background: var(--text-secondary); opacity: 0.4; }
  
  .progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
  }
  
  .progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.6s ease;
  }
  
  .progress-fill.cyan { background: linear-gradient(90deg, #c9a227, #e8a838); }
  .progress-fill.warning { background: var(--warning); }
  .progress-fill.muted { background: var(--text-secondary); opacity: 0.3; }
  
  .guard-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    width: 36px;
    text-align: right;
  }
  
  /* Chart */
  .chart-legend {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
  }
  
  .chart-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
  }
  
  .legend-dot.blue { background: var(--accent-primary); }
  .legend-dot.cyan { background: var(--accent-secondary); }
  
  .chart-area {
    padding: 0 24px 24px;
  }
  
  .bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 160px;
    gap: 12px;
    padding-top: 16px;
  }
  
  .bar-group {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 100%;
  }
  
  .bar {
    width: 14px;
    border-radius: 4px 4px 0 0;
    transition: height 0.6s ease, opacity var(--transition);
    min-height: 4px;
  }
  
  .bar:hover {
    opacity: 0.8;
  }
  
  .bar.patrol { background: var(--accent-primary); }
  .bar.incident { background: var(--accent-secondary); opacity: 0.7; }
  
  .chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 4px;
  }
  
  .chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
  }
  
  /* ============================================
     NOTIFICATION PANEL
     ============================================ */
  
  .notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 400;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }
  
  .notif-overlay.open {
    opacity: 1;
    visibility: visible;
  }
  
  .notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--notif-width);
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    z-index: 500;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  
  .notif-panel.open {
    transform: translateX(0);
  }
  
  .notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border);
  }
  
  .notif-panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
  }
  
  .notif-count {
    font-size: 0.8rem;
    color: var(--accent-secondary);
  }
  
  .notif-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
  }
  
  .notif-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
  }
  
  .notif-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
  }
  
  .notif-tab.active {
    background: var(--accent-primary-dim);
    color: var(--accent-primary);
  }
  
  .notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
  }
  
  .notif-item {
    display: flex;
    gap: 14px;
    padding: 16px 24px;
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
  }
  
  .notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(2px);
  }
  
  .notif-item.unread {
    background: var(--accent-primary-dim);
    border-left-color: var(--accent-primary);
  }
  
  .notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .notif-icon-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
  .notif-icon-cyan { background: var(--accent-secondary-dim); color: var(--accent-secondary); }
  .notif-icon-blue { background: var(--accent-primary-dim); color: var(--accent-primary); }
  .notif-icon-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
  .notif-icon-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
  
  .notif-content {
    flex: 1;
    min-width: 0;
  }
  
  .notif-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
  }
  
  .notif-title-row strong {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
  }
  
  .unread-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
  }
  
  .notif-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 6px;
  }
  
  .notif-content time {
    font-size: 0.7rem;
    color: var(--text-muted);
  }
  
  .notif-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
  }
  
  /* Sidebar overlay (mobile) */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }
  
  .sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
  }

 /* ============================================
  Guards-Page-css
   ============================================ */

    /* ============================================
  Notifications-Page-css
   ============================================ */
   
  .notification-tabs{
    display:flex;
    gap:10px;
    padding:20px;
    border-top:1px solid var(--border);
    border-bottom:1px solid var(--border);
}

.notification-feed{
    padding:20px;
}

.notification-card{
    display:flex;
    gap:18px;
    padding:20px;
    border:1px solid var(--border);
    border-radius:16px;
    margin-bottom:16px;
    transition:.3s;
}

.notification-card:hover{
    transform:translateY(-2px);
}

.notification-card.unread{
    border-left:4px solid var(--accent-primary);
    background:rgba(0,255,150,.03);
}

.notification-icon{
    width:54px;
    height:54px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
    flex-shrink:0;
}

.notification-icon.danger{
    background:rgba(239,68,68,.15);
}

.notification-icon.warning{
    background:rgba(245,158,11,.15);
}

.notification-icon.success{
    background:rgba(16,185,129,.15);
}

.notification-content h4{
    margin:0 0 8px;
}

.notification-content p{
    margin:0 0 10px;
    color:var(--text-secondary);
}

.notification-content span{
    font-size:13px;
    color:var(--text-muted);
}
  /* ============================================
    NOTIFICATIONS PAGE CSS
     ============================================ */

       /* ============================================
    SETTINGS PAGE CSS
     ============================================ */
.settings-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:20px;
    padding:24px;
}

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

.form-group input{
    background:var(--bg-elevated);
    border:1px solid var(--border);
    border-radius:10px;
    padding:12px;
    color:#fff;
}

.settings-list{
    padding:24px;
}

.setting-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 0;
    border-bottom:1px solid var(--border);
}
           /* ============================================
    SETTINGS PAGE CSS
     ============================================ */
  /* ============================================
     RESPONSIVE
     ============================================ */
  
  @media (max-width: 1200px) {
    .metrics-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  
    .dashboard-grid {
      grid-template-columns: 1fr;
    }
  
    .soc-layout {
      grid-template-columns: 1fr;
    }
  
    .soc-sidebar {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
  
    .sites-grid {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 1024px) {
    .sidebar {
      transform: translateX(-100%);
      width: var(--sidebar-width) !important;
    }
  
    .sidebar.open {
      transform: translateX(0);
    }
  
    body.sidebar-collapsed .sidebar-header .nav-label,
    body.sidebar-collapsed .nav-item .nav-label,
    body.sidebar-collapsed .sidebar-user-info {
      opacity: 1;
      width: auto;
      pointer-events: auto;
    }
  
    body.sidebar-collapsed .nav-item::after {
      display: none;
    }
  
    .sidebar-collapse-btn {
      display: none;
    }
  
    .sidebar-close {
      display: flex;
    }
  
    .main-wrapper {
      margin-left: 0;
    }
  
    .menu-toggle {
      display: flex;
    }
  
    .topbar-search {
      display: none;
    }
  
    .profile-name {
      display: none;
    }
  }
  
  @media (max-width: 768px) {
    .soc-sidebar {
      grid-template-columns: 1fr;
    }
  
    .dashboard-view-tabs {
      gap: 6px;
    }
  
    .view-tab {
      padding: 8px 14px;
      font-size: 0.8rem;
    }
  }
  
  @media (max-width: 640px) {
    .metrics-grid {
      grid-template-columns: 1fr;
    }
  
    .dashboard-content {
      padding: 16px;
    }
  
    .topbar {
      padding: 0 16px;
    }
  
    .page-title h1 {
      font-size: 0.9rem;
    }
  
    .breadcrumb {
      display: none;
    }
  
    table {
      font-size: 0.8rem;
    }
  
    thead th,
    tbody td {
      padding: 10px 14px;
    }
  
    .login-card {
      padding: 28px 24px;
    }
  }
  
  /* ============================================
     UI KIT / FORM COMPONENTS (reusable)
     ============================================ */
  
  .ui-kit-page {
    max-width: 1100px;
  }
  
  .ui-kit-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
  }
  
  .ui-kit-intro code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 2px 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    color: var(--accent-secondary);
  }
  
  .ui-section {
    margin-bottom: 24px;
    padding: 0;
  }
  
  .ui-section-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
  }
  
  .ui-section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
  }
  
  .ui-section-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
  }
  
  .ui-section-header code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-secondary);
  }
  
  .ui-block {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  
  .ui-subtitle {
    padding: 0 24px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
  }
  
  .btn-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 0 24px 20px;
  }
  
  .btn-row:first-child {
    padding-top: 20px;
  }
  
  /* Base form control (use on any page) */
  .form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
  }
  
  .form-control::placeholder {
    color: var(--text-muted);
  }
  
  .form-control:hover:not(:disabled) {
    border-color: var(--border);
  }
  
  .form-control:focus {
    border-color: var(--accent-primary);
    background: var(--accent-primary-dim);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.22);
  }
  
  .form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .input-wrapper .form-control.has-icon {
    padding-left: 44px;
  }
  
  .input-wrapper input:not(.form-control) {
    width: 100%;
    padding: 13px 14px 13px 44px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
  }
  
  .form-textarea {
    resize: vertical;
    min-height: 100px;
  }
  
  .form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8ba3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
  }
  
  .form-file {
    padding: 10px 14px;
    cursor: pointer;
  }
  
  .form-file::file-selector-button {
    margin-right: 12px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
  }
  
  .form-file::file-selector-button:hover {
    background: var(--bg-card-hover);
  }
  
  .form-range {
    width: 100%;
    height: 6px;
    appearance: none;
    background: var(--bg-elevated);
    border-radius: 10px;
    outline: none;
  }
  
  .form-range::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-gradient);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
  }
  
  .form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
  }
  
  .form-hint-success {
    color: var(--success);
  }
  
  .form-error {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--danger);
  }
  
  .form-group.has-error .form-control {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
  }
  
  .form-group.has-success .form-control {
    border-color: var(--success);
  }
  
  .required {
    color: var(--danger);
  }
  
  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 24px;
  }
  
  .form-group-full {
    grid-column: 1 / -1;
  }
  
  .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 24px 24px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 20px;
  }
  
  /* Button variants */
  .btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
  }
  
  .btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
  }
  
  .btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--border-accent);
  }
  
  .btn-outline:hover {
    background: var(--accent-primary-dim);
  }
  
  .btn-danger {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
  }
  
  .btn-danger:hover {
    background: rgba(248, 113, 113, 0.25);
  }
  
  .btn-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
  }
  
  .btn-success:hover {
    background: rgba(52, 211, 153, 0.25);
  }
  
  .btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
  }
  
  .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
  }
  
  /* Radio buttons */
  .radio-group {
    border: none;
    padding: 0;
    margin: 0;
  }
  
  .radio-group legend {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 0;
  }
  
  .radio-group .radio-label + .radio-label {
    margin-top: 10px;
  }
  
  .radio-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .radio-group-inline .radio-label + .radio-label {
    margin-top: 0;
  }
  
  .radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
  }
  
  .radio-label input {
    display: none;
  }
  
  .radio-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all var(--transition);
  }
  
  .radio-label input:checked + .radio-custom {
    border-color: var(--accent-primary);
    background: var(--accent-primary-dim);
  }
  
  .radio-label input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
  }
  
  .radio-label input:disabled + .radio-custom {
    opacity: 0.4;
  }
  
  .radio-label:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.6;
  }
  
  .checkbox-group {
    padding: 0 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  /* Toggle switch */
  .toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
  }
  
  .toggle-input {
    display: none;
  }
  
  .toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 24px;
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition);
  }
  
  .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition);
  }
  
  .toggle-input:checked + .toggle-switch {
    background: var(--accent-primary-dim);
    border-color: var(--accent-primary);
  }
  
  .toggle-input:checked + .toggle-switch::after {
    left: 22px;
    background: var(--accent-primary);
  }
  
  .toggle-input:disabled + .toggle-switch {
    opacity: 0.4;
    cursor: not-allowed;
  }
  
  .ui-section .radio-group,
  .ui-section .checkbox-group {
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 20px;
  }
  
  .ui-section > .radio-group:first-of-type {
    padding-top: 20px;
  }
  
  @media (max-width: 640px) {
    .form-grid {
      grid-template-columns: 1fr;
    }
  
    .btn-row {
      flex-direction: column;
      align-items: stretch;
    }
  
    .btn-row .btn {
      width: 100%;
    }
  }
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-danger {
  background: rgba(224, 82, 82, 0.12);
  border-color: rgba(224, 82, 82, 0.35);
  color: #fecaca;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.alert-warning {
  background: rgba(232, 168, 56, 0.12);
  border-color: rgba(232, 168, 56, 0.35);
  color: #fde68a;
}

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

.inline-form {
    display: inline-flex;
    margin: 0;
}

.icon-action {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.icon-action:hover {
    color: var(--text-primary);
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

.icon-action-edit:hover {
    color: var(--accent-primary);
}

.icon-action-delete:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.45);
}

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-modal-overlay.open {
    display: flex;
}

.confirm-modal {
    width: min(420px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.confirm-modal-header {
    padding: 20px 22px 8px;
}

.confirm-modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.confirm-modal-body {
    padding: 0 22px 20px;
}

.confirm-modal-body p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.confirm-modal-actions {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.frontline-map-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.frontline-map-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.frontline-map-btn:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}
  