/* ── SecureNet Portal — Modern Redesign ────────────────────────────────── */
/* Design System: Clean, minimalist, corporate with SecureNet brand colors */

:root {
    /* Brand Colors */
    --brand-blue: #1E88E5;
    --brand-blue-dark: #1565C0;
    --brand-blue-light: #42A5F5;
    --brand-purple: #5E35B1;
    --brand-purple-dark: #4527A0;
    --brand-purple-light: #7E57C2;

    /* Gradient */
    --brand-gradient: linear-gradient(135deg, #1E88E5 0%, #5E35B1 100%);
    --brand-gradient-soft: linear-gradient(135deg, rgba(30,136,229,0.08) 0%, rgba(94,53,177,0.08) 100%);
    --brand-gradient-hover: linear-gradient(135deg, #1565C0 0%, #4527A0 100%);

    /* Dark Theme Backgrounds */
    --bg-body: #0B0F1A;
    --bg-primary: #0F1422;
    --bg-secondary: #151B2E;
    --bg-card: #1A2138;
    --bg-card-hover: #1E2640;
    --bg-input: #111827;
    --bg-elevated: #1F2A44;
    --bg-surface: #141929;

    /* Borders */
    --border-color: rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.1);
    --border-accent: rgba(30,136,229,0.3);

    /* Text */
    --text-primary: #F0F4F8;
    --text-secondary: #94A3B8;
    --text-muted: #5A6A7E;
    --text-inverse: #FFFFFF;

    /* Semantic Colors */
    --color-success: #10B981;
    --color-success-bg: rgba(16, 185, 129, 0.1);
    --color-success-border: rgba(16, 185, 129, 0.25);
    --color-warning: #F59E0B;
    --color-warning-dark: #D97706;
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    --color-danger: #EF4444;
    --color-danger-bg: rgba(239, 68, 68, 0.08);
    --color-danger-border: rgba(239, 68, 68, 0.25);
    --color-info: #06B6D4;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Sizing */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.1);
    --shadow: 0 4px 12px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.25);
    --shadow-glow-blue: 0 0 20px rgba(30,136,229,0.15);
    --shadow-glow-purple: 0 0 20px rgba(94,53,177,0.15);

    /* Transitions */
    --transition-fast: 120ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Sidebar */
    --sidebar-width: 260px;
    --navbar-height: 64px;
}

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

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 0.9375rem;
}

a {
    color: var(--brand-blue-light);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--brand-blue); }

::selection {
    background: rgba(30,136,229,0.3);
    color: var(--text-primary);
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}
.container-sm {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}
.page-content {
    padding: var(--space-xl) 0 var(--space-2xl);
    flex: 1;
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.navbar {
    background: rgba(15, 20, 34, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--navbar-height);
}

.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    letter-spacing: -0.02em;
}
.navbar-brand:hover { color: var(--text-primary) !important; }
.navbar-brand img {
    height: 34px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(30,136,229,0.2));
}
.navbar-brand svg { width: 32px; height: 32px; }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
}

.navbar-nav li a,
.navbar-nav li button.nav-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.navbar-nav li a:hover,
.navbar-nav li a.active,
.navbar-nav li button.nav-link-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.navbar-nav li a.active {
    color: var(--brand-blue-light);
    background: rgba(30,136,229,0.1);
}

.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.hamburger:hover { background: rgba(255,255,255,0.06); }
.hamburger svg { width: 22px; height: 22px; }

/* ── Admin Sidebar Nav (inside navbar on admin pages) ──────────────────── */
.admin-subnav {
    display: flex;
    gap: var(--space-xs);
    padding: 0.6rem var(--space-lg);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}
.admin-subnav::-webkit-scrollbar { display: none; }

