/* ==========================================================================
   Banquet CRM — application theme
   Built on Bootstrap 5.3. Uses Bootstrap's own [data-bs-theme] switch so the
   dark mode is native rather than a second stylesheet.
   ========================================================================== */

:root {
    /* Brand — a restrained wine/gold pairing. Saturated colour is kept for
       accents only; an all-day CRM should not shout. */
    --bq-wine:          #8b1e3f;
    --bq-wine-dark:     #6d162f;
    --bq-wine-light:    #b8446a;
    --bq-gold:          #c9a227;
    --bq-gold-soft:     #e8d9a0;

    --bq-sidebar-bg:      #16181d;
    --bq-sidebar-fg:      #9aa1ad;
    --bq-sidebar-fg-hover: #ffffff;
    --bq-sidebar-active:  rgba(139, 30, 63, .9);
    --bq-sidebar-border:  rgba(255, 255, 255, .06);
    --bq-sidebar-width:   264px;
    --bq-sidebar-collapsed: 72px;
    --bq-topbar-height:   62px;

    --bq-page-bg:  #f4f5f7;
    --bq-card-bg:  #ffffff;
    --bq-border:   #e4e6eb;
    --bq-muted:    #6b7280;

    --bq-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --bq-shadow:    0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --bq-shadow-lg: 0 10px 24px rgba(16, 24, 40, .10);

    --bq-radius:    .625rem;
    --bq-radius-sm: .4rem;
}

[data-bs-theme="dark"] {
    --bq-page-bg: #14161a;
    --bq-card-bg: #1c1f26;
    --bq-border:  #2c313a;
    --bq-muted:   #9aa1ad;

    --bq-sidebar-bg: #101216;
    --bq-shadow:     0 1px 3px rgba(0, 0, 0, .5);
    --bq-shadow-lg:  0 10px 24px rgba(0, 0, 0, .55);
}

/* Re-point Bootstrap's primary at the brand colour. */
:root,
[data-bs-theme="dark"] {
    --bs-primary:     var(--bq-wine);
    --bs-primary-rgb: 139, 30, 63;
    --bs-link-color:  var(--bq-wine);
    --bs-link-hover-color: var(--bq-wine-dark);
    --bs-border-radius: var(--bq-radius);
    --bs-body-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bq-page-bg);
    font-size: .9rem;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Buttons / badges tuned to the brand
   ========================================================================== */

.btn-primary {
    --bs-btn-bg: var(--bq-wine);
    --bs-btn-border-color: var(--bq-wine);
    --bs-btn-hover-bg: var(--bq-wine-dark);
    --bs-btn-hover-border-color: var(--bq-wine-dark);
    --bs-btn-active-bg: var(--bq-wine-dark);
    --bs-btn-active-border-color: var(--bq-wine-dark);
    --bs-btn-disabled-bg: var(--bq-wine-light);
    --bs-btn-disabled-border-color: var(--bq-wine-light);
}

.btn-outline-primary {
    --bs-btn-color: var(--bq-wine);
    --bs-btn-border-color: var(--bq-wine);
    --bs-btn-hover-bg: var(--bq-wine);
    --bs-btn-hover-border-color: var(--bq-wine);
    --bs-btn-active-bg: var(--bq-wine-dark);
    --bs-btn-active-border-color: var(--bq-wine-dark);
}

.badge-soft {
    background: color-mix(in srgb, var(--bs-secondary) 12%, transparent);
    color: var(--bs-secondary);
    font-weight: 600;
}

/* ==========================================================================
   App shell
   ========================================================================== */

.bq-shell {
    min-height: 100vh;
}

.bq-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--bq-sidebar-width);
    background: var(--bq-sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .18s ease, transform .18s ease;
    overflow: hidden;
}

.bq-sidebar__brand {
    height: var(--bq-topbar-height);
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 0 1.1rem;
    border-bottom: 1px solid var(--bq-sidebar-border);
    flex-shrink: 0;
    color: #fff;
    text-decoration: none;
}

.bq-sidebar__mark {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    background: linear-gradient(135deg, var(--bq-wine) 0%, var(--bq-wine-light) 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset;
}

.bq-sidebar__title {
    font-weight: 650;
    font-size: .95rem;
    line-height: 1.15;
    white-space: nowrap;
}

.bq-sidebar__title small {
    display: block;
    font-weight: 400;
    font-size: .7rem;
    color: var(--bq-sidebar-fg);
}

.bq-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .75rem .625rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .16) transparent;
}

.bq-sidebar__nav::-webkit-scrollbar { width: 6px; }
.bq-sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .16);
    border-radius: 3px;
}

.bq-nav-heading {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 700;
    color: #5f6773;
    padding: 1rem .75rem .4rem;
    white-space: nowrap;
}

.bq-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .75rem;
    margin-bottom: 1px;
    border-radius: var(--bq-radius-sm);
    color: var(--bq-sidebar-fg);
    text-decoration: none;
    font-size: .855rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background .12s ease, color .12s ease;
}

.bq-nav-link:hover {
    background: rgba(255, 255, 255, .05);
    color: var(--bq-sidebar-fg-hover);
}

.bq-nav-link.active {
    background: var(--bq-sidebar-active);
    color: #fff;
    box-shadow: var(--bq-shadow-sm);
}

.bq-nav-link.active .bq-nav-link__icon { color: var(--bq-gold-soft); }

