/* ============================================
   Kitocha WiFi - Design System
   Brand: navy #022d5e + orange #fd8804, Outfit headings, Poppins body.
   Light and dark (navy) themes. No gradients, no glows.
   ============================================ */

/* CSS Variables - Light Mode Default */
:root {
    /* Brand */
    --primary: #022d5e;            /* Kitocha navy */
    --primary-rgb: 2 45 94;
    --primary-light: #0a4a8f;
    --primary-dark: #011f42;
    --on-primary: #ffffff;
    --primary-hover: #fd8804;      /* orange on hover, as on kitocha.com */
    --on-primary-hover: #0a0a0a;
    --secondary: #fd8804;          /* Kitocha orange (fills) */
    --accent-text: #b35400;        /* orange darkened for AA contrast on light */

    /* Status */
    --success: #15803d;
    --warning: #b45309;
    --danger: #dc2626;
    --info: #1d4ed8;

    /* Typography */
    --font-body: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', 'Poppins', ui-sans-serif, system-ui, sans-serif;

    /* Backgrounds */
    --bg-body: #fafafa;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;
    --bg-hover: #f1f3f6;
    --bg-input: #ffffff;

    /* Text */
    --text-primary: #0a0a0a;
    --text-secondary: #404a58;
    --text-muted: #6b7686;
    --text-inverse: #ffffff;

    /* Borders */
    --border-color: #e3e7ed;
    --border-radius: 14px;
    --border-radius-sm: 10px;
    --border-radius-lg: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(10, 10, 10, 0.05);
    --shadow: 0 1px 3px 0 rgba(10, 10, 10, 0.1), 0 1px 2px -1px rgba(10, 10, 10, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(10, 10, 10, 0.1), 0 2px 4px -2px rgba(10, 10, 10, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(10, 10, 10, 0.1), 0 4px 6px -4px rgba(10, 10, 10, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(10, 10, 10, 0.1), 0 8px 10px -6px rgba(10, 10, 10, 0.1);

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Spacing */
    --header-height: 70px;
}

/* Dark Mode - Kitocha navy palette */
[data-theme="dark"] {
    --primary: #fd8804;
    --primary-rgb: 253 136 4;
    --primary-light: #ffa033;
    --primary-dark: #e07800;
    --on-primary: #0a0a0a;
    --primary-hover: #ffffff;
    --on-primary-hover: #022d5e;
    --accent-text: #fd8804;

    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #7ab4ff;

    --bg-body: #021c3d;
    --bg-card: #022d5e;
    --bg-sidebar: #011f42;
    --bg-header: #022d5e;
    --bg-hover: #073a70;
    --bg-input: #021c3d;

    --text-primary: #ffffff;
    --text-secondary: #d3deec;
    --text-muted: #94a9c4;

    --border-color: #12497f;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition-base), color var(--transition-base);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, .brand-text, .stat-value {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}
h1, h2 { font-weight: 800; }
h3, h4, h5 { font-weight: 700; }
::selection { background: rgb(253 136 4 / 0.35); color: #0a0a0a; }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
button, input, select, textarea { font-family: inherit; }
a { color: var(--accent-text); }

/* Brand lock-up (logo mark + wordmark) */
.brand-lockup { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text-primary); }
.brand-lockup .brand-mark { display: flex; align-items: center; border-radius: 10px; flex-shrink: 0; }
.brand-lockup .brand-mark img { height: 34px; width: auto; display: block; }
.brand-lockup .brand-word { font-family: var(--font-heading); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.brand-lockup .brand-sub { color: var(--accent-text); font-weight: 700; }
[data-theme="dark"] .brand-lockup .brand-mark,
.on-navy .brand-lockup .brand-mark { background: #fff; padding: 3px 5px; }
.on-navy .brand-lockup { color: #fff; }
.on-navy .brand-lockup .brand-sub { color: #fd8804; }
.sidebar.collapsed .brand-lockup .brand-word { display: none; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: width var(--transition-base), transform var(--transition-base);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.75rem;
}

.sidebar-brand .brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    padding: 0 1.25rem;
    margin-top: 1rem;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.nav-link i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.nav-link span {
    margin-left: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-link span {
    opacity: 0;
    width: 0;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-sm);
}

.nav-link.active i {
    color: var(--on-primary);
}

:root:not([data-theme="dark"]) .nav-link.active i {
    color: var(--secondary);
}

.nav-link .badge {
    margin-left: auto;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: var(--secondary);
    color: #0a0a0a;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-link .badge {
    opacity: 0;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-toggle {
    width: 100%;
    padding: 0.625rem;
    background: var(--bg-hover);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed);
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-search {
    position: relative;
    width: 320px;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.12);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

.header-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-header);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    line-height: 1.3;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Content Area */
.content-area {
    padding: 1.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--secondary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-icon.primary { background: rgb(var(--primary-rgb) / 0.12); color: var(--primary); }
.stat-icon.success { background: rgb(21 128 61 / 0.1); color: var(--success); }
.stat-icon.warning { background: rgb(180 83 9 / 0.1); color: var(--warning); }
.stat-icon.danger { background: rgb(220 38 38 / 0.1); color: var(--danger); }
.stat-icon.info { background: rgb(var(--primary-rgb) / 0.1); color: var(--info); }

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* ============================================
   TABLES
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES & STATUS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgb(21 128 61 / 0.1); color: var(--success); }
.badge-warning { background: rgb(180 83 9 / 0.1); color: var(--warning); }
.badge-danger { background: rgb(220 38 38 / 0.1); color: var(--danger); }
.badge-info { background: rgb(var(--primary-rgb) / 0.1); color: var(--info); }
.badge-secondary { background: var(--bg-hover); color: var(--text-muted); }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 0 2px rgb(21 128 61 / 0.2); }
.status-dot.offline { background: var(--danger); }
.status-dot.pending { background: var(--warning); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--on-primary-hover);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--border-radius-sm);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.12);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
    border-right: none;
}

.input-group .form-control:first-child {
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.input-group .btn {
    border-radius: 0 9999px 9999px 0;
}

/* ============================================
   ALERTS & TOASTS
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: rgb(21 128 61 / 0.1);
    border: 1px solid rgb(21 128 61 / 0.2);
    color: var(--success);
}

.alert-danger {
    background: rgb(220 38 38 / 0.1);
    border: 1px solid rgb(220 38 38 / 0.2);
    color: var(--danger);
}

.alert-warning {
    background: rgb(180 83 9 / 0.1);
    border: 1px solid rgb(180 83 9 / 0.2);
    color: var(--warning);
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   GRID SYSTEM
   ============================================ */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-md-3, .col-md-4, .col-md-6, .col-md-8,
.col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8, .col-lg-9 {
    padding: 0.75rem;
    flex: 1;
}

.col-1 { flex: 0 0 8.333%; }
.col-2 { flex: 0 0 16.667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333%; }
.col-5 { flex: 0 0 41.667%; }
.col-6 { flex: 0 0 50%; }
.col-7 { flex: 0 0 58.333%; }
.col-8 { flex: 0 0 66.667%; }
.col-9 { flex: 0 0 75%; }
.col-10 { flex: 0 0 83.333%; }
.col-11 { flex: 0 0 91.667%; }
.col-12 { flex: 0 0 100%; }

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; }
    .col-md-4 { flex: 0 0 33.333%; }
    .col-md-6 { flex: 0 0 50%; }
    .col-md-8 { flex: 0 0 66.667%; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25%; }
    .col-lg-4 { flex: 0 0 33.333%; }
    .col-lg-6 { flex: 0 0 50%; }
    .col-lg-8 { flex: 0 0 66.667%; }
    .col-lg-9 { flex: 0 0 75%; }
}

/* ============================================
   UTILITIES
   ============================================ */
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.d-inline-flex { display: inline-flex; }

.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-decoration-none { text-decoration: none; }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-medium { font-weight: 500; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.5rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.rounded { border-radius: var(--border-radius); }
.rounded-sm { border-radius: var(--border-radius-sm); }

.border-bottom { border-bottom: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-show {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .header-search {
        display: none;
    }

    .col-md-3, .col-md-4, .col-md-6, .col-md-8,
    .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8, .col-lg-9 {
        flex: 0 0 100%;
    }
}

/* Mobile menu overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   CUSTOMER PORTAL + SIGN-IN (shared by index, pay, success, admin/login)
   Navy canvas, white card, orange accents.
   ============================================ */
.customer-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: #022d5e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem 1rem;
}

.customer-card {
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--border-radius-lg);
    padding: 2.25rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
}

.customer-card .portal-title { font-size: 1.5rem; margin-bottom: 0.25rem; }

.portal-brand { display: flex; justify-content: center; }
.portal-footer { color: rgba(255, 255, 255, 0.65); font-size: 0.8125rem; text-align: center; }
.portal-footer a { color: #fff; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent-text);
}
.eyebrow::before { content: ''; width: 1.5rem; height: 2px; background: currentColor; border-radius: 2px; }

.package-option {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    background: var(--bg-card);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.package-option:hover { border-color: var(--text-muted); }
.package-option.selected {
    border-color: var(--secondary);
    background: rgb(253 136 4 / 0.08);
}
.package-price { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; color: var(--text-primary); }

.success-icon {
    width: 72px;
    height: 72px;
    background: rgb(253 136 4 / 0.15);
    color: var(--accent-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.25rem;
}

.voucher-code {
    background: var(--bg-hover);
    border: 2px dashed var(--secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    margin: 1rem 0;
}

/* Admin sign-in uses the same canvas; inputs get icons */
.login-page .customer-card { max-width: 440px; }
.field { position: relative; margin-bottom: 1.25rem; }
.field i {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 1.125rem; pointer-events: none;
    transition: color var(--transition-fast);
}
.field input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgb(253 136 4 / 0.2);
}
.field input:focus ~ i { color: var(--accent-text); }
.btn-block { width: 100%; padding: 0.875rem; font-size: 1rem; }
.theme-toggle-login {
    position: absolute; top: 1.25rem; right: 1.25rem;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.12); border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
    transition: background var(--transition-fast);
}
.theme-toggle-login:hover { background: rgba(255, 255, 255, 0.22); }

.spinner {
    width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: currentColor;
    border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
[data-theme="dark"] .customer-page { background: #011328; }

[hidden] { display: none !important; }

/* ============================================
   UTILITIES the admin markup relies on (previously undefined)
   ============================================ */
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
small, .small { font-size: 0.8125rem; }
.align-items-end { align-items: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.g-3 { gap: 0.75rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.ms-3 { margin-left: 0.75rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.col-md-1 { padding: 0.75rem; }
.col-md-2 { padding: 0.75rem; }
@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 8.333%; }
    .col-md-2 { flex: 0 0 16.667%; }
    .d-md-block { display: block !important; }
    .d-md-inline { display: inline !important; }
}
@media (max-width: 991px) {
    .col-md-1, .col-md-2 { flex: 0 0 100%; }
}
@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
}
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 1.1rem; height: 1.1rem; accent-color: var(--secondary); cursor: pointer; }
.form-check-label { font-size: 0.9375rem; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--secondary); }

.list-group { display: flex; flex-direction: column; }
.list-group-item { background: var(--bg-card); }

textarea.form-control { resize: vertical; font-family: inherit; }

/* Heading scale (the reset zeroes browser defaults) */
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
.package-price { white-space: nowrap; flex-shrink: 0; }

/* Sidebar layout: brand on top, nav scrolls, Logout/Collapse pinned below (never overlaps the links) */
.sidebar { display: flex; flex-direction: column; overflow: hidden; }
.sidebar-brand { flex-shrink: 0; }
.sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-footer { position: static; flex-shrink: 0; background: var(--bg-sidebar); }
