/* =========================================
   CREAM DOMINANT + RED ACCENT THEME
   Sales & Inventory System
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* ── CREAM PALETTE (dominant) ── */
    --cream-50:   #FFFDF8;
    --cream-100:  #FAF6ED;
    --cream-200:  #F2EBD9;
    --cream-300:  #E8DEC8;
    --cream-400:  #D9CDB4;
    --cream-500:  #C8BAA0;

    /* ── RED PALETTE (secondary/accent) ── */
    --red-400:    #E05A4E;
    --red-500:    #C0392B;
    --red-600:    #96281B;
    --red-100:    #FAEAE8;
    --red-200:    #F0C4BF;

    /* ── TEXT ── */
    --text-900:   #2A1F1A;
    --text-700:   #5A4438;
    --text-500:   #8C7060;
    --text-300:   #B8A898;

    /* ── SEMANTIC ── */
    --success:      #2D7A4F;
    --success-bg:   #E8F5EE;
    --warning:      #B07020;
    --warning-bg:   #FDF3E0;

    /* ── BACKWARDS COMPAT aliases ── */
    --cream:        var(--cream-100);
    --cream-dark:   var(--cream-200);
    --cream-deeper: var(--cream-300);
    --cream-light:  var(--cream-50);
    --red:          var(--red-500);
    --red-dark:     var(--red-600);
    --red-light:    var(--red-100);
    --red-soft:     var(--red-400);
    --ink:          var(--text-900);
    --ink-mid:      var(--text-700);
    --ink-light:    var(--text-500);
    --border:       var(--cream-300);
    --border-light: var(--cream-200);
    --white:        var(--cream-50);
    --danger:       var(--red-500);
    --danger-light: var(--red-100);
    --primary:          var(--red-500);
    --primary-hover:    var(--red-600);
    --primary-light:    var(--red-100);
    --bg:               var(--cream-100);
    --bg-white:         var(--cream-50);
    --bg-surface:       var(--cream-200);
    --text:             var(--text-900);
    --text-muted:       var(--text-700);
    --text-light:       var(--text-500);
    --border-dark:      var(--cream-300);
    --shein-red:        var(--red-500);
    --shein-dark:       var(--red-600);
    --shein-pink:       var(--red-400);
    --shein-light:      var(--red-100);

    /* ── RADII ── */
    --radius:    6px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    /* ── SHADOWS (cream-tinted) ── */
    --shadow-sm:  0 1px 4px rgba(90,68,56,.08);
    --shadow:     0 4px 18px rgba(90,68,56,.12);
    --shadow-lg:  0 8px 32px rgba(90,68,56,.16);
    --shadow-red: 0 4px 20px rgba(192,57,43,.20);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    background: var(--cream-100);
    color: var(--text-900);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--red-500); text-decoration: none; transition: color .18s; }
a:hover { color: var(--red-600); }

/* ═══════════════════════════════════════
   LAYOUT — cream sidebar, cream body
   ═══════════════════════════════════════ */
.wrapper {
    display: grid;
    grid-template-columns: 230px 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "nav  main"
        "nav  footer";
    min-height: 100vh;
}

/* ═══════════════════════════════════════
   SIDEBAR — cream background, red accents
   ═══════════════════════════════════════ */
.navbar {
    grid-area: nav;
    background: var(--cream-200) !important;
    border-right: 2px solid var(--cream-300) !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(90,68,56,.07) !important;
}

.navbar-brand {
    display: block !important;
    padding: 26px 22px 22px !important;
    font-family: 'Playfair Display', serif !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    color: var(--red-500) !important;
    letter-spacing: .2px !important;
    text-transform: none !important;
    background: none !important;
    -webkit-text-fill-color: var(--red-500) !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    border-bottom: 1.5px solid var(--cream-300) !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
}

.navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    padding: 0 12px !important;
    align-items: stretch !important;
    flex: 1 !important;
}

