:root {
    --primary-color: #9f3b24;
    --primary-dark: #6f2414;
    --secondary-color: #fff4ea;
    --accent-color: #f59e0b;
    --text-color: #342117;
    --muted-text: #7b5e4b;
    --light-gray: #fffaf6;
    --border-radius: 0.75rem;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

body {
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    transition: background-color 1s ease, color 1s ease;
}

.auth-bg {
    background:
        radial-gradient(circle at 18% 24%, rgba(245, 158, 11, 0.22), transparent 18%),
        radial-gradient(circle at 82% 18%, rgba(239, 68, 68, 0.18), transparent 22%),
        radial-gradient(circle at 70% 76%, rgba(251, 191, 36, 0.16), transparent 20%),
        linear-gradient(135deg, #3b120d 0%, #6f2414 45%, #9f3b24 72%, #d97706 100%);
    min-height: 100vh;
}
.auth-overlay {
    width: 100%;
    background: transparent;
}
.auth-overlay h1 { color: #ffffff !important; }
.auth-overlay p { color: #ffffff !important; }
/* .auth-overlay .form-label { color: #1f2933; } */
.auth-overlay h2 { color: #1f2933;}
.auth-hero .auth-logo { height: 56px; }
/* .auth-card input.form-control-lg { box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); } */
/* .auth-card .input-group-text { border-radius: 12px 0 0 12px; } */
/* .auth-card .form-control { border-radius: 0 12px 12px 0; } */
/* .auth-card .form-control:focus { border-color: var(--accent-color); box-shadow: 0 0 0 0.15rem rgba(247, 201, 72, 0.35); } */

/* Adjust main container for logged-in users to have a backdrop effect */
.container, .container-fluid {
    margin-top: 0;
    margin-bottom: 1.5rem;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}


.navbar-glass {
    background: linear-gradient(90deg, rgba(111,36,20,0.96), rgba(159,59,36,0.92), rgba(245,158,11,0.9));
    border-radius: var(--border-radius);
    margin-top: 1rem;
    padding: 0.4rem 1rem;
}
.navbar-glass .navbar-brand { color: #fff; }
.navbar-glass .nav-link { color: rgba(255,255,255,0.85); font-weight: 600; }
.navbar-glass .nav-link:hover, .navbar-glass .nav-link.active { color: #fff; }
.navbar-glass .navbar-toggler-icon { filter: invert(1); }
.navbar-glass .btn-outline-light { border-color: rgba(255,255,255,0.7); color: #fff; }
.navbar-glass .btn-outline-light:hover { background: #fff; color: var(--primary-color); }
.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}
.brand-logo {
    height: 32px;
    width: auto;
}
.sidebar .brand-logo { height: 46px; }
.avatar {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
}

/* Sidebar layout */
.app-shell { min-height: 100vh; }
.sidebar {
    width: 282px;
    flex: 0 0 282px;
    max-width: 282px;
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.24), transparent 30%),
        radial-gradient(circle at bottom left, rgba(239, 68, 68, 0.18), transparent 28%),
        linear-gradient(180deg, #4a160f 0%, #6f2414 50%, #2f120d 100%);
    color: #fff;
    padding: 10px 10px 8px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow: hidden;
    border-top-right-radius: 22px;
    border-bottom-right-radius: 22px;
    box-shadow: 16px 0 40px rgba(71, 22, 13, 0.22);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Firefox scrollbar */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.05);
}

/* Sticky header, scrolling menu */
.sidebar-panel {
    min-height: calc(100vh - 20px);
    height: calc(100vh - 20px);
    padding: 8px 8px 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.10);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    color: #fff;
}

.sidebar-header .btn-outline-light {
    border-color: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.92);
    background: rgba(255,255,255,0.05);
}

.sidebar-header .btn-outline-light:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.24);
    color: #fff;
}

.sidebar-brand-logo-wrap {
    width: 100%;
    max-width: 62px;
    min-height: 72px;
    padding: 12px 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 10px 24px rgba(0,0,0,0.14);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-brand-logo {
    max-width: 140px;
    max-height: 48px;
    width: 100%;
    height: auto;
}

.sidebar-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.sidebar-cta,
.sidebar-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 11px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.84rem;
    letter-spacing: 0.01em;
}

.sidebar-cta {
    background: linear-gradient(135deg, #f59e0b, #fcd34d);
    color: #4a160f;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.sidebar-ghost {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.92);
    border: 1px solid rgba(255,255,255,0.08);
}

.sidebar-menu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.sidebar-menu ul { margin: 0; padding: 0; }
.sidebar-menu li { margin-bottom: 4px; list-style: none; }
.sidebar-section-label {
    margin: 12px 0 6px;
    padding: 0 12px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 214, 102, 0.84);
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.92);
    padding: 9px 12px;
    border-radius: 13px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    line-height: 1.2;
    transition: all 0.2s ease;
}
.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 214, 102, 0.94);
}
.sidebar-menu a:hover, .sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
    color: #fff;
    transform: translateX(2px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(245,158,11,0.26), rgba(255,255,255,0.12));
}
.sidebar-menu a.active i,
.sidebar-menu a:hover i {
    color: #ffd166;
}
.sidebar-menu a span:last-child {
    flex: 1;
}
.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ff6b6b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}
.sidebar-footer-link {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.10);
}
.sidebar-menu a.muted {
    color: rgba(255,255,255,0.76);
    font-weight: 500;
}
.content-area { 
    padding-left: 0; 
    min-width: 0; 
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        z-index: 1040;
        transform: translateX(-110%);
        transition: transform 0.25s ease-in-out;
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
        width: 282px;
        flex-basis: 282px;
        max-width: 282px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-panel {
        min-height: calc(100vh - 20px);
        height: calc(100vh - 20px);
    }
    .sidebar-menu {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding-right: 0.35rem;
    }
    .content-area { padding-left: 0; }
    .container, .container-fluid { margin-top: 1rem; }
    #sidebarToggleTop { box-shadow: 0 6px 14px rgba(0,0,0,0.08); }
}
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(2px);
    z-index: 1030;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
