/* ---------- Global ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --red: #cc0000;
    --red-dark: #990000;
    --red-light: #ff4444;
    --white: #ffffff;
    --bg: #f5f5f5;
    --surface: #ffffff;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --subtle: #666666;
    --radius: 10px;
    --shadow: 0 4px 18px rgba(204,0,0,0.10);
    /* aliases used in templates */
    --accent: #cc0000;
    --green-dark: #228b22; /* Fixed: was incorrectly set to red (#990000) - should be green */
    --danger: #cc0000;
}
body { font-family: "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; position: relative; display: flex; flex-direction: column; }
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('/bookings/logo.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 500px;
    opacity: 0.10;
    pointer-events: none;
    z-index: 0;
}
body > * { position: relative; z-index: 1; }
a { color: inherit; }

/* ---------- Navbar ---------- */
.navbar { background: var(--red); color: #fff; padding: 0.65rem 1rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; box-shadow: 0 3px 12px rgba(0,0,0,0.20); }
.nav-brand { color: #fff; font-size: 1.1rem; text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.nav-links { display: flex; gap: 0.45rem; align-items: center; }
.nav-links a { color: #fff; text-decoration: none; border-radius: 6px; padding: 0.35rem 0.65rem; font-size: 0.88rem; transition: background 0.2s; }
.nav-links a:hover { background: rgba(255,255,255,0.22); }
.btn-logout { background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.5); padding: 0.28rem 0.55rem; border-radius: 5px; cursor: pointer; font-size: 0.88rem; transition: background 0.2s; }
.btn-logout:hover { background: rgba(255,255,255,0.30); }

/* ---------- Layout ---------- */
.page-container { max-width: 1050px; width: 100%; margin: 1.5rem auto; padding: 0 1rem; flex: 1; }
.card { background: var(--surface); border-radius: var(--radius); padding: 1.2rem; border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 1rem; }
.form-wrap { max-width: 560px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 0.5rem; flex-wrap: wrap; }
.page-header h2 { font-size: 1.6rem; color: var(--red-dark); }
.login-wrap { max-width: 400px; margin: 3rem auto; }
.login-wrap h2 { color: var(--red-dark); margin-bottom: 0.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.mt-1 { margin-top: 0.4rem; }
.mt-2 { margin-top: 0.8rem; }
.mt-3 { margin-top: 1.4rem; }
.mb-1 { margin-bottom: 0.6rem; }
.text-muted { color: var(--subtle); }

/* ---------- Buttons ---------- */
.btn { background: var(--red); color: #fff; border: 0; border-radius: 8px; padding: 0.45rem 0.9rem; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.08s; font-size: 0.9rem; }
.btn:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.82rem; }
.btn-outline { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn-outline:hover { background: #ffe5e5; }
.btn-accent { background: var(--red); color: #fff; }
.btn-accent:hover { background: var(--red-dark); }
.btn-danger { background: var(--red-dark); color: #fff; }
.btn-danger:hover { background: #660000; }

/* ---------- Alerts ---------- */
.alert { border-radius: 8px; padding: 0.7rem 0.9rem; border: 1px solid var(--border); margin-bottom: 0.9rem; font-weight: 500; }
.alert-success { background: #fff0f0; color: var(--red-dark); border-color: #ffcccc; }
.alert-error { background: #ffe5e5; color: var(--red-dark); border-color: #ffaaaa; }

/* ---------- Table ---------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 9px; border: 1px solid #e8e8e8; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; background: #fff; }
thead th { background: var(--red); color: #fff; font-weight: 600; text-align: left; padding: 0.65rem 0.6rem; }
tbody td { border-top: 1px solid #f0f0f0; padding: 0.6rem; color: #333; }
tbody tr:hover { background: #fff5f5; }

/* ---------- Forms ---------- */
form { margin-top: 0.5rem; }
input, select, textarea { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid #ddd; border-radius: 6px; background: #fff; color: #2b2b2b; margin-bottom: 0.7rem; font-family: inherit; font-size: 0.95rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(204,0,0,0.12); }
label { display: block; margin-bottom: 0.25rem; color: #3a3a3a; font-weight: 600; }
.form-group { margin-bottom: 0.8rem; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-ok { background: #ffe5e5; color: var(--red-dark); }
.badge-low { background: #fff3e0; color: #b45309; }
.badge-out { background: #f0f0f0; color: #555; }

/* ---------- Stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.stat-card { background: #fff; border: 1px solid #e8e8e8; border-top: 3px solid var(--red); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--red-dark); }
.stat-label { font-size: 0.85rem; color: var(--subtle); margin-top: 0.2rem; }

/* ---------- Product Grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 0.9rem; margin-bottom: 1rem; }
.product-card { background: #fff; border: 1.5px solid #e8e8e8; border-radius: var(--radius); padding: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 0.4rem; transition: border-color 0.2s, transform 0.1s; }
.product-card:hover { border-color: var(--red); transform: translateY(-2px); }
.product-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.product-price { font-size: 1.1rem; font-weight: 700; color: var(--red); }
.product-stock { font-size: 0.85rem; color: var(--subtle); }
.card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.4rem; }

/* ---------- Bookings ---------- */
.booking-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.8rem 0; border-bottom: 1px solid #f0f0f0; }
.booking-item:last-child { border-bottom: none; }

/* ---------- Home ---------- */
.home-banner { background: #fff; border: 1px solid #e8e8e8; border-top: 4px solid var(--red); border-radius: 10px; padding: 1.1rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.home-banner h1 { color: var(--red-dark); margin-bottom: 0.3rem; }
.action-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 0.8rem; }
.action-card { background: #fff; border: 1.5px solid #e8e8e8; border-radius: 10px; text-decoration: none; color: #222; padding: 1rem; display: flex; flex-direction: column; gap: 0.2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: border-color 0.2s, transform 0.1s, box-shadow 0.2s; }
.action-card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(204,0,0,0.12); }
.action-icon { font-size: 1.3rem; }
.action-label { font-weight: 700; color: var(--red-dark); }
.action-desc { color: var(--subtle); font-size: 0.9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) { .page-container { margin-top: 0.5rem; } .navbar { padding: 0.55rem 0.85rem; } .nav-links { flex-wrap: wrap; } }
