/* ============================================================
   Kamran Ahmed — theme
   Primary colour: royal blue (#1E40AF).
   ============================================================ */

:root {
    --brand: #1e40af;
    --brand-rgb: 30, 64, 175;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-800: #1e3a8a;
    --brand-900: #172554;
    --brand-950: #0f172a;
    --brand-accent: #60a5fa;
    --brand-soft: #dbe4f8;
    --content-bg: #f4f6fb;

    /* Bootstrap primary remap -> brand blue */
    --bs-primary: #1e40af;
    --bs-primary-rgb: 30, 64, 175;
    --bs-primary-bg-subtle: #dbe4f8;
    --bs-primary-border-subtle: #b6c8f0;
    --bs-primary-text-emphasis: #1e3a8a;
    --bs-link-color: #1e40af;
    --bs-link-color-rgb: 30, 64, 175;
    --bs-link-hover-color: #1d4ed8;
    --bs-link-hover-color-rgb: 29, 78, 216;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--content-bg);
    font-family: var(--bs-body-font-family);
    color: #1e293b;
}

/* ------------------------------ Buttons ------------------------------ */
.btn {
    --bs-btn-border-radius: .65rem;
    --bs-btn-font-weight: 600;
    --bs-btn-padding-y: .55rem;
    --bs-btn-padding-x: 1.1rem;
}

.btn-primary {
    --bs-btn-bg: #1e40af;
    --bs-btn-border-color: #1e40af;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1e3a8a;
    --bs-btn-active-border-color: #1e3a8a;
    --bs-btn-disabled-bg: #1e40af;
    --bs-btn-disabled-border-color: #1e40af;
    --bs-btn-focus-shadow-rgb: 30, 64, 175;
}

.btn-outline-primary {
    --bs-btn-color: #1e40af;
    --bs-btn-border-color: #1e40af;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #1e40af;
    --bs-btn-hover-border-color: #1e40af;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-border-color: #1d4ed8;
    --bs-btn-disabled-color: #1e40af;
    --bs-btn-disabled-border-color: #1e40af;
    --bs-btn-focus-shadow-rgb: 30, 64, 175;
}

.btn-success {
    --bs-btn-bg: #16a34a;
    --bs-btn-border-color: #16a34a;
    --bs-btn-hover-bg: #15803d;
    --bs-btn-hover-border-color: #15803d;
}

/* ------------------------------ Sidebar ------------------------------ */
.admin-sidebar {
    width: 264px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    color: rgba(255, 255, 255, .72);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 0;
}

.admin-sidebar .brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 0 1.15rem .35rem;
    text-decoration: none;
}

.admin-sidebar .brand-logo {
    background: #fff;
    border-radius: .85rem;
    padding: .5rem .7rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.admin-sidebar .brand-logo img {
    height: 26px;
    display: block;
}

.admin-sidebar .brand-logo .divider {
    width: 1px;
    height: 22px;
    background: #e2e8f0;
}

.admin-sidebar .brand-text {
    line-height: 1.1;
}

.admin-sidebar .brand-text .name {
    color: #fff;
    font-weight: 700;
    font-size: .98rem;
    letter-spacing: .2px;
}

.admin-sidebar .brand-text .sub {
    color: rgba(255, 255, 255, .55);
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.admin-sidebar .nav-section {
    color: rgba(255, 255, 255, .4);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    padding: 1.1rem 1.5rem .4rem;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, .74);
    border-radius: .75rem;
    margin: .14rem .8rem;
    padding: .68rem .85rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 500;
    position: relative;
    transition: background .15s ease, color .15s ease;
}

.admin-sidebar .nav-link i {
    font-size: 1.05rem;
    width: 1.15rem;
    text-align: center;
}

.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .09);
    color: #fff;
}

.admin-sidebar .nav-link.active {
    background: linear-gradient(90deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(30, 64, 175, .5);
}

.admin-sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: -.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    border-radius: 4px;
    background: var(--brand-accent);
}

.admin-sidebar .sidebar-footer {
    padding: .9rem 1.15rem 0;
    margin-top: .5rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.admin-sidebar .sidebar-footer .btn-outline-light {
    border-color: rgba(255, 255, 255, .25);
    color: rgba(255, 255, 255, .85);
}

.admin-sidebar .sidebar-footer .btn-outline-light:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .35);
    color: #fff;
}

/* Mobile offcanvas mirrors the sidebar */
.admin-offcanvas {
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    color: rgba(255, 255, 255, .8);
    --bs-nav-pills-link-active-bg: #1e40af;
    width: 280px;
}

