body {
    background-color: #f4f5f7;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ===== Sidebar layout (admin/staff/customer logged-in area) ===== */
.app-topbar {
    background-color: #1e2a38;
}

.app-sidebar {
    width: 240px;
    --bs-offcanvas-bg: #1e2a38;
    --bs-offcanvas-color: #fff;
    background-color: #1e2a38 !important;
    color: #fff !important;
    display: flex;
    flex-direction: column;
}

.app-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    padding: 0;
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 0.65rem 1.25rem;
    font-size: 0.93rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i { width: 1.1rem; text-align: center; }

.sidebar-nav .nav-link:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.06);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255,255,255,0.08);
    border-left-color: #d35400;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex: 0 0 auto;
}

.app-main { min-height: 100vh; }

@media (min-width: 768px) {
    .app-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1030;
        visibility: visible !important;
        transform: none !important;
    }
    .app-main { margin-left: 240px; }
}

.app-footer { margin-left: 0; }
@media (min-width: 768px) {
    .app-footer { margin-left: 240px; }
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2a38 0%, #3a3f47 100%);
}

.auth-card {
    max-width: 420px;
    width: 100%;
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.auth-card .card-header {
    background-color: #d35400;
    color: #fff;
    border-radius: 10px 10px 0 0 !important;
    text-align: center;
    font-weight: 600;
}

.stat-card {
    border: none;
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .card-body i {
    font-size: 2rem;
    opacity: 0.6;
}

.bg-brand-1 { background-color: #d35400; }
.bg-brand-2 { background-color: #2c3e50; }
.bg-brand-3 { background-color: #27ae60; }
.bg-brand-4 { background-color: #2980b9; }

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table thead {
    background-color: #1e2a38;
    color: #fff;
}

/* ===== Mobile responsiveness ===== */
@media (max-width: 767.98px) {
    .container-fluid.py-4.px-4 {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }

    h3 {
        font-size: 1.25rem;
    }

    .stat-card h3 {
        font-size: 1.4rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Stack tables into cards on small screens instead of horizontal scroll */
    table.table-stack thead {
        display: none;
    }
    table.table-stack, table.table-stack tbody, table.table-stack tr, table.table-stack td {
        display: block;
        width: 100%;
    }
    table.table-stack tr {
        margin-bottom: .85rem;
        border: 1px solid #e3e3e3;
        border-radius: 10px;
        padding: .5rem .75rem;
        background: #fff;
    }
    table.table-stack td {
        text-align: right;
        padding: .4rem 0;
        border: none !important;
        position: relative;
        padding-left: 46%;
        white-space: normal;
    }
    table.table-stack td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: .4rem;
        width: 42%;
        text-align: left;
        font-weight: 600;
        color: #6c757d;
        font-size: .85rem;
    }
    table.table-stack td:empty::before {
        content: none;
    }

    .btn, .form-control, .form-select {
        font-size: .95rem;
    }
}

/* ===== Clean, consistent image framing for gallery / preview photos =====
   Applied directly on <img class="img-frame">. Fixed box + object-fit:
   contain so the whole photo is visible (never cropped), with a neutral
   background filling any letterboxed space. */
.img-frame {
    width: 100%;
    height: 200px;
    background-color: #f4f5f7;
    border: 1px solid #e6e6e6;
    object-fit: contain;
    display: block;
}
.img-frame.card-img-top {
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}
.img-frame-sm {
    height: 150px;
    border-radius: 8px;
}

@media print {
    .app-sidebar, .app-topbar, .no-print, footer {
        display: none !important;
    }
    .receipt-box {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}
