/* ==========================================================
   Giborim Ventures - brand theme on top of Bootstrap 5
   Navy  #0B1F3A   Gold #B08D3C   Deep gold #7A5F1E
   ========================================================== */
:root {
    --gb-navy: #0B1F3A;
    --gb-navy-2: #132c4f;
    --gb-navy-3: #1c3a63;
    --gb-gold: #B08D3C;
    --gb-gold-dark: #7A5F1E;
    --gb-gold-soft: #f6f0e1;
    --gb-bg: #f4f6f9;
    --gb-sidebar-w: 255px;

    --bs-primary: #0B1F3A;
    --bs-primary-rgb: 11, 31, 58;
    --bs-link-color: #0B1F3A;
    --bs-link-color-rgb: 11, 31, 58;
    --bs-link-hover-color: #7A5F1E;
    --bs-link-hover-color-rgb: 122, 95, 30;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: #1f2937;
}

body { background: var(--gb-bg); font-size: .925rem; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.sidebar a:hover, .btn:hover, .dropdown-item:hover, .list-group-item-action:hover { text-decoration: none; }
h1, h2, h3, h4, h5, .brand-font, .page-title { font-family: "Montserrat", sans-serif; }

/* ---------- Buttons ---------- */
.btn-primary { --bs-btn-bg: var(--gb-navy); --bs-btn-border-color: var(--gb-navy); --bs-btn-hover-bg: var(--gb-navy-3); --bs-btn-hover-border-color: var(--gb-navy-3); --bs-btn-active-bg: var(--gb-navy-2); --bs-btn-disabled-bg: var(--gb-navy); }
.btn-gold { --bs-btn-color: #fff; --bs-btn-bg: var(--gb-gold); --bs-btn-border-color: var(--gb-gold); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--gb-gold-dark); --bs-btn-hover-border-color: var(--gb-gold-dark); --bs-btn-active-bg: var(--gb-gold-dark); --bs-btn-active-color: #fff; --bs-btn-disabled-bg: var(--gb-gold); --bs-btn-disabled-color: #fff; }
.btn-outline-primary { --bs-btn-color: var(--gb-navy); --bs-btn-border-color: var(--gb-navy); --bs-btn-hover-bg: var(--gb-navy); --bs-btn-hover-border-color: var(--gb-navy); --bs-btn-active-bg: var(--gb-navy); }
.btn-outline-gold { --bs-btn-color: var(--gb-gold-dark); --bs-btn-border-color: var(--gb-gold); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--gb-gold); --bs-btn-hover-border-color: var(--gb-gold); }
.text-gold { color: var(--gb-gold) !important; }
.text-navy { color: var(--gb-navy) !important; }
.bg-navy { background: var(--gb-navy) !important; }
.bg-gold { background: var(--gb-gold) !important; }
.bg-gold-soft { background: var(--gb-gold-soft) !important; }
.form-control:focus, .form-select:focus { border-color: var(--gb-gold); box-shadow: 0 0 0 .2rem rgba(176, 141, 60, .2); }
.form-check-input:checked { background-color: var(--gb-navy); border-color: var(--gb-navy); }
.form-label { font-weight: 500; font-size: .85rem; color: #374151; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-brand {
    flex: 1; background: var(--gb-navy); color: #fff; display: none; position: relative; overflow: hidden;
    padding: 3rem; flex-direction: column; justify-content: space-between;
}
.auth-brand::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 400px; height: 400px; border: 2px solid rgba(176, 141, 60, .55); box-shadow: 0 0 0 40px rgba(176, 141, 60, .07); transform: rotate(45deg); }
.auth-brand h2 { font-weight: 700; font-size: 2rem; line-height: 1.25; }
.auth-brand .gold-bar { width: 60px; height: 4px; background: var(--gb-gold); margin: 1.25rem 0; }
.auth-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: #fff; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .logo { max-width: 230px; }
@media (min-width: 992px) { .auth-brand { display: flex; } }

