/* =====================================================================
 |  Custom Framework — Light Blue Theme
 |  Bootstrap 5 compatible. Override CSS variables on :root to retheme.
 * ====================================================================*/

:root {
    /* Brand palette — light blue, refined */
    --gp-blue-50:  #f1f6ff;
    --gp-blue-100: #e1ecff;
    --gp-blue-200: #c7daff;
    --gp-blue-300: #9cbcff;
    --gp-blue-400: #6b97f7;
    --gp-blue-500: #3b73ea;   /* primary */
    --gp-blue-600: #2756c9;
    --gp-blue-700: #1e44a3;
    --gp-blue-800: #1a3680;

    --gp-ink-900: #0d1a36;    /* deep navy text */
    --gp-ink-700: #2c3f63;
    --gp-ink-500: #5b6b88;
    --gp-ink-400: #7e8aa3;
    --gp-ink-300: #aab4c8;
    --gp-line:    #e5ebf5;
    --gp-bg:      #f4f7fc;
    --gp-surface: #ffffff;

    --gp-success: #10b981;
    --gp-warn:    #f59e0b;
    --gp-danger:  #ef4444;

    --gp-radius-sm: 8px;
    --gp-radius:    12px;
    --gp-radius-lg: 18px;

    --gp-shadow-sm: 0 1px 2px rgba(15, 39, 89, 0.05);
    --gp-shadow:    0 4px 14px rgba(15, 39, 89, 0.06), 0 1px 2px rgba(15, 39, 89, 0.04);
    --gp-shadow-lg: 0 18px 48px -16px rgba(15, 39, 89, 0.18), 0 6px 14px -8px rgba(15, 39, 89, 0.10);

    /* Bootstrap variable overrides — keep BS components on-brand */
    --bs-primary: var(--gp-blue-500);
    --bs-primary-rgb: 59, 115, 234;
    --bs-body-color: var(--gp-ink-900);
    --bs-body-bg: var(--gp-bg);
    --bs-border-color: var(--gp-line);
    --bs-link-color: var(--gp-blue-600);
    --bs-link-hover-color: var(--gp-blue-700);
}

/* ---------- Typography ---------- */

html, body {
    font-family: 'Inter Tight', system-ui, -apple-system, Segoe UI, sans-serif;
    font-feature-settings: 'cv02','cv03','cv04','cv11';
    background:
        radial-gradient(1200px 600px at -10% -10%, var(--gp-blue-100), transparent 60%),
        radial-gradient(900px 500px at 110% 0%, #eaf3ff, transparent 55%),
        var(--gp-bg);
    color: var(--gp-ink-900);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

h1, h2, h3, h4, h5, h6,
.gp-display {
    font-family: 'Plus Jakarta Sans', 'Inter Tight', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gp-ink-900);
}

.gp-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    font-weight: 600;
    color: var(--gp-blue-600);
}

/* ---------- Layout shell ---------- */

.gp-shell {
    display: grid;
    grid-template-columns: 268px 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.gp-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border-right: 1px solid var(--gp-line);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.gp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 22px;
    border-bottom: 1px dashed var(--gp-line);
    margin-bottom: 16px;
}
.gp-brand__mark {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--gp-blue-500), var(--gp-blue-700));
    color: #fff;
    display: grid; place-items: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800; font-size: 16px;
    box-shadow: 0 6px 16px -4px rgba(59,115,234,.45);
    position: relative;
}
.gp-brand__mark::after {
    content: ""; position: absolute; inset: 1px;
    border-radius: 10px;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.18) 100%);
}
.gp-brand__name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.gp-brand__sub  { font-size: 11px; color: var(--gp-ink-400); letter-spacing: 0.04em; }

.gp-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.gp-nav__section {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--gp-ink-400);
    padding: 16px 12px 6px;
}
.gp-nav__link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--gp-radius-sm);
    color: var(--gp-ink-700);
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .15s ease;
    font-size: 14.5px;
}
.gp-nav__link:hover { background: var(--gp-blue-50); color: var(--gp-blue-700); }
.gp-nav__link.is-active {
    background: linear-gradient(90deg, var(--gp-blue-500), var(--gp-blue-600));
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(59,115,234,.6);
}
.gp-nav__link.is-active .gp-nav__icon { color: #fff; }
.gp-nav__icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--gp-ink-400); }
.gp-nav__badge { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gp-blue-100); color: var(--gp-blue-700); }
.gp-nav__link.is-active .gp-nav__badge { background: rgba(255,255,255,.22); color: #fff; }

/* ---------- Topbar ---------- */

.gp-main { display: flex; flex-direction: column; min-width: 0; }

.gp-topbar {
    height: 68px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gp-line);
    display: flex; align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0; z-index: 30;
}
.gp-search {
    flex: 1; max-width: 460px;
    position: relative;
}
.gp-search input {
    width: 100%;
    height: 40px;
    border-radius: var(--gp-radius-sm);
    border: 1px solid var(--gp-line);
    background: var(--gp-blue-50);
    padding: 0 14px 0 40px;
    font: inherit;
    color: var(--gp-ink-900);
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.gp-search input::placeholder { color: var(--gp-ink-400); }
.gp-search input:focus {
    outline: 0;
    background: #fff;
    border-color: var(--gp-blue-300);
    box-shadow: 0 0 0 4px rgba(59,115,234,.12);
}
.gp-search svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--gp-ink-400);
}

