:root {
    --sidebar-width: 250px;
    --brand: #1f6f43;
    --brand-dark: #164f30;
    --sidebar-bg: #14301f;
    --sidebar-bg-2: #1c4229;
}

body {
    background: #f4f6f5;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Auth pages (no sidebar) ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    padding: 1rem;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.auth-card .brand {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-card .brand i {
    font-size: 2.5rem;
    color: var(--brand);
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: #cfe8db;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: transform .2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1.1rem 1.25rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { color: #ffd166; font-size: 1.4rem; }

.sidebar-scroll {
    overflow-y: auto;
    flex: 1;
    padding: .75rem 0 1.5rem;
}

.nav-group { margin-bottom: .5rem; }
.nav-group-label {
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .06em;
    color: #7fae90;
    padding: .75rem 1.25rem .25rem;
}
.sidebar .nav-link {
    color: #cfe8db;
    padding: .55rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .92rem;
    border-left: 3px solid transparent;
}
.sidebar .nav-link i { font-size: 1.05rem; width: 1.1rem; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active {
    background: var(--sidebar-bg-2);
    color: #fff;
    border-left-color: #ffd166;
    font-weight: 600;
}

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e3e7e5;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar-title { font-size: 1.25rem; font-weight: 600; margin: 0; flex: 1; color: #1c2b22; }
.topbar-user .badge { margin-left: .35rem; }

.content { padding: 1.5rem; flex: 1; }

.card { border: 1px solid #e3e7e5; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card-header { background: #fff; font-weight: 600; }

.stat-card { border-radius: 12px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { font-size: .8rem; color: #6b7a70; text-transform: uppercase; letter-spacing: .04em; }
.stat-card i { font-size: 1.6rem; opacity: .35; }

table.table thead th {
    background: #eef3f0;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #45564c;
    white-space: nowrap;
}

.badge-boarder { background: #1f6f43; }
.badge-day-scholar { background: #3a6ea5; }

/* ---------- Recipe ingredient inline quantity editing ---------- */
.qty-editable {
    cursor: pointer;
    border-bottom: 1px dashed #1f6f43;
    font-weight: 600;
    padding: 0 1px;
}
.qty-editable:hover, .qty-editable:focus { background: #eaf3ee; outline: none; }
.qty-edit-input {
    width: 4.5em;
    font-size: .8rem;
    padding: 0 .25rem;
    height: 1.3rem;
    display: inline-block;
}
.ingredient-badge.qty-error { background: #f8d7da !important; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); }
    .app-main { margin-left: 0; }
}

/* ---------- Print layout (report pages use Bootstrap's d-print-* utilities
   for chrome such as the sidebar/topbar/buttons; this covers layout that
   those utilities alone can't fix, like our fixed-sidebar margin) ---------- */
@media print {
    body { background: #fff; }
    .app-main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .card { border: 1px solid #ccc !important; box-shadow: none !important; break-inside: avoid; }
    .table-responsive { overflow: visible !important; }
}