.bq-nav-link__icon {
    font-size: 1.02rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.bq-nav-link__badge { margin-left: auto; }

/* Collapsed rail */
.bq-shell.is-collapsed .bq-sidebar { width: var(--bq-sidebar-collapsed); }
.bq-shell.is-collapsed .bq-sidebar__title,
.bq-shell.is-collapsed .bq-nav-link__label,
.bq-shell.is-collapsed .bq-nav-link__badge,
.bq-shell.is-collapsed .bq-nav-heading { display: none; }
.bq-shell.is-collapsed .bq-nav-link { justify-content: center; padding-inline: 0; }
.bq-shell.is-collapsed .bq-sidebar__brand { justify-content: center; padding-inline: 0; }
.bq-shell.is-collapsed .bq-main { margin-left: var(--bq-sidebar-collapsed); }

.bq-main {
    margin-left: var(--bq-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .18s ease;
}

/* ==========================================================================
   Topbar
   ========================================================================== */

.bq-topbar {
    height: var(--bq-topbar-height);
    background: var(--bq-card-bg);
    border-bottom: 1px solid var(--bq-border);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.bq-icon-btn {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    border-radius: var(--bq-radius-sm);
    color: var(--bq-muted);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    transition: background .12s ease, color .12s ease;
}

.bq-icon-btn:hover {
    background: color-mix(in srgb, var(--bs-body-color) 7%, transparent);
    color: var(--bs-body-color);
}

.bq-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .78rem;
    font-weight: 650;
    color: #fff;
    background: linear-gradient(135deg, var(--bq-wine) 0%, var(--bq-wine-light) 100%);
    flex-shrink: 0;
}

.bq-topbar__property {
    max-width: 260px;
}

.bq-content {
    flex: 1;
    padding: 1.35rem 1.25rem 2.5rem;
}

/* ==========================================================================
   Page header
   ========================================================================== */

.bq-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.15rem;
}

.bq-page-head h1 {
    font-size: 1.3rem;
    font-weight: 650;
    margin: 0;
    letter-spacing: -.01em;
}

.bq-page-head .bq-page-sub {
    color: var(--bq-muted);
    font-size: .83rem;
    margin-top: .15rem;
}

/* ==========================================================================
   Cards & stats
   ========================================================================== */

.bq-card {
    background: var(--bq-card-bg);
    border: 1px solid var(--bq-border);
    border-radius: var(--bq-radius);
    box-shadow: var(--bq-shadow-sm);
}

.bq-card__head {
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--bq-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.bq-card__title {
    font-size: .92rem;
    font-weight: 650;
    margin: 0;
}

.bq-card__body { padding: 1.1rem; }

.bq-stat {
    background: var(--bq-card-bg);
    border: 1px solid var(--bq-border);
    border-radius: var(--bq-radius);
    padding: 1.05rem 1.15rem;
    box-shadow: var(--bq-shadow-sm);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.bq-stat::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--bq-stat-accent, var(--bq-wine));
}

.bq-stat__label {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 650;
    color: var(--bq-muted);
}

.bq-stat__value {
    font-size: 1.6rem;
    font-weight: 680;
    line-height: 1.15;
    margin-top: .3rem;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.bq-stat__meta {
    font-size: .78rem;
    color: var(--bq-muted);
    margin-top: .3rem;
}

.bq-stat__icon {
    position: absolute;
    right: .9rem;
    top: .9rem;
    font-size: 1.5rem;
    opacity: .13;
}

/* ==========================================================================
   Empty state — used by every not-yet-built module screen
   ========================================================================== */

.bq-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--bq-muted);
}

.bq-empty__icon {
    font-size: 2.6rem;
    opacity: .35;
    margin-bottom: .75rem;
    display: block;
}

.bq-empty h2 {
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--bs-body-color);
    margin-bottom: .4rem;
}

/* ==========================================================================
   Auth screens
   ========================================================================== */

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

.bq-auth__aside {
    position: relative;
    background:
        linear-gradient(150deg, rgba(20, 8, 14, .88) 0%, rgba(109, 22, 47, .92) 55%, rgba(139, 30, 63, .9) 100%),
        radial-gradient(circle at 25% 20%, rgba(201, 162, 39, .35) 0%, transparent 45%),
        #2a0f1b;
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bq-auth__aside h1 {
    font-size: 2rem;
    font-weight: 680;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.bq-auth__aside p { color: rgba(255, 255, 255, .78); }

.bq-auth__points {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: grid;
    gap: .7rem;
}

.bq-auth__points li {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    font-size: .88rem;
    color: rgba(255, 255, 255, .86);
}

.bq-auth__points i { color: var(--bq-gold-soft); margin-top: .12rem; }

.bq-auth__form {
    display: grid;
    place-items: center;
    padding: 2.5rem 1.5rem;
    background: var(--bq-card-bg);
}

.bq-auth__inner {
    width: 100%;
    max-width: 390px;
}

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

/* ==========================================================================
   Tables
   ========================================================================== */

.bq-table {
    --bs-table-bg: transparent;
    margin: 0;
}

.bq-table > thead > tr > th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    color: var(--bq-muted);
    border-bottom: 1px solid var(--bq-border);
    padding: .6rem 1.1rem;
    white-space: nowrap;
}

.bq-table > tbody > tr > td {
    padding: .7rem 1.1rem;
    border-bottom: 1px solid var(--bq-border);
    vertical-align: middle;
}

.bq-table > tbody > tr:last-child > td { border-bottom: 0; }

.bq-num { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 991.98px) {
    .bq-sidebar { transform: translateX(-100%); }
    .bq-shell.is-open .bq-sidebar { transform: translateX(0); box-shadow: var(--bq-shadow-lg); }
    .bq-main { margin-left: 0; }
    .bq-shell.is-collapsed .bq-main { margin-left: 0; }

    .bq-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 1035;
        display: none;
    }
    .bq-shell.is-open .bq-backdrop { display: block; }

    .bq-topbar__property { max-width: 150px; }
}

@media print {
    .bq-sidebar, .bq-topbar { display: none !important; }
    .bq-main { margin-left: 0 !important; }
    .bq-content { padding: 0; }
}
