/* ╔═══════════════════════════════════════════════════╗
   ║   POS · Cashier System — Editorial Bold Identity ║
   ╚═══════════════════════════════════════════════════╝ */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; }

:root {
    --cream:#FFF8F0; --cream-deep:#FAEFE0; --bg-soft:#FAF4EC;
    --ink:#0A0A0A; --ink-soft:#2A2A2A; --text:#1A1A1A; --text-mute:#6B6B6B;
    --line:#E8DFD0; --coral:#FF4D2E; --coral-dark:#E63A1C;
    --mint:#00C896; --mustard:#FFB627; --rose:#FF99A8; --blue:#3B82F6;
    --r-sm:8px; --r:14px; --r-lg:22px; --r-xl:30px; --r-pill:999px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
    font-family: 'Tajawal', system-ui, sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1400px; margin: 0 auto; padding: 24px 18px; }
@media (min-width:768px){ .container { padding: 32px 30px; } }
.muted { color: var(--text-mute); }
.small { font-size: 0.88em; }
.center { text-align: center; }

/* ━━━ Header ━━━ */
.site-header {
    background: var(--cream);
    border-bottom: 2px solid var(--ink);
    position: sticky; top: 0; z-index: 100;
}
.nav-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 12px 18px;
    display: flex; align-items: center; gap: 12px;
}
@media (min-width:768px){ .nav-inner { padding: 14px 30px; } }
.logo {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 1.15em; font-weight: 900; color: var(--ink);
    letter-spacing: -0.5px;
}
.logo-mark {
    background: var(--ink); color: var(--coral);
    width: 32px; height: 32px; border-radius: 8px;
    position: relative;
}
.logo-mark::before, .logo-mark::after {
    content: ""; position: absolute;
    inset-inline: 22%; top: 50%; height: 3px;
    background: var(--coral);
}
.logo-mark::before { transform: translateY(-50%) rotate(45deg); }
.logo-mark::after { transform: translateY(-50%) rotate(-45deg); }
.nav-links {
    display: none; gap: 6px;
    flex: 1; flex-wrap: wrap;
}
@media (min-width:980px){ .nav-links { display: flex; } }
.nav-links a {
    color: var(--ink-soft); font-weight: 700; font-size: 0.92em;
    padding: 8px 12px; border-radius: var(--r-pill);
    transition: all 0.15s var(--ease);
}
.nav-links a:hover { background: var(--bg-soft); color: var(--coral); }
.nav-links a.active { background: var(--ink); color: var(--cream); }

.user-chip {
    background: var(--bg-soft); border: 2px solid var(--ink);
    padding: 6px 12px; border-radius: var(--r-pill);
    font-weight: 900; font-size: 0.85em;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-logout {
    background: var(--ink); color: var(--cream);
    padding: 7px 14px; border-radius: var(--r-pill);
    font-weight: 900; font-size: 0.85em;
    border: 2px solid var(--ink);
    transition: all 0.2s var(--ease);
}
.btn-logout:hover { background: var(--coral); transform: translate(-2px,-2px); box-shadow: 3px 3px 0 var(--ink); color: var(--cream); }
.menu-toggle {
    display: inline-flex; background: var(--bg-soft);
    border: 2px solid var(--ink); width: 36px; height: 36px;
    border-radius: 8px; align-items: center; justify-content: center;
    font-size: 1.1em; font-weight: 900;
}
@media (min-width:980px){ .menu-toggle { display: none; } }

/* ━━━ Subscription banner ━━━ */
.sub-warn {
    background: var(--mustard); color: var(--ink);
    padding: 10px 18px; text-align: center;
    border-bottom: 2px solid var(--ink); font-weight: 900;
}
.sub-warn a { text-decoration: underline; }

/* ━━━ Flash ━━━ */
.flash {
    padding: 12px 16px; margin: 14px 0;
    border-radius: var(--r); font-weight: 700;
    border: 2px solid var(--ink);
    animation: slideDown 0.3s var(--ease);
}
.flash-error { background: var(--coral); color: var(--cream); }
.flash-success { background: var(--mint); color: var(--ink); }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ━━━ Buttons ━━━ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 2px solid var(--ink);
    padding: 11px 20px; border-radius: var(--r-pill);
    font-weight: 900; font-size: 0.95em;
    transition: all 0.2s var(--ease);
    background: var(--ink); color: var(--cream);
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--ink); color: var(--cream); }
.btn:active { transform: translate(0); box-shadow: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.big { padding: 14px 26px; font-size: 1em; }
.btn.block { display: flex; width: 100%; }
.btn-primary { background: var(--coral); color: var(--cream); }
.btn-success { background: var(--mint); color: var(--ink); }
.btn-warning { background: var(--mustard); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.btn-danger { background: var(--coral); color: var(--cream); }
.btn-mini {
    padding: 6px 12px; font-size: 0.82em;
    background: var(--ink); color: var(--cream);
    border: none; border-radius: var(--r-pill); font-weight: 900;
}
.btn-mini:hover { background: var(--coral); }

/* ━━━ Form ━━━ */
.form { display: flex; flex-direction: column; gap: 8px; }
.form label, label { font-weight: 700; color: var(--ink-soft); font-size: 0.92em; margin-top: 8px; }
.form input, .form select, .form textarea,
input.form-input, select.form-input, textarea.form-input {
    background: var(--bg-soft); border: 2px solid var(--ink);
    padding: 11px 14px; border-radius: var(--r);
    font-size: 1em; font-family: inherit;
    color: var(--ink); font-weight: 500;
    transition: all 0.15s var(--ease);
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none; background: white;
    box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px,-1px);
}

/* ━━━ Pages ━━━ */
.page-tag {
    display: inline-flex; gap: 6px;
    background: var(--ink); color: var(--coral);
    padding: 5px 14px; border-radius: var(--r-pill);
    font-size: 0.78em; font-weight: 900; letter-spacing: 1.5px;
    margin-bottom: 14px;
}
.page-tag::before { content: "✕"; color: var(--coral); }
.page-title {
    font-size: clamp(1.6em, 4vw, 2.4em);
    font-weight: 900; letter-spacing: -1px;
    line-height: 1.1; margin-bottom: 16px;
}
.page-title .hl { color: var(--coral); position: relative; display: inline-block; }
.page-title .hl::after { content:""; position:absolute; inset-inline:0; bottom:5%; height:18%; background:var(--mustard); opacity:0.5; z-index:-1; }
.page-head {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}

/* ━━━ Cards / Panels ━━━ */
.panel {
    background: var(--cream); border: 2px solid var(--ink);
    border-radius: var(--r-lg); padding: 22px;
    box-shadow: 5px 5px 0 var(--ink); margin-bottom: 20px;
}
.panel h3 {
    font-weight: 900; margin-bottom: 14px; font-size: 1.05em;
    display: flex; align-items: center; gap: 8px;
}
.panel h3::before {
    content: "✕"; background: var(--coral); color: var(--cream);
    width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.72em; font-weight: 900;
}
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-mute);
    background: var(--cream); border: 2px dashed var(--ink);
    border-radius: var(--r-lg);
}
.empty-icon { font-size: 3.5em; margin-bottom: 12px; }
.empty-state h3 { color: var(--ink); font-weight: 900; margin-bottom: 6px; font-size: 1.3em; }