.admin-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    white-space: nowrap;
    transition: all var(--transition);
    border: 1px solid transparent;
}
.admin-subnav a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}
.admin-subnav a.active {
    color: var(--brand-blue-light);
    background: rgba(30,136,229,0.1);
    border-color: rgba(30,136,229,0.2);
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}
.card-header h2,
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Glassmorphism card variant */
.card-glass {
    background: rgba(26, 33, 56, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
}

/* ── Stats Grid ────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    font-size: 1.2rem;
}
.stat-icon-blue { background: rgba(30,136,229,0.12); color: var(--brand-blue-light); }
.stat-icon-purple { background: rgba(94,53,177,0.12); color: var(--brand-purple-light); }
.stat-icon-green { background: rgba(16,185,129,0.12); color: var(--color-success); }
.stat-icon-red { background: rgba(239,68,68,0.12); color: var(--color-danger); }
.stat-icon-yellow { background: rgba(245,158,11,0.12); color: var(--color-warning); }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-xs);
    letter-spacing: -0.03em;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.stat-accent { color: var(--brand-blue-light); }
.stat-warning { color: var(--color-warning); }
.stat-success { color: var(--color-success); }
.stat-danger { color: var(--color-danger); }
.stat-purple { color: var(--brand-purple-light); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(30,136,229,0.25);
}
.btn-primary:hover {
    background: var(--brand-gradient-hover);
    box-shadow: 0 4px 16px rgba(30,136,229,0.35);
    color: white;
    transform: translateY(-1px);
}

.btn-success { background: var(--color-success); color: white; }
.btn-success:hover { background: #059669; color: white; }

.btn-danger {
    background: rgba(239,68,68,0.12);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}
.btn-danger:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.btn-warning { background: var(--color-warning); color: #0f172a; }
.btn-warning:hover { background: var(--color-warning-dark); color: #0f172a; }

.btn-outline {
    background: transparent;
    border-color: var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border-color: var(--brand-blue);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.45rem 0.75rem;
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; border-radius: var(--radius-md); }

.btn-group { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius);
}
.btn-icon svg { width: 18px; height: 18px; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.15rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: all var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(30,136,229,0.12), var(--shadow-glow-blue);
}
.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%235A6A7E' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.6rem center;
    background-repeat: no-repeat;
    background-size: 1.4em 1.4em;
    padding-right: 2.5rem;
}

input[type="file"].form-control {
    padding: 0.5rem;
    font-size: 0.85rem;
}
input[type="file"].form-control::file-selector-button {
    background: var(--brand-gradient);
    color: white;
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: all var(--transition);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    accent-color: var(--brand-blue);
    width: 18px;
    height: 18px;
}

.form-inline {
    display: flex;
    gap: 0.75rem;
    align-items: end;
    flex-wrap: wrap;
}

.form-helper {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ── Priority Selector ─────────────────────────────────────────────────── */
.priority-select { display: flex; gap: var(--space-sm); }

.priority-option {
    flex: 1;
    text-align: center;
}
.priority-option input { display: none; }

.priority-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}
.priority-option label:hover {
    border-color: var(--border-light);
    background: rgba(255,255,255,0.02);
}

.priority-option input:checked + label.priority-low {
    border-color: var(--color-success);
    background: var(--color-success-bg);
    color: var(--color-success);
}
.priority-option input:checked + label.priority-medium {
    border-color: var(--color-warning);
    background: var(--color-warning-bg);
    color: var(--color-warning);
}
.priority-option input:checked + label.priority-high {
    border-color: var(--color-danger);
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
}
.table-wrap::-webkit-scrollbar { height: 4px; }
.table-wrap::-webkit-scrollbar-track { background: var(--bg-primary); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.7rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255,255,255,0.02);
    position: sticky;
    top: 0;
}
th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