/* ---------- Sidebar layout ---------- */
.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--gb-sidebar-w); background: var(--gb-navy);
    color: #c9d3e3; overflow-y: auto; z-index: 1040; transition: transform .2s ease;
}
.sidebar .brand { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .08); display: block; }
.sidebar .brand img { max-width: 100%; height: 34px; object-fit: contain; object-position: left; }
.sidebar .tenant-name { padding: .9rem 1.25rem .2rem; color: #fff; font-weight: 600; font-size: .85rem; }
.sidebar .tenant-sub { padding: 0 1.25rem .6rem; color: var(--gb-gold); font-size: .75rem; }
.sidebar .nav-section { padding: 1rem 1.25rem .35rem; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; color: #7f8ea8; font-weight: 600; }
.sidebar .nav-link { color: #c9d3e3; padding: .55rem 1.25rem; display: flex; align-items: center; gap: .7rem; border-left: 3px solid transparent; font-size: .88rem; }
.sidebar .nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.sidebar .nav-link.active { color: #fff; background: rgba(176, 141, 60, .16); border-left-color: var(--gb-gold); }
.sidebar .nav-link.active i { color: var(--gb-gold); }

.main { margin-left: var(--gb-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: .65rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1030; }
.topbar .page-title { font-size: 1.1rem; font-weight: 700; color: var(--gb-navy); margin: 0; }
.content { padding: 1.5rem; flex: 1; }
.footer { padding: .9rem 1.5rem; font-size: .78rem; color: #8a94a6; border-top: 1px solid #e5e7eb; background: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gb-gold); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 1035; }
    .main { margin-left: 0; }
    .content { padding: 1rem; }
    .stat-card .icon { width: 34px; height: 34px; font-size: 1rem; right: .75rem; top: .75rem; }
    .stat-card .label { padding-right: 38px; font-size: .68rem; }
    .stat-card .value { font-size: 1.15rem; }
}
.chart-box { position: relative; height: 280px; }

/* ---------- Cards / stats ---------- */
.card { border: 1px solid #e8ebf0; border-radius: .6rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; color: var(--gb-navy); padding: .85rem 1.1rem; }
.stat-card { padding: 1.1rem 1.2rem; position: relative; overflow: hidden; }
.stat-card .label { padding-right: 48px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; font-weight: 600; }
.stat-card .value { font-family: "Montserrat", sans-serif; font-size: 1.45rem; font-weight: 700; color: var(--gb-navy); margin-top: .25rem; }
.stat-card .icon { position: absolute; right: 1rem; top: 1rem; width: 42px; height: 42px; border-radius: .5rem; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; background: var(--gb-gold-soft); color: var(--gb-gold-dark); }
.stat-card.navy { background: var(--gb-navy); border-color: var(--gb-navy); }
.stat-card.navy .label { color: #aab6c9; }
.stat-card.navy .value { color: #fff; }
.stat-card.navy .icon { background: rgba(176, 141, 60, .25); color: var(--gb-gold); }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #f8f6f0; margin-bottom: 0; }
.table thead th { background: #f8f9fb; color: #4b5563; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; }
.table tfoot td { font-weight: 700; background: var(--gb-gold-soft); }

.badge-module { background: var(--gb-gold-soft); color: var(--gb-gold-dark); border: 1px solid #e7d9b4; font-weight: 600; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #8a94a6; }
.empty-state i { font-size: 2.5rem; color: #cfd6e1; }

/* ---------- POS ---------- */
.pos-results { max-height: 430px; overflow-y: auto; }
.pos-product { cursor: pointer; border: 1px solid #e8ebf0; border-radius: .5rem; padding: .6rem .75rem; background: #fff; transition: border-color .15s; }
.pos-product:hover { border-color: var(--gb-gold); background: #fffdf7; }
.pos-product.out { opacity: .5; cursor: not-allowed; }
.pos-total { font-family: "Montserrat", sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--gb-navy); }
.cart-table input { max-width: 90px; }

/* ---------- Receipt ---------- */
.receipt { max-width: 380px; margin: 0 auto; background: #fff; padding: 1.25rem; font-size: .85rem; border: 1px dashed #cfd6e1; }
.receipt table { width: 100%; }
@media print {
    .sidebar, .topbar, .footer, .no-print, .alert { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    body { background: #fff; }
    .receipt { border: 0; }
    .card { border: 0; box-shadow: none; }
}