.navbar-nav a {
    color: var(--text-700) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 10px 14px !important;
    border-radius: var(--radius-lg) !important;
    transition: all .18s !important;
    text-transform: none !important;
    letter-spacing: .01em !important;
    text-decoration: none !important;
    display: block !important;
    border-left: 3px solid transparent !important;
}

.navbar-nav a:hover {
    background: var(--cream-300) !important;
    color: var(--text-900) !important;
    text-decoration: none !important;
    border-left-color: var(--red-400) !important;
}

.navbar-nav a.active {
    background: var(--red-100) !important;
    color: var(--red-500) !important;
    font-weight: 600 !important;
    border-left-color: var(--red-500) !important;
}

/* Logout button in sidebar */
.navbar .btn,
.navbar a.btn {
    margin: auto 12px 22px !important;
    color: var(--red-500) !important;
    background: transparent !important;
    border-radius: var(--radius-lg) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: .1em !important;
    padding: 9px 16px !important;
    justify-content: center !important;
    width: calc(100% - 24px) !important;
    transition: all .18s !important;
    border: 1.5px solid var(--red-200) !important;
}
.navbar .btn:hover,
.navbar a.btn:hover {
    background: var(--red-500) !important;
    border-color: var(--red-500) !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* ── Main Content ── */
.main-content {
    grid-area: main;
    padding: 34px 40px;
    max-width: 1080px;
    width: 100%;
    background: var(--cream-100);
}

/* ── Footer ── */
.footer {
    grid-area: footer;
    background: var(--cream-200);
    border-top: 1.5px solid var(--cream-300);
    text-align: center;
    padding: 14px 12px;
    font-size: 10px;
    color: var(--text-500);
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════
   PAGE TITLE
   ═══════════════════════════════════════ */
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 900;
    color: var(--text-900);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--cream-300);
}
.page-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--cream-300), transparent);
}

/* ═══════════════════════════════════════
   CARDS  — cream background
   ═══════════════════════════════════════ */
.card {
    background: var(--cream-50);
    border: 1.5px solid var(--cream-300);
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .22s, transform .22s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-900);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid var(--cream-200);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0;
}
.card-title::before {
    content: '';
    width: 3px;
    height: 18px;
    background: var(--red-500);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════
   STAT BOXES — cream with red accent
   ═══════════════════════════════════════ */
.stat-box {
    background: var(--cream-50);
    border: 1.5px solid var(--cream-300);
    border-radius: var(--radius-xl);
    padding: 24px 26px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: box-shadow .22s, transform .22s;
}
.stat-box:hover { box-shadow: var(--shadow-red); transform: translateY(-3px); }
.stat-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--red-500);
}
.stat-box::after {
    content: '';
    position: absolute;
    bottom: -20px; right: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(192,57,43,.07) 0%, transparent 70%);
    pointer-events: none;
}

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--red-500);
    line-height: 1;
}
.stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-500);
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-top: 8px;
}

/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-700);
    text-transform: uppercase;
    letter-spacing: .11em;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--cream-50);
    border: 1.5px solid var(--cream-300);
    border-radius: var(--radius-lg);
    color: var(--text-900);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.form-control:focus {
    border-color: var(--red-500);
    box-shadow: 0 0 0 3px rgba(192,57,43,.10);
    background: #fff;
}
.form-control::placeholder { color: var(--text-300); }
select.form-control option { background: var(--cream-50); }

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 22px;
    border: 1.5px solid var(--cream-300);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: .03em;
    text-transform: none;
    transition: all .18s;
    background: var(--cream-200);
    color: var(--text-900);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary {
    background: var(--red-500);
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 3px 12px rgba(192,57,43,.25);
}
.btn-primary:hover {
    background: var(--red-600);
    box-shadow: 0 6px 20px rgba(192,57,43,.35);
    color: #fff !important;
}