tbody tr {
    transition: background var(--transition-fast);
}
tbody tr:hover {
    background: rgba(30,136,229,0.04);
}
tbody tr:last-child td {
    border-bottom: none;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-open { background: rgba(30,136,229,0.12); color: var(--brand-blue-light); }
.badge-progress { background: rgba(245,158,11,0.12); color: var(--color-warning); }
.badge-resolved { background: rgba(16,185,129,0.12); color: var(--color-success); }
.badge-closed { background: rgba(100,116,139,0.12); color: var(--text-muted); }

.badge-low { background: rgba(16,185,129,0.12); color: var(--color-success); }
.badge-medium { background: rgba(245,158,11,0.12); color: var(--color-warning); }
.badge-high { background: rgba(239,68,68,0.12); color: var(--color-danger); }

.badge-minor { background: rgba(245,158,11,0.12); color: var(--color-warning); }
.badge-major { background: rgba(217,119,6,0.12); color: var(--color-warning-dark); }
.badge-critical { background: rgba(239,68,68,0.12); color: var(--color-danger); }

/* ── Status Indicators ─────────────────────────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    flex-shrink: 0;
}

.status-operational {
    background: var(--color-success);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15), 0 0 8px rgba(16,185,129,0.3);
    animation: pulse-green 2s infinite;
}
.status-degraded {
    background: var(--color-warning);
    box-shadow: 0 0 0 3px rgba(245,158,11,0.15), 0 0 8px rgba(245,158,11,0.3);
    animation: pulse-yellow 2s infinite;
}
.status-partial_outage {
    background: var(--color-warning-dark);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.15), 0 0 8px rgba(217,119,6,0.3);
}
.status-major_outage {
    background: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.15), 0 0 8px rgba(239,68,68,0.3);
    animation: pulse-red 2s infinite;
}
.status-unknown { background: var(--text-muted); }

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
    50% { box-shadow: 0 0 0 6px rgba(16,185,129,0.08); }
}
@keyframes pulse-yellow {
    0%, 100% { box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
    50% { box-shadow: 0 0 0 6px rgba(245,158,11,0.08); }
}
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.08); }
}

/* ── Status Page ───────────────────────────────────────────────────────── */
.status-hero {
    text-align: center;
    padding: var(--space-2xl) 0 var(--space-xl);
}
.status-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    letter-spacing: -0.03em;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-hero .overall-status {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
}

.overall-good {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}
.overall-bad {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

.site-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.15rem var(--space-lg);
    margin-bottom: 0.6rem;
    transition: all var(--transition);
}
.site-status-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-xs);
}

.site-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}
.site-status-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.site-status-meta {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.uptime-bar-container {
    display: flex;
    gap: 1.5px;
    height: 28px;
    align-items: end;
}
.uptime-bar {
    flex: 1;
    border-radius: 2px;
    min-width: 1.5px;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-fast);
}
.uptime-bar:hover {
    transform: scaleY(1.15);
}
.uptime-bar:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.uptime-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Incidents Banner ──────────────────────────────────────────────────── */
.incident-banner {
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    border-radius: var(--radius-lg);
    padding: 1.15rem var(--space-lg);
    margin-bottom: var(--space-lg);
}
.incident-banner h3 {
    color: var(--color-danger);
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.incident-item { margin-bottom: 0.65rem; }
.incident-item:last-child { margin-bottom: 0; }
.incident-item h4 { font-size: 0.9rem; font-weight: 600; }
.incident-item p {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* ── Ticket Detail ─────────────────────────────────────────────────────── */
.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.ticket-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.ticket-ref {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9em;
}

.ticket-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin-bottom: var(--space-lg);
}

.meta-item {
    padding: 0.75rem 0.9rem;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition);
}
.meta-item:hover { border-color: var(--border-light); }
.meta-item .meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.meta-item .meta-value {
    font-weight: 600;
    margin-top: 0.2rem;
    font-size: 0.9rem;
}

.response-thread { margin-top: var(--space-xl); }

.response-item {
    border-left: 3px solid var(--border-light);
    padding: var(--space-md) 1.15rem;
    margin-bottom: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: border-color var(--transition);
}
.response-item:hover { border-left-color: var(--brand-blue); }
.response-item.internal {
    border-left-color: var(--color-warning);
    background: rgba(245,158,11,0.04);
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    font-size: 0.825rem;
}
.response-author { font-weight: 600; color: var(--text-primary); }
.response-time { color: var(--text-muted); font-size: 0.78rem; }
.response-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* ── Flash Messages ────────────────────────────────────────────────────── */
.flash-messages { padding: var(--space-md) 0 0; }

