/* Shieldwise Design System CSS Variables */
:root {
    --sw-primary: #01AFEF;
    --sw-primary-dark: #008BC2;
    --sw-primary-light: #E6F8FE;
    --sw-navy: #0F172A;
    --sw-slate: #475569;
    /* Sidebar-specific variables (do not change global surface/card colors) */
    --sw-sidebar-bg-top: #102A49;
    --sw-sidebar-bg-bottom: #08192D;
    --sw-sidebar-active: #254D82;
    --sw-sidebar-active-text: #59C7F7;
    --sw-sidebar-text: #E5EDF7;
    --sw-sidebar-muted: #9BAFC5;
    --sw-sidebar-hover: #17375D;
    --sw-sidebar-divider: rgba(155, 175, 197, 0.22);
    --sw-bg: #F8FAFC;
    --sw-surface: #FFFFFF;
    --sw-border: #E2E8F0;
    --sw-muted: #6B7280;
    --sw-danger: #DC2626;
    --sw-success: #16A34A;
    --sw-warning: #D97706;
}

body {
    font-family: Segoe UI, Arial;
    margin: 0;
    background: var(--sw-bg);
    color: var(--sw-navy)
}

.topbar {
    height: 33px;
    background: linear-gradient(180deg, var(--sw-sidebar-bg-top) 100%, var(--sw-sidebar-bg-bottom) 100%);
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--sw-border);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.site-logo {
    height: 36px;
    max-height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
    margin-right: 12px;
}

.site-title {
    font-weight: 600;
    color: var(--sw-primary);
    white-space: nowrap;
    margin-right: auto;
}

.topbar-links {
    margin-left: auto;
    white-space: nowrap;
}

.alert-danger {
    color: var(--sw-danger);
    margin-top: 20px;
    margin-bottom: 20px;
}

.alert-success {
    color: var(--sw-success);
    margin-top: 20px;
    margin-bottom: 20px;
}

.sidebar {
    box-sizing: border-box
}

.sidebar {
    width: 220px;
    /* Deep navy vertical gradient background */
    background: linear-gradient(180deg, var(--sw-sidebar-bg-top) 0%, var(--sw-sidebar-bg-bottom) 100%);
    height: calc(100vh - 33px);
    position: fixed;
    top: 33px;
    left: 0;
    padding: 16px;
    /* remove pale right border and use a subtle dark separator */
    border-right: 1px solid rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 6px rgba(3,10,20,0.35);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sw-sidebar-divider);
    margin-bottom: 12px;
}

    .sidebar-brand img {
        margin-left: 48px;
        height: 50px;
        width: auto
    }

    .sidebar-brand .brand-text {
        color: var(--sw-sidebar-active-text);
        font-weight: 600
    }

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
/* Navigation items use a small icon (mask) plus label so icons inherit currentColor */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--sw-sidebar-text);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.12s;
}

    .nav-item:hover {
        background: var(--sw-sidebar-hover);
        color: #FFFFFF;
    }

/* Icon element that uses the SVG as a mask so it inherits text color */
.nav-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    background-color: currentColor;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    display: inline-block;
}

/* Per-icon mask images (small SVGs placed under /images/nav/) */
.nav-icon-dashboard {
    -webkit-mask-image: url('/images/nav/nav_dashboard.svg');
    mask-image: url('/images/nav/nav_dashboard.svg');
}

.nav-icon-cameras {
    -webkit-mask-image: url('/images/nav/nav_cameras.svg');
    mask-image: url('/images/nav/nav_cameras.svg');
}

.nav-icon-alerts {
    -webkit-mask-image: url('/images/nav/nav_alerts.svg');
    mask-image: url('/images/nav/nav_alerts.svg');
}

.nav-icon-notifications {
    -webkit-mask-image: url('/images/nav/nav_notifications.svg');
    mask-image: url('/images/nav/nav_notifications.svg');
}

.nav-icon-notification-preferences {
    -webkit-mask-image: url('/images/nav/nav_notification_preferences.svg');
    mask-image: url('/images/nav/nav_notification_preferences.svg');
}

.nav-icon-change-password {
    -webkit-mask-image: url('/images/nav/nav_change_password.svg');
    mask-image: url('/images/nav/nav_change_password.svg');
}

.nav-icon-users {
    -webkit-mask-image: url('/images/nav/nav_users.svg');
    mask-image: url('/images/nav/nav_users.svg');
}

.nav-icon-support {
    -webkit-mask-image: url('/images/nav/nav_support.svg');
    mask-image: url('/images/nav/nav_support.svg');
}

.nav-icon-about {
    -webkit-mask-image: url('/images/nav/nav_about.svg');
    mask-image: url('/images/nav/nav_about.svg');
}