.gp-iconbtn {
    width: 40px; height: 40px;
    border-radius: var(--gp-radius-sm);
    border: 1px solid var(--gp-line);
    background: #fff;
    display: grid; place-items: center;
    cursor: pointer;
    color: var(--gp-ink-700);
    position: relative;
    transition: border-color .15s, color .15s, transform .15s;
}
.gp-iconbtn:hover { border-color: var(--gp-blue-300); color: var(--gp-blue-600); }
.gp-iconbtn .gp-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gp-danger); border: 2px solid #fff; }

.gp-userchip {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--gp-line);
    background: #fff;
    cursor: pointer;
}
.gp-userchip__avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--gp-blue-400), var(--gp-blue-700));
    display: grid; place-items: center; color: #fff;
    font-size: 13px; font-weight: 700;
}
.gp-userchip__name { font-size: 13.5px; font-weight: 600; line-height: 1.15; }
.gp-userchip__role { font-size: 11px; color: var(--gp-ink-400); line-height: 1.15; }

/* ---------- Page header ---------- */

.gp-content { padding: 28px 28px 56px; }

.gp-pagehead {
    display: flex; align-items: end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.gp-pagehead h1 { font-size: 28px; margin: 0; }
.gp-crumbs { color: var(--gp-ink-400); font-size: 13px; }
.gp-crumbs a { color: var(--gp-ink-500); text-decoration: none; }
.gp-crumbs a:hover { color: var(--gp-blue-600); }
.gp-crumbs span + span::before { content: "/"; margin: 0 8px; color: var(--gp-ink-300); }

/* ---------- Cards & surfaces ---------- */

.gp-card {
    background: var(--gp-surface);
    border: 1px solid var(--gp-line);
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow-sm);
    padding: 20px;
    transition: box-shadow .2s, transform .2s, border-color .2s;
}
.gp-card:hover { box-shadow: var(--gp-shadow); }
.gp-card--feature {
    background:
        linear-gradient(135deg, rgba(59,115,234,.04), transparent 55%),
        var(--gp-surface);
    border-color: var(--gp-blue-100);
}

.gp-stat { display: flex; gap: 16px; align-items: flex-start; }
.gp-stat__icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--gp-blue-50);
    color: var(--gp-blue-600);
    display: grid; place-items: center;
}
.gp-stat__label { font-size: 12.5px; color: var(--gp-ink-500); letter-spacing: .02em; }
.gp-stat__value { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 28px; line-height: 1.05; letter-spacing: -0.02em; }
.gp-stat__delta { font-size: 12px; font-weight: 600; }
.gp-stat__delta--up   { color: var(--gp-success); }
.gp-stat__delta--down { color: var(--gp-danger);  }

/* ---------- Tables ---------- */

.gp-table-wrap {
    background: var(--gp-surface);
    border: 1px solid var(--gp-line);
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow-sm);
    overflow: hidden;
}
.gp-table { width: 100%; border-collapse: collapse; }
.gp-table thead th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gp-ink-500);
    padding: 14px 18px;
    background: var(--gp-blue-50);
    border-bottom: 1px solid var(--gp-line);
    font-weight: 600;
}
.gp-table tbody td { padding: 14px 18px; border-bottom: 1px solid var(--gp-line); font-size: 14px; vertical-align: middle; }
.gp-table tbody tr:last-child td { border-bottom: 0; }
.gp-table tbody tr:hover { background: var(--gp-blue-50); }

/* ---------- Pills / badges ---------- */