.admin-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.admin-offcanvas .brand-logo {
    background: #fff;
    border-radius: .75rem;
    padding: .45rem .65rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.admin-offcanvas .brand-logo img {
    height: 24px;
}

.admin-offcanvas .nav-link {
    color: rgba(255, 255, 255, .78);
    border-radius: .75rem;
    padding: .7rem .85rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.admin-offcanvas .nav-link:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.admin-offcanvas .nav-link.active {
    background: linear-gradient(90deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
}

/* ------------------------------ Layout ------------------------------ */
.admin-main {
    margin-left: 264px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid #e8edf5;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.admin-topbar .page-heading {
    font-weight: 700;
    color: #16213a;
    letter-spacing: -.2px;
}

.admin-topbar .page-sub {
    font-size: .78rem;
    color: #7c8aa3;
}

.admin-topbar .user-chip {
    background: #f1f5fb;
    border: 1px solid #e2e8f2;
    border-radius: 999px;
    padding: .3rem .8rem .3rem .35rem;
}

.admin-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
}

.admin-avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
}

/* ------------------------------ Cards ------------------------------ */
.card {
    border: 1px solid #edf1f8;
    border-radius: 1.1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.card-header {
    border-bottom: 1px solid #eef1f8;
    border-radius: 1.1rem 1.1rem 0 0 !important;
    background: #fff;
    font-weight: 600;
}

.stat-card {
    border: 1px solid #edf1f8;
    border-radius: 1.15rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .1);
}

.stat-card .icon-tile {
    width: 58px;
    height: 58px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.stat-title {
    font-size: .74rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #8896aa;
    font-weight: 600;
}

.stat-value {
    font-weight: 800;
    letter-spacing: -.5px;
    color: #16213a;
}

/* Gradient hero used on dashboard */
.hero-banner {
    background:
        radial-gradient(1200px 300px at 110% -40%, rgba(96, 165, 250, .35), transparent 60%),
        linear-gradient(120deg, #1e3a8a 0%, #1e40af 55%, #2563eb 100%);
    border-radius: 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../img/pattern-bg.png");
    background-size: 220px;
    opacity: .12;
    pointer-events: none;
}

.hero-banner .hero-content {
    position: relative;
    z-index: 1;
}

.hero-banner .hero-logo {
    background: #fff;
    border-radius: .9rem;
    padding: .55rem .85rem;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}

.hero-banner .hero-logo img {
    height: 30px;
}

.hero-banner .hero-logo .divider {
    width: 1px;
    height: 26px;
    background: #e2e8f0;
}

/* ------------------------------ Tables ------------------------------ */
.table > :not(caption) > * > * {
    padding: .85rem 1rem;
}

.table thead th {
    background: #f6f8fc;
    color: #7c8aa3;
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid #e8edf5;
    white-space: nowrap;
}

.table tbody tr {
    transition: background .12s ease;
}

.table-hover tbody tr:hover > * {
    background: #f3f6fc;
}

.table-photo {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: .7rem;
}

/* ------------------------------ Forms ------------------------------ */
.form-control,
.form-select,
.input-group-text {
    border-radius: .65rem;
    border-color: #dfe5f0;
}

.input-group > .input-group-text {
    background: #f2f5fb;
    color: #55637a;
    border-color: #dfe5f0;
}

.form-control:focus,
.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 .22rem rgba(30, 64, 175, .16);
}

.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: #334155;
}

/* ------------------------------ Badges ------------------------------ */
.badge {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: .01em;
    padding: .42em .75em;
}

/* ------------------------------ Auth pages ------------------------------ */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(900px 500px at 10% 0%, rgba(96, 165, 250, .3), transparent 55%),
        linear-gradient(135deg, #172554 0%, #1e40af 100%);
    position: relative;
    overflow: hidden;
}

.auth-body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../img/pattern-bg.png");
    background-size: 260px;
    opacity: .08;
    pointer-events: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.auth-card {
    width: 100%;
    border: 0;
    border-radius: 1.5rem;
    box-shadow: 0 30px 60px rgba(2, 23, 15, .45);
    overflow: hidden;
}

.auth-card .auth-head {
    background: linear-gradient(120deg, #1e3a8a, #1e40af);
    color: #fff;
    padding: 1.75rem 1.75rem 1.5rem;
    text-align: center;
}

.auth-card .auth-head .auth-logos {
    background: #fff;
    border-radius: 1rem;
    padding: .6rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}

.auth-card .auth-head .auth-logos img {
    height: 34px;
}

.auth-card .auth-head .auth-logos .divider {
    width: 1px;
    height: 30px;
    background: #e2e8f0;
}

.auth-card .auth-head h1 {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
}

.auth-card .auth-head p {
    margin: .35rem 0 0;
    font-size: .85rem;
    color: rgba(255, 255, 255, .78);
}

.auth-card .auth-body-inner {
    padding: 1.75rem;
    background: #fff;
}

.auth-foot {
    color: rgba(255, 255, 255, .6);
    font-size: .8rem;
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 991.98px) {
    .admin-sidebar {
        display: none;
    }

    .admin-main {
        margin-left: 0;
    }
}