/* ━━━ Stats ━━━ */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.stat-card {
    background: var(--cream); border: 2px solid var(--ink);
    border-radius: var(--r-lg); padding: 20px;
    box-shadow: 5px 5px 0 var(--ink);
    transition: transform 0.2s var(--ease);
}
.stat-card:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--coral); }
.stat-card.primary { background: var(--coral); color: var(--cream); }
.stat-card.primary .stat-label { color: rgba(255,248,240,0.85); }
.stat-card.mint { background: var(--mint); }
.stat-card.mustard { background: var(--mustard); }
.stat-label { color: var(--text-mute); font-size: 0.85em; font-weight: 700; margin-bottom: 6px; display: block; }
.stat-value { font-size: 2em; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.stat-sub { color: var(--text-mute); font-size: 0.82em; margin-top: 4px; font-weight: 500; }
.stat-card.primary .stat-sub { color: rgba(255,248,240,0.7); }

/* ━━━ Table ━━━ */
.data-table {
    width: 100%; border-collapse: collapse;
    background: var(--cream); border-radius: var(--r);
    overflow: hidden;
}
.data-table th {
    background: var(--ink); color: var(--cream);
    padding: 12px 14px; text-align: start;
    font-weight: 900; font-size: 0.85em;
}
.data-table td { padding: 12px 14px; border-top: 1px solid var(--line); }
.data-table tr:hover { background: var(--bg-soft); }
.code-chip {
    background: var(--ink); color: var(--coral);
    padding: 4px 12px; border-radius: var(--r-pill);
    font-family: 'Consolas', monospace; font-weight: 900;
    letter-spacing: 1px; font-size: 0.85em;
}
.badge {
    padding: 3px 12px; border-radius: var(--r-pill);
    font-size: 0.78em; font-weight: 900;
}
.badge-ok { background: var(--mint); color: var(--ink); }
.badge-off { background: var(--line); color: var(--text-mute); }
.badge-warn { background: var(--mustard); color: var(--ink); }

/* ━━━ Footer ━━━ */
.site-footer {
    background: var(--ink); color: var(--cream);
    padding: 36px 0 20px; margin-top: 80px;
    text-align: center;
}
.site-footer a { color: var(--coral); font-weight: 700; }
.site-footer p { opacity: 0.8; font-weight: 500; }

/* ━━━ Mobile menu drawer ━━━ */
.mobile-drawer {
    display: none;
    position: fixed; inset: 0; background: rgba(10,10,10,0.5);
    z-index: 200;
}
.mobile-drawer.open { display: block; }
.mobile-drawer-inner {
    position: absolute; inset-inline-end: 0; top: 0;
    width: 280px; height: 100vh;
    background: var(--cream); border-inline-start: 2px solid var(--ink);
    padding: 24px 18px;
    display: flex; flex-direction: column; gap: 10px;
}
.mobile-drawer-inner a {
    padding: 12px 14px; border-radius: var(--r);
    background: var(--bg-soft); border: 2px solid var(--ink);
    font-weight: 900;
}
.mobile-drawer-inner a:hover { background: var(--ink); color: var(--cream); }