.nav-icon-reports {
    -webkit-mask-image: url('/images/nav/nav_reports.svg');
    mask-image: url('/images/nav/nav_reports.svg');
}

.nav-icon-billing {
    -webkit-mask-image: url('/images/nav/nav_billing.svg');
    mask-image: url('/images/nav/nav_billing.svg');
}

.nav-icon-analytics {
    -webkit-mask-image: url('/images/nav/nav_analytics.svg');
    mask-image: url('/images/nav/nav_analytics.svg');
}

.nav-icon-super-admin {
    -webkit-mask-image: url('/images/nav/nav_super_admin.svg');
    mask-image: url('/images/nav/nav_super_admin.svg');
}

.nav-icon-devtools {
    -webkit-mask-image: url('/images/nav/nav_devtools.svg');
    mask-image: url('/images/nav/nav_devtools.svg');
}


/* Active state styling for sidebar links */
.nav-item.active {
    background: var(--sw-sidebar-active);
    color: var(--sw-sidebar-active-text);
    font-weight: 600;
    border: 1px solid rgba(89, 199, 247, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-footer {
    margin-top: auto;
    font-size: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--sw-sidebar-divider);
}

    .sidebar-footer .muted {
        color: var(--sw-sidebar-muted)
    }

.env-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px
}

/* Bottom container that holds footer and account info */
.sidebar-bottom {
    flex: 0 0 auto;
    margin-top: auto;
}

.sidebar-account {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px -16px -16px;
    padding: 16px;
    border-top: 1px solid var(--sw-sidebar-divider);
    background: rgba(255, 255, 255, 0.025);
}

.sidebar-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #D9E3EE;
    color: #35516F;
    font-weight: 700;
}

.sidebar-account-details {
    min-width: 0;
    flex: 1
}

.sidebar-account-email {
    overflow: hidden;
    color: var(--sw-sidebar-text);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-role {
    margin-top: 2px;
    color: var(--sw-sidebar-muted);
    font-size: 12px
}

.main {
    margin-left: 240px;
    padding: 32px;
    background: var(--sw-bg);
    min-height: calc(100vh - 33px);
}

.card {
    background: var(--sw-surface);
    padding: 16px;
    border: 1px solid var(--sw-border);
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

    .card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .card h3 {
        margin-top: 0;
        color: var(--sw-navy);
        font-weight: 600
    }

    .card h4 {
        color: var(--sw-slate);
        font-weight: 500;
        margin: 12px 0 8px 0
    }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
    gap: 16px
}

/* Card header/title area */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--sw-border);
    padding-bottom: 12px
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sw-navy);
    margin: 0
}

.card-subtitle {
    font-size: 13px;
    color: var(--sw-muted);
    margin: 4px 0 0 0
}

/* Stat card styling */
.sw-stat-card {
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.sw-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--sw-primary);
    margin: 8px 0
}

.sw-stat-label {
    font-size: 13px;
    color: var(--sw-muted);
}

/* Badge styles */
.sw-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.sw-badge-online {
    background: #D1FAE5;
    color: #065F46
}

.sw-badge-offline {
    background: #F3F4F6;
    color: #4B5563
}

.sw-badge-preview {
    background: var(--sw-primary-light);
    color: var(--sw-primary-dark)
}

.sw-badge-development {
    background: #FEF08A;
    color: #78350F
}

.sw-badge-coming {
    background: #F3F4F6;
    color: var(--sw-muted)
}

/* Page header */
.sw-page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--sw-border);
}

    .sw-page-header h2 {
        color: var(--sw-navy);
        margin: 0 0 4px 0;
        font-size: 28px;
    }

    .sw-page-header p {
        color: var(--sw-muted);
        margin: 0;
        font-size: 14px;
    }

.muted {
    color: var(--sw-muted);
    font-size: 13px
}

.btn-primary {
    background: var(--sw-primary);
    color: var(--sw-surface);
    border-radius: 8px;
    padding: 10px 16px;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

    .btn-primary:not([disabled]):hover {
        background: var(--sw-primary-dark);
        box-shadow: 0 4px 12px rgba(1, 175, 239, 0.3);
    }

    button[disabled], .btn-primary[disabled] {
        opacity: 0.5;
        cursor: not-allowed;
        background: var(--sw-muted) !important;
    }

/* Page header */
h2 {
    color: var(--sw-navy);
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 26px
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--sw-slate);
    background: var(--sw-surface);
    border: 1px solid var(--sw-border);
    border-radius: 8px;
    border-style: dashed;
}

    .empty-state h3 {
        color: var(--sw-navy);
        font-size: 18px;
        margin-bottom: 8px;
    }

    .empty-state p {
        color: var(--sw-muted);
        font-size: 14px;
    }
