:root {
    --ink: #14171f;
    --ink-soft: #565c6b;
    --paper: #faf9f7;
    --card: #ffffff;
    --line: #eceae6;
    --brand: #ff3d3d;
    --brand-dark: #e42a3d;
    --brand-light: #fff0ef;
    --brand-grad: linear-gradient(135deg, #ff7a3d, #ff2d55);
    --accent: #0f172a;
    --gold: #ffb020;
    --ok: #1a9c6b;
    --radius: 14px;
    font-size: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
}

h1, h2, h3, h4, .logo, .price-deal { font-family: 'Poppins', sans-serif; }

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

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

/* ---------- Header ---------- */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    color: var(--accent);
}
.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    box-shadow: 0 4px 10px rgba(255, 45, 85, 0.25);
}
.logo-word span { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { display: flex; align-items: center; gap: 20px; font-weight: 500; font-size: 0.95rem; }
.nav-user { color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-primary:disabled { background: #d9d9d9; color: #888; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---------- Flash messages ---------- */
.flash { margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-size: 0.92rem; font-weight: 500; }
.flash-success { background: #e7f8f0; color: var(--ok); }
.flash-error { background: #fdeeee; color: #c0392b; }
.flash-info { background: #eef3fd; color: #2a5cbb; }

/* ---------- Hero ---------- */
.hero {
    padding: 56px 0 36px;
    text-align: center;
}
.hero h1 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}
.hero h1 .accent { color: var(--brand); }
.hero p { color: var(--ink-soft); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* ---------- Deal grid ---------- */
.deal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
    padding: 10px 0 60px;
}

.deal-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s ease, transform .15s ease;
}
.deal-card:hover { box-shadow: 0 12px 28px rgba(20,23,31,0.08); transform: translateY(-2px); }

.deal-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #eee; }
.deal-media img { width: 100%; height: 100%; object-fit: cover; }

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 5px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}
.badge-sold { background: var(--ink); }
.badge-urgent { background: var(--gold); color: #3a2600; }

.countdown-chip {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15,23,42,0.82);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.deal-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.deal-merchant { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.deal-title { font-size: 1.08rem; font-weight: 700; margin: 0; line-height: 1.3; }
.deal-location { font-size: 0.85rem; color: var(--ink-soft); }

.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-deal { font-size: 1.4rem; font-weight: 800; color: var(--brand); }
.price-original { font-size: 0.9rem; color: #9aa0ab; text-decoration: line-through; }
.price-discount { font-size: 0.78rem; color: var(--ok); font-weight: 700; }

.spots-wrap { margin-top: 2px; }
.spots-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 5px; }
.spots-bar { height: 6px; border-radius: 4px; background: #ecece9; overflow: hidden; }
.spots-fill { height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s ease; }
.spots-fill.low { background: #c0392b; }

.deal-footer { margin-top: auto; padding-top: 6px; }

/* ---------- Deal detail page ---------- */
.deal-detail { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; padding: 34px 0 60px; }
@media (max-width: 860px) { .deal-detail { grid-template-columns: 1fr; } }
.deal-detail-media { border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 4/3; background: #eee; }
.deal-detail-media img { width: 100%; height: 100%; object-fit: cover; }

.booking-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    align-self: start;
    position: sticky;
    top: 90px;
}
.booking-card h1 { font-size: 1.5rem; margin: 0 0 6px; }
.booking-timer {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}
.timer-box {
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 10px 0;
    flex: 1;
    text-align: center;
}
.timer-box .num { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer-box .lbl { font-size: 0.65rem; text-transform: uppercase; opacity: 0.7; letter-spacing: 0.05em; }

.status-pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; margin-bottom: 10px; }
.status-live { background: #e7f8f0; color: var(--ok); }
.status-sold_out, .status-expired, .status-cancelled { background: #f1f1ef; color: #777; }
.status-upcoming { background: #eef3fd; color: #2a5cbb; }

.deal-description { line-height: 1.7; color: #323642; }
.deal-description h3 { margin-top: 28px; }

.booking-confirm { text-align: center; padding: 40px 0; }
.booking-code { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.04em; color: var(--brand); background: var(--brand-light); padding: 12px 20px; border-radius: 10px; display: inline-block; margin: 14px 0; }

/* ---------- Forms ---------- */
.form-card { max-width: 420px; margin: 50px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.form-card h1 { font-size: 1.5rem; margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.form-footer-link { text-align: center; margin-top: 16px; font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Bookings table ---------- */
.bookings-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bookings-table th, .bookings-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.bookings-table th { background: #f5f4f1; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
.bookings-table tr:last-child td { border-bottom: none; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--ink-soft); }

/* ---------- Admin ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--accent); color: #fff; padding: 24px 18px; flex-shrink: 0; }
.admin-sidebar .logo { color: #fff; display: block; margin-bottom: 30px; }
.admin-sidebar a { display: block; padding: 10px 12px; border-radius: 8px; color: #cbd3e1; font-weight: 500; font-size: 0.92rem; margin-bottom: 4px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,0.08); color: #fff; }
.admin-main { flex: 1; padding: 32px 36px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.stat-card .num { font-size: 1.6rem; font-weight: 800; }
.stat-card .lbl { font-size: 0.82rem; color: var(--ink-soft); }
.admin-table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.88rem; text-align: left; }
.admin-table th { background: #f5f4f1; font-size: 0.75rem; text-transform: uppercase; color: var(--ink-soft); }
.pill-status { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .admin-shell { flex-direction: column; } .admin-sidebar { width: 100%; } }

/* ---------- Footer ---------- */
.site-footer { padding: 26px 0; text-align: center; color: var(--ink-soft); font-size: 0.85rem; border-top: 1px solid var(--line); margin-top: 20px; }
