/* ============================================================
   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;
}

/* ------------------------------ 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 (split screen) ------------------------------ */
.auth-body {
    min-height: 100vh;
    margin: 0;
    background: #f1f5f9;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

/* Left branding panel */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 3.5rem;
    color: #fff;
    background:
        radial-gradient(900px 500px at 15% 0%, rgba(96, 165, 250, .35), transparent 55%),
        linear-gradient(150deg, #0f172a 0%, #1e3a8a 55%, #1e40af 100%);
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../img/pattern-bg.png");
    background-size: 260px;
    opacity: .08;
    pointer-events: none;
}

.auth-aside::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    right: -140px;
    bottom: -160px;
    background: radial-gradient(circle, rgba(59, 130, 246, .55), transparent 65%);
    pointer-events: none;
}

.auth-aside-inner {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    text-decoration: none;
    color: #fff;
    margin-bottom: 2.5rem;
}

.auth-brand img {
    height: 52px;
    width: auto;
    border-radius: .75rem;
    background: #fff;
    padding: .25rem;
}

.auth-brand span {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: .02em;
}

.auth-aside-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 .85rem;
}

.auth-aside-sub {
    color: rgba(255, 255, 255, .75);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
    display: grid;
    gap: .9rem;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255, 255, 255, .88);
    font-size: .95rem;
}

.auth-features li i {
    width: 38px;
    height: 38px;
    border-radius: .7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #bfdbfe;
    font-size: 1.05rem;
}

.auth-aside-foot {
    color: rgba(255, 255, 255, .5);
    font-size: .8rem;
    margin: 0;
}

/* Right form panel */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #f8fafc;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: 0;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .10);
    overflow: hidden;
}

.auth-card .auth-head {
    padding: 2rem 2rem 0;
    text-align: left;
    background: transparent;
    color: #0f172a;
}

.auth-card .auth-head .auth-logos {
    background: #fff;
    border-radius: 1rem;
    padding: .5rem .9rem;
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.1rem;
    border: 1px solid #e2e8f0;
}

.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: 800;
    font-size: 1.4rem;
    margin: 0;
    color: #0f172a;
}

.auth-card .auth-head p {
    margin: .4rem 0 0;
    font-size: .9rem;
    color: #64748b;
}

.auth-card .auth-body-inner {
    padding: 1.5rem 2rem 2rem;
    background: #fff;
}

.auth-foot {
    color: #94a3b8;
    font-size: .8rem;
}

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-aside {
        display: none;
    }

    .auth-main {
        padding: 2rem 1rem;
    }

    .auth-card .auth-head {
        text-align: center;
    }

    .auth-card .auth-head .auth-logos {
        margin-left: auto;
        margin-right: auto;
    }

    .auth-foot {
        color: #64748b;
    }
}

/* ------------------------------ Dashboard ------------------------------ */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .accent-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .76rem;
    font-weight: 600;
    padding: .18rem .5rem;
    border-radius: 999px;
}

.stat-trend.up { background: #dcfce7; color: #15803d; }
.stat-trend.down { background: #fee2e2; color: #b91c1c; }
.stat-trend.flat { background: #eef2f7; color: #64748b; }

/* Workforce donut */
.workforce-ring {
    --p: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color, #1e40af) calc(var(--p) * 1%), #e9eef7 0);
    display: grid;
    place-items: center;
    margin: 0 auto;
    position: relative;
}

.workforce-ring::before {
    content: "";
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px #eef1f8;
}

.workforce-ring .ring-center {
    position: absolute;
    text-align: center;
}

.workforce-ring .ring-center .ring-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #16213a;
    line-height: 1;
}

.workforce-ring .ring-center .ring-label {
    font-size: .7rem;
    color: #8896aa;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .85rem;
    border-radius: .8rem;
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    transition: background .15s ease;
}

.quick-link:hover {
    background: #f3f6fc;
    color: #1e40af;
}

.quick-link .quick-icon {
    width: 38px;
    height: 38px;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    background: var(--brand-soft);
    color: var(--brand);
    flex: 0 0 auto;
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 991.98px) {
    .admin-sidebar {
        display: none;
    }

    .admin-main {
        margin-left: 0;
    }
}
