/* ─── Layout ─────────────────────────────────────────────────────────────── */
body.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #f0f4f8;
    font-size: 14px;
}

.sidebar {
    width: 240px;
    min-height: 100vh;
    background: #1a3a5c;
    color: #c8d8e8;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    padding: 0;
    flex-shrink: 0;
    transition: transform .25s ease;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: #a8c0d6;
    text-decoration: none;
    font-size: 13.5px;
    transition: all .15s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.sidebar-nav .nav-section {
    padding: 14px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.3);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 28px 32px;
    max-width: calc(100vw - 240px);
}

/* ─── Company View Banner (super admin viewing as company) ──────────────── */
.company-view-banner {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    z-index: 1030;
    background: #1a3a5c;
    color: #fff;
    padding: 8px 24px;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

body.has-company-banner .main-content {
    padding-top: 60px;
}

/* Mobile toggle button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    cursor: pointer;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1040;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 70px 16px 24px;
    }

    .company-view-banner {
        left: 0;
        top: 0;
    }

    body.has-company-banner .main-content {
        padding-top: 110px;
    }

    .page-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .page-title {
        font-size: 1.15rem;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 65px 10px 20px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .services-table {
        min-width: 0 !important;
    }

    .services-table th,
    .services-table td {
        padding: 4px 6px !important;
        font-size: 12px;
    }

    .services-table .input-group-text {
        padding: 2px 6px;
        font-size: 11px;
    }

    .services-table .form-control-sm,
    .services-table .form-select-sm {
        font-size: 12px;
        padding: 3px 6px;
    }

    .speed-sub-row .d-flex {
        flex-direction: column !important;
        gap: 4px !important;
    }

    .speed-sub-row .d-flex > span {
        width: auto !important;
    }
}

/* ─── Page Header ────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0;
}

/* ─── Stat Cards ─────────────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.bg-primary-soft { background: #e8f0fe; }
.bg-warning-soft { background: #fff8e1; }
.bg-success-soft { background: #e8f5e9; }
.bg-info-soft    { background: #e3f2fd; }

.stat-value { font-size: 1.8rem; font-weight: 700; color: #1a3a5c; line-height: 1; }
.stat-label { font-size: .8rem; color: #7a8fa6; margin-top: 4px; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
    border: 1px solid #dde3ea;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.card-header {
    background: #f7f9fc;
    border-bottom: 1px solid #dde3ea;
    padding: 12px 18px;
    font-size: 14px;
    border-radius: 10px 10px 0 0 !important;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #7a8fa6; }
.table td { vertical-align: middle; }

/* ─── Services Table ─────────────────────────────────────────────────────── */
.services-table th,
.services-table td { vertical-align: top !important; }

/* ─── Login Page ─────────────────────────────────────────────────────────── */
body.login-page {
    background: linear-gradient(135deg, #1a3a5c, #2d6a9f);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card { width: 380px; border: none; border-radius: 12px; }

/* ─── Contract Preview ───────────────────────────────────────────────────── */
.contract-preview {
    font-size: 10.5pt;
    line-height: 1.7;
    color: #222;
}

.contract-preview h1, .contract-preview h2, .contract-preview h3 { color: #1a3a5c; }
.contract-preview table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.contract-preview td, .contract-preview th { border: 1px solid #ccc; padding: 6px 10px; }
.contract-preview th { background: #f0f4f8; }