.btn-success {
    background: var(--success);
    color: #fff !important;
    border-color: transparent;
}
.btn-success:hover { background: #226040; color: #fff !important; }

.btn-danger {
    background: var(--red-500);
    color: #fff !important;
    border-color: transparent;
}
.btn-danger:hover { background: var(--red-600); color: #fff !important; }

.btn-warning {
    background: var(--warning);
    color: #fff !important;
    border-color: transparent;
}
.btn-warning:hover { background: #8A5510; color: #fff !important; }

.btn-secondary {
    background: var(--cream-200);
    color: var(--text-700) !important;
    border-color: var(--cream-300);
}
.btn-secondary:hover { background: var(--cream-300); color: var(--text-900) !important; }

.btn-sm { padding: 5px 13px; font-size: 11px; border-radius: var(--radius); }

/* ═══════════════════════════════════════
   TABLES — cream rows, red header
   ═══════════════════════════════════════ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    border: 1.5px solid var(--cream-300);
    overflow: hidden;
    background: var(--cream-50);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }

table th {
    background: var(--red-500) !important;
    color: #fff !important;
    padding: 13px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    border: none;
    font-family: 'DM Sans', sans-serif;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cream-200);
    color: var(--text-900);
    vertical-align: middle;
    background: var(--cream-50);
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--cream-200); }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid;
}
.alert-success { background: var(--success-bg);  border-color: var(--success); color: var(--success); }
.alert-danger   { background: var(--red-100);     border-color: var(--red-500); color: var(--red-600); }
.alert-info     { background: var(--red-100);     border-color: var(--red-400); color: var(--red-600); }

/* ═══════════════════════════════════════
   LOGIN / REGISTER  — cream split layout
   ═══════════════════════════════════════ */
.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--cream-100);
}

.login-box {
    background: var(--cream-50);
    padding: 60px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    border-left: 2px solid var(--cream-300);
}

.login-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-900);
    margin-bottom: 4px;
    background: none !important;
    -webkit-text-fill-color: var(--text-900) !important;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-500);
    margin-bottom: 32px;
}

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.badge-silver   { background: var(--cream-200); color: var(--text-700); border: 1px solid var(--cream-300); }
.badge-gold     { background: #FFF3D6; color: #7A4F00; border: 1px solid #E8C96A; }
.badge-platinum { background: #EDE9FE; color: #5B21B6; border: 1px solid #C4B5FD; }

/* ── CART ── */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--cream-200);
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: var(--cream-200); padding-left: 6px; padding-right: 6px; border-radius: var(--radius); }

/* ── RECEIPT ── */
.receipt-box {
    background: var(--cream-100);
    border: 1.5px dashed var(--cream-400);
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    font-family: "Courier New", monospace;
    font-size: 13px;
    max-width: 420px;
}
.receipt-line    { display: flex; justify-content: space-between; margin: 6px 0; }
.receipt-divider { border-top: 1px dashed var(--cream-400); margin: 12px 0; }
.receipt-total   { font-weight: 900; font-size: 16px; color: var(--red-500); }

/* ── BAR CHART ── */
.chart-bar-wrap { margin: 10px 0; }
.chart-label    { font-size: 12px; font-weight: 600; color: var(--text-700); margin-bottom: 5px; }
.chart-bar-bg   { background: var(--cream-300); border-radius: 20px; height: 12px; overflow: hidden; }
.chart-bar      { height: 100%; background: var(--red-500); border-radius: 20px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.chart-value    { font-size: 11px; font-weight: 600; color: var(--red-500); text-align: right; margin-top: 3px; }

/* ── LAYOUT HELPERS ── */
.row { display: flex; flex-wrap: wrap; gap: 18px; }
.col  { flex: 1; min-width: 200px; }
.col-2 { flex: 2; min-width: 300px; }
.text-right      { text-align: right; }
.text-center     { text-align: center; }
.mt-2            { margin-top: 12px; }
.mb-2            { margin-bottom: 12px; }
.flex            { display: flex; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden          { display: none; }
.text-muted      { color: var(--text-muted); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--cream-200); }
::-webkit-scrollbar-thumb { background: var(--cream-400); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--red-400); }
