/* ============================================================
   STYLE.CSS — RestroBill design system
   Mobile: bottom nav. Desktop (900px+): left sidebar.
   ============================================================ */

:root {
    --primary: #E8A33D;
    --primary-dark: #C6811F;
    --primary-light: rgba(232,163,61,0.12);
    --success: #4B7A54;
    --success-bg: #1C2A20;
    --danger: #B44B3C;
    --danger-bg: #2E1E1B;
    --warning: #C6811F;
    --warning-bg: #2E2618;
    --info: #3F6A8C;
    --info-bg: #1B2530;

    --bg: #221D1A;
    --surface: #2E2622;
    --surface-2: #362D28;
    --text: #F7F3EC;
    --text-muted: #C9C1B4;
    --border: rgba(247,243,236,0.12);
    --radius: 14px;
    --radius-sm: 10px;

    --sidebar-w: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: 78px;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--border);
    margin-bottom: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    min-height: 48px;
    transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #221D1A; }
.btn-primary:hover { background: #F0B255; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 8px 14px; font-size: 14px; min-height: 36px; width: auto; }

.input-group { margin-bottom: 14px; }
.input-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
input, select, textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
}
input::placeholder { color: #8A8071; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: var(--success-bg); color: #7FBF8A; }
.badge-warning { background: var(--warning-bg); color: var(--primary); }
.badge-danger { background: var(--danger-bg); color: #E0897B; }
.badge-info { background: var(--info-bg); color: #7FAAD1; }

.error-msg { color: #E0897B; font-size: 13px; margin-top: 6px; }

.logo-text { font-size: 20px; font-weight: 800; color: var(--primary); font-family: 'Space Grotesk', sans-serif; }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 8px;
    min-width: 56px;
    border-radius: 8px;
}
.bottom-nav a.active { color: var(--primary); font-weight: 600; }
.bottom-nav .icon { font-size: 20px; }

/* ---------- Top header ---------- */
.top-header {
    background: var(--surface);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ============================================================
   DESKTOP (900px+): left sidebar replaces bottom nav
   ============================================================ */
@media (min-width: 900px) {
    body {
        padding-bottom: 0;
        padding-left: var(--sidebar-w);
    }

    .container { max-width: 1000px; padding: 32px 40px 48px; }

    .top-header { padding: 18px 40px; }

    .bottom-nav {
        position: fixed;
        top: 0; left: 0; bottom: 0; right: auto;
        width: var(--sidebar-w);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        border-top: none;
        border-right: 1px solid var(--border);
        padding: 24px 12px;
        gap: 4px;
    }
    .bottom-nav::before {
        content: "RestroBill";
        display: block;
        font-family: 'Space Grotesk', sans-serif;
        font-weight: 800;
        font-size: 18px;
        color: var(--primary);
        padding: 0 12px 24px;
    }
    .bottom-nav a {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        font-size: 14px;
        padding: 11px 14px;
        min-width: 0;
        width: 100%;
    }
    .bottom-nav a.active { background: var(--primary-light); }
    .bottom-nav .icon { font-size: 18px; }
}

.stat-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) {
    .stat-grid-2 { grid-template-columns: repeat(4, 1fr); }
    .card-wide-desktop { grid-column: span 2; }
}