.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}
.flash-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}
.flash-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(245,158,11,0.25);
}
.flash-info {
    background: rgba(6,182,212,0.08);
    color: var(--color-info);
    border: 1px solid rgba(6,182,212,0.25);
}

/* ── Pagination ────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    margin-top: var(--space-xl);
    list-style: none;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    padding: 0 0.3rem;
}
.pagination a:hover {
    background: rgba(30,136,229,0.1);
    color: var(--brand-blue-light);
}
.pagination .active {
    background: var(--brand-gradient);
    color: white;
}

/* ── Page Header ───────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}
.page-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ── Filter Bar ────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.65rem;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    align-items: end;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar select { min-width: 140px; }

/* ── Success Page ──────────────────────────────────────────────────────── */
.success-page {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-success-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    border: 2px solid var(--color-success-border);
}
.success-icon svg { width: 40px; height: 40px; color: var(--color-success); }

.success-page h1 {
    font-size: 1.6rem;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}
.success-page p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.reference-box {
    display: inline-block;
    background: var(--bg-elevated);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius);
    padding: 0.75rem 2rem;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    margin-bottom: var(--space-xl);
    background: var(--brand-gradient-soft);
    color: var(--brand-blue-light);
}

/* ── Error Pages ───────────────────────────────────────────────────────── */
.error-page {
    text-align: center;
    padding: 5rem 0;
}
.error-page .error-code {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-sm);
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.error-page h2 {
    font-size: 1.35rem;
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}
.error-page p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border-color);
    padding: var(--space-lg) 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: auto;
    background: var(--bg-primary);
}

/* ── Honeypot ──────────────────────────────────────────────────────────── */
.ohnohoney { position: absolute; left: -9999px; opacity: 0; }

/* ── Dashboard Grid ────────────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.dashboard-grid .card { min-height: 0; }

/* ── Login Page ────────────────────────────────────────────────────────── */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height) - 80px);
    padding: var(--space-xl) 0;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}
.login-logo img {
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-md);
}
.login-logo h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}
.login-logo p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-muted);
}
.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.4;
}
.empty-state p {
    font-size: 0.9rem;
}

/* ── Dashboard Metric Card (mini chart) ────────────────────────────────── */
.metric-trend {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    margin-top: 0.35rem;
}
.metric-trend.up { color: var(--color-success); }
.metric-trend.down { color: var(--color-danger); }
.metric-trend svg { width: 14px; height: 14px; }

/* ── Attachments Gallery ───────────────────────────────────────────────── */
.attachment-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
}
.attachment-grid a {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}
.attachment-grid a:hover {
    border-color: var(--brand-blue);
    box-shadow: var(--shadow-glow-blue);
    transform: scale(1.02);
}
.attachment-grid img {
    max-width: 200px;
    max-height: 200px;
    display: block;
    object-fit: cover;
}

/* ── Scrollbar Global ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hamburger { display: block; }

    .navbar-nav {
        display: none;
        position: absolute;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: rgba(15,20,34,0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: var(--space-sm) var(--space-md);
        box-shadow: var(--shadow-lg);
    }
    .navbar-nav.open { display: flex; }
    .navbar-nav li a,
    .navbar-nav li button.nav-link-btn {
        width: 100%;
        padding: 0.65rem var(--space-md);
    }

    .admin-subnav {
        padding: var(--space-sm) var(--space-md);
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .ticket-header { flex-direction: column; }
    .site-status-meta { flex-direction: column; gap: 0.2rem; }
    .status-hero h1 { font-size: 1.5rem; }
    .filter-bar {
        flex-direction: column;
        padding: var(--space-md);
    }
    .filter-bar select { min-width: 100%; }
    .page-header {
        flex-direction: column;
        align-items: start;
    }
    .ticket-meta { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .container, .container-sm { padding: 0 var(--space-md); }
    .priority-select { flex-direction: column; }
    .ticket-meta { grid-template-columns: 1fr; }
    .stat-card .stat-value { font-size: 1.6rem; }
}