body.mobile-menu-open .sidebar-overlay {
    opacity: 1;
    pointer-events: all;
}
body.mobile-menu-open .content-area {
    filter: blur(3px);
    transition: filter 0.2s ease;
}

/* Invoice page tweaks */
#product_invoice_table th, #product_invoice_table td { vertical-align: middle; }
#product_invoice_table thead { position: sticky; top: 0; z-index: 2; }
.card-header h2 { font-weight: 700; }
.card-header .btn-light { border: 1px solid #e5e7eb; }
.alert-light { background: #fdfaf4; }

.auth-card {
    background-color: transparent;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: none;
    padding: 0;
    margin-top: 0;
}

.auth-card h2 {
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgba(245, 158, 11, 0.22);
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-primary-custom:hover {
    background-color: #7c2d12;
    border-color: #7c2d12;
    color: #fff;
}

.btn-secondary-custom {
    background-color: var(--secondary-color);
    border-color: #ced4da;
    color: var(--text-color);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-secondary-custom:hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

.invalid-feedback {
    font-size: 0.9rem;
}

.card-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--accent-color);
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

@media print {
    .no-print, .no-print * {
        display: none !important;
    }
    .invoice-container {
        width: 100%;
        margin: 0;
        box-shadow: none;
        border: none;
    }
    body {
        background-image: none;
        background-color: #fff;
    }
    .container {
        background-color: transparent;
        backdrop-filter: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
}

/* Dark mode removed */

/* Dashboard refreshed UI */
.hero-card {
    background: linear-gradient(135deg, rgba(159,59,36,0.12), rgba(245,158,11,0.08));
    border: none;
    box-shadow: var(--shadow);
}
.pill-soft {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.pill-green { background: rgba(159,59,36,0.14); color: #7c2d12; }
.pill-muted { background: rgba(0,0,0,0.05); color: #4b5563; }
.kpi-card {
    min-width: 180px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.kpi-card .kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #6b7280; margin-bottom: 4px; }
.kpi-card .kpi-value { font-size: 20px; font-weight: 700; color: #111827; }
.kpi-card .kpi-subtext { font-size: 12px; margin-top: 2px; }
.alert-card { background: #fff7ed; }
.alert-card .kpi-value { color: #d97706; }

/* Reports styling */
.report-hero {
    background: linear-gradient(120deg, rgba(159,59,36,0.16), rgba(245,158,11,0.1));
    border: none;
    box-shadow: var(--shadow);
}
.summary-chip {
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.03);
}
.summary-chip .chip-label { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; }
.summary-chip .chip-value { font-size: 22px; font-weight: 700; color: #111827; }
.summary-chip .chip-sub { font-size: 12px; color: #6b7280; }

.chart-card {
    border: none;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0,0,0,0.06);
    border-radius: 18px;
}
.table-card {
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}
.compact-table th, .compact-table td {
    padding-top: 10px;
    padding-bottom: 10px;
}
.table-card .badge { border-radius: 10px; }
.pill-soft.pill-muted { background: rgba(0,0,0,0.05); color: #374151; }
.table-hover tbody tr:hover { background-color: rgba(0,0,0,0.025); }

/* Gallery */
.photo-card {
    border-radius: 16px;
    border: 1px solid #eef0f2;
    background: #fff;
    overflow: hidden;
}
.photo-wrapper {
    position: relative;
    background: #000;
}
.photo-wrapper.js-open-photo { cursor: pointer; }
.photo-wrapper img {
    object-fit: cover;
    width: 100%;
    max-height: 320px;
}
.photo-logo {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.92);
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.photo-logo img { height: 36px; width: auto; }
.photo-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px;
    color: #fff;
    background: linear-gradient(180deg, rgba(0,0,0,0) 10%, rgba(0,0,0,0.68) 90%);
}
.date-chip {
    background: rgba(0,0,0,0.65);
    color: #fff;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.2;
}
.photo-meta { padding: 14px; }
.photo-actions .btn { min-width: 72px; }
.mini-map {
    height: 180px;
    width: 100%;
    background: #f5f5f5;
    border: 1px solid #eef0f2;
}
.capture-map {
    height: 200px;
    width: 100%;
    background: #f5f5f5;
    border: 1px dashed #dfe3e8;
}
@media (max-width: 576px){
    .photo-wrapper img { max-height: 240px; }
    .mini-map { height: 160px; }
}