.gp-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
    background: var(--gp-blue-100); color: var(--gp-blue-700);
}
.gp-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.gp-pill--success { background: rgba(16,185,129,.12); color: #047857; }
.gp-pill--warn    { background: rgba(245,158,11,.14); color: #b45309; }
.gp-pill--danger  { background: rgba(239,68,68,.12);  color: #b91c1c; }

/* ---------- Buttons (override BS to feel native) ---------- */

.btn { font-weight: 600; border-radius: var(--gp-radius-sm); padding: 9px 16px; letter-spacing: -.005em; }
.btn-primary {
    background: linear-gradient(180deg, var(--gp-blue-500), var(--gp-blue-600));
    border-color: var(--gp-blue-600);
    box-shadow: 0 6px 14px -6px rgba(59,115,234,.5);
}
.btn-primary:hover {
    background: linear-gradient(180deg, var(--gp-blue-600), var(--gp-blue-700));
    border-color: var(--gp-blue-700);
}
.btn-outline-primary { color: var(--gp-blue-600); border-color: var(--gp-blue-200); }
.btn-outline-primary:hover { background: var(--gp-blue-500); border-color: var(--gp-blue-500); }

/* ---------- Forms ---------- */

.form-label { font-size: 13px; font-weight: 600; color: var(--gp-ink-700); margin-bottom: 6px; }
.form-control, .form-select {
    border-radius: var(--gp-radius-sm);
    border-color: var(--gp-line);
    padding: 10px 14px;
    background: #fff;
    color: var(--gp-ink-900);
    font-size: 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--gp-blue-400);
    box-shadow: 0 0 0 4px rgba(59,115,234,.14);
}

/* ---------- Alerts ---------- */

.gp-flash {
    border-radius: var(--gp-radius);
    padding: 14px 16px;
    border: 1px solid;
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}
.gp-flash--success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.gp-flash--error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.gp-flash--info    { background: var(--gp-blue-50); border-color: var(--gp-blue-200); color: var(--gp-blue-700); }

/* ---------- Auth (split) layout ---------- */

.gp-auth {
    min-height: 100vh;
    display: grid; grid-template-columns: 1fr 1fr;
}
@media (max-width: 991.98px) { .gp-auth { grid-template-columns: 1fr; } .gp-auth__art { display: none; } }
.gp-auth__form {
    display: grid; place-items: center;
    padding: 48px 24px;
}
.gp-auth__inner { width: 100%; max-width: 380px; }
.gp-auth__inner h1 { font-size: 30px; margin-bottom: 8px; }
.gp-auth__inner p.lead { color: var(--gp-ink-500); margin-bottom: 28px; font-size: 14.5px; }

.gp-auth__art {
    background:
        radial-gradient(700px 420px at 30% 10%, var(--gp-blue-200), transparent 55%),
        radial-gradient(600px 400px at 80% 90%, #d6e3ff, transparent 60%),
        linear-gradient(135deg, var(--gp-blue-600), var(--gp-blue-800));
    color: #fff;
    position: relative;
    padding: 56px;
    display: flex; flex-direction: column; justify-content: space-between;
    overflow: hidden;
}
.gp-auth__art::after {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%);
    pointer-events: none;
}
.gp-auth__quote { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 28px; line-height: 1.25; letter-spacing: -0.02em; max-width: 460px; position: relative; z-index: 1; }
.gp-auth__meta  { font-size: 13px; opacity: .8; position: relative; z-index: 1; }

/* ---------- Utilities ---------- */

.gp-divider { height: 1px; background: var(--gp-line); margin: 24px 0; border: 0; }
.gp-mono { font-family: ui-monospace, 'JetBrains Mono', SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

/* Subtle entrance for primary content */
@keyframes gp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.gp-rise { animation: gp-rise .4s ease both; }
.gp-rise:nth-child(2) { animation-delay: .05s; }
.gp-rise:nth-child(3) { animation-delay: .10s; }
.gp-rise:nth-child(4) { animation-delay: .15s; }

/* =====================================================================
 |  Responsive — MUST stay at the end so these overrides win the cascade
 |  (equal-specificity rules are decided by source order; media queries
 |  do not add specificity, so the responsive block goes last).
 * ====================================================================*/

@media (max-width: 991.98px) {

    /* Single column: sidebar becomes an off-canvas overlay */
    .gp-shell { grid-template-columns: 1fr; }

    .gp-sidebar {
        display: none !important;
        position: fixed;
        inset: 0 auto 0 0;
        width: 284px;
        height: 100vh;
        z-index: 1050;
        box-shadow: var(--gp-shadow-lg);
    }

    .gp-sidebar.is-open {
        display: flex !important;
        animation: gp-slide-in .22s ease both;
    }

    /* Dim backdrop behind the open sidebar */
    .gp-sidebar.is-open::before {
        content: "";
        position: fixed;
        inset: 0;
        left: 284px;
        background: rgba(13, 26, 54, .42);
        backdrop-filter: blur(2px);
        z-index: -1;
    }

    .gp-topbar { padding: 0 16px; }
    .gp-content { padding: 18px 16px 48px; }
    .gp-pagehead h1 { font-size: 23px; }

    /* On phones the search field can shrink; chip text can hide */
    .gp-userchip__name, .gp-userchip__role { display: none; }
    .gp-userchip { padding: 4px; }
}

@media (max-width: 575.98px) {
    .gp-search { max-width: none; }
    .gp-stat__value { font-size: 24px; }
}

@keyframes gp-slide-in {
    from { transform: translateX(-100%); opacity: .4; }
    to   { transform: translateX(0); opacity: 1; }
}

/* Desktop: ensure the hamburger never shows and sidebar is always visible */
@media (min-width: 992px) {
    .gp-sidebar { display: flex !important; }
    [data-gp-toggle="sidebar"] { display: none !important; }
}
