/* Deema Admin — styled to match the customer storefront (Deema/styles.css):
   cream paper backgrounds, forest-brown accents, Fraunces headings + Manrope
   text, square corners, hairline borders, lime highlight accents. Class names
   and DOM structure are unchanged from the previous theme. */

html { background: #FFFFFF; }

:root {
  color-scheme: light;
  --forest: #8A5A18;        /* light brown pulled from the storefront palette */
  --forest-dark: #3D2506;   /* espresso for headings/dark bands */
  --ink: #3A2E20;
  --muted: #6B5D4A;
  --cream: #FBF7F0;
  --paper: #FFFDF9;
  --lime: #F3D9A4;
  --orange: #B93232;        /* matches --orange (error/accent red) */
  --logo-red: #E94670;      /* coral red matched to the product label */
  --line: #E7DCCB;
  --soft: #FBF7F0;
  --card: #FFFFFF;
  --th: #F3D9A4;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", "Century Gothic", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- Sidebar (dark forest, like the hero/banner bands on the storefront) ---- */
.side { width: 230px; flex: none; background: var(--forest); color: var(--ink); padding: 24px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 40px; font-family: "Chewy", cursive; font-size: 24px; font-weight: 400; letter-spacing: .01em; color: var(--logo-red); text-transform: none; text-decoration: none; }
.brand .i { color: var(--lime); width: 24px; height: 24px; stroke-width: 2; }
.side nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side a { position: relative; overflow: hidden; display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 13px; border-radius: 0; color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: .02em; transition: background .22s ease, color .22s ease, transform .18s ease, box-shadow .22s ease; }
.side a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--lime); transform: translateX(-102%); transition: transform .25s ease; }
.side a:hover, .side a:focus-visible { background: var(--lime); color: var(--ink); transform: translateX(3px); box-shadow: 0 5px 14px rgba(244, 177, 131, .18); }
.side a:hover::after, .side a:focus-visible::after { transform: translateX(0); }
.side a.on { background: var(--lime); color: var(--forest-dark); }
.side a.on .tag { background: rgba(58, 32, 2, .18); color: var(--forest-dark); }
.tag { margin-left: auto; padding: 2px 9px; border-radius: 0; background: rgba(255, 255, 255, .14); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.side .foot { display: flex; flex-direction: column; gap: 3px; }

/* ---- Main column ---- */
.main { flex: 1; min-width: 0; padding: 28px 40px 48px; }
.top { display: flex; justify-content: space-between; align-items: center; }
.top h1 { margin: 0; font-family: var(--serif); font-size: 34px; font-weight: 500; letter-spacing: -.03em; }
.tools { display: flex; align-items: center; gap: 14px; }
.tools button { background: none; border: 0; padding: 6px; position: relative; color: var(--forest); }
.tools button:hover { color: var(--orange); }
.bell::after { content: ""; position: absolute; top: 4px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); border: 1.5px solid var(--paper); }
.avatar { width: 40px; height: 40px; border: 1px solid #D3C3A9; border-radius: 50%; background: var(--soft); color: var(--forest); font-family: var(--serif); font-weight: 600; font-size: 14px; }
.welcome { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 18px; gap: 12px; flex-wrap: wrap; }
.welcome h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.welcome h2 em { color: var(--forest); font-weight: 500; }
.date { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--card); color: var(--forest); font-size: 12px; font-weight: 600; }
.date .i { width: 16px; height: 16px; }
.date:hover { background: var(--soft); }

/* ---- Stat cards ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.card { padding: 16px 16px 14px; min-height: 116px; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card strong { display: block; margin-top: 6px; color: var(--forest-dark); font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1.15; }
.badge { padding: 3px 9px; border-radius: 0; background: var(--lime); color: var(--forest-dark); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.card .badge.solo { display: inline-block; margin-top: 8px; }
.card svg.viz { width: 100%; height: 44px; margin-top: 6px; }

/* ---- Panels, tables ---- */
.panel { margin-bottom: 16px; overflow: hidden; }
.panel h3 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--forest-dark); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 16px 0; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legend b { display: inline-block; width: 11px; height: 11px; }
.legend .dot { border-radius: 50%; background: var(--forest); }
.legend .sq { border-radius: 0; background: var(--lime); margin-left: 8px; }
.chart { overflow-x: auto; padding: 4px 10px 8px; }
.chart svg { min-width: 760px; width: 100%; height: auto; }

.pad { padding: 15px 16px 11px; }
.tbl { overflow-x: auto; }
.pthumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); border: 1px solid #D3C3A9; color: var(--forest); flex: none; }
.pthumb.ph svg { width: 16px; height: 16px; }
.pwrap { display: inline-flex; align-items: center; gap: 10px; }
input[type="file"].field { padding: 9px 13px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { background: var(--soft); text-align: left; font-weight: 700; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--forest-dark); padding: 10px 14px; border-top: 1px solid var(--line); }
td { padding: 11px 14px; border-top: 1px solid #E4DBCF; font-size: 13px; }
tbody tr:first-child td { border-top: 0; }
th:last-child, td:last-child { text-align: right; }
.st { display: inline-block; padding: 3px 11px; border-radius: 0; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.st.shipped { background: #DCE7F5; color: #3A2A1A; }
.st.delivered { background: var(--lime); color: var(--forest-dark); }
.st.pending { background: #F3D9D9; color: #7A1F1F; }
.act { background: none; border: 0; padding: 3px; color: var(--forest); }
.act:hover { color: var(--orange); }
.act .i { width: 17px; height: 17px; }

/* ---- Buttons, fields, chips ---- */
.btn { height: 44px; padding: 0 20px; border: 0; background: var(--forest); color: var(--ink); font-size: 14px; font-weight: 600; transition: transform .18s ease, background .2s, box-shadow .18s ease; }
.btn:hover { background: var(--forest-dark); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(61, 37, 6, .2); }
.btn.ghost { background: var(--card); color: var(--forest-dark); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--orange); }
.btn.danger:hover { background: #9C2626; box-shadow: 0 6px 16px rgba(185, 50, 50, .22); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 20px 0 14px; }
.field { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #D3C3A9; border-radius: 0; background: var(--soft); color: var(--ink); font: inherit; font-size: 13px; transition: border-color .18s, background-color .18s, box-shadow .18s; }
.field:focus { outline: none; border-color: var(--forest); background: #FBF9F6; box-shadow: 0 0 0 3px rgba(61, 37, 6, .18); }
.search { max-width: 300px; }
.right { margin-left: auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 16px; border: 1px solid var(--line); background: var(--card); color: var(--forest-dark); font-size: 12px; font-weight: 600; }
.chip.on { background: var(--forest); border-color: var(--forest); color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 30px; }

/* ---- Modals, toasts, popovers ---- */
.overlay { position: fixed; inset: 0; background: rgba(58, 32, 2, .5); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: 22px; width: min(420px, 100%); box-shadow: 0 22px 50px rgba(58, 32, 2, .28); animation: pop .18s; }
.modal h3 { margin: 0 0 14px; font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--forest-dark); }
.modal label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 11px; letter-spacing: .04em; color: var(--forest-dark); }
.modal label .field { margin-top: 4px; }
.macts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--forest); color: var(--ink); padding: 12px 16px; border-radius: 0; border-left: 4px solid var(--lime); box-shadow: 0 8px 24px rgba(58, 32, 2, .3); animation: slide .25s; font-size: 13px; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s; }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }
.pop { position: fixed; z-index: 40; background: var(--card); border: 1px solid var(--line); border-radius: 0; padding: 6px; min-width: 210px; box-shadow: 0 12px 32px rgba(58, 32, 2, .2); animation: pop .15s; }
.pop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 0; color: var(--ink); font-size: 13px; }
.pop button:hover { background: var(--soft); color: var(--forest); }
.pop small { display: block; color: var(--muted); }
.pop .field { width: 250px; }

/* ---- Switches, bars, forms, misc ---- */
.sw { width: 42px; height: 23px; border-radius: 0; border: 0; background: #D6CEC4; position: relative; padding: 0; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--forest-dark); transition: transform .2s; }
.sw.on { background: var(--lime); }
.sw.on::after { transform: translateX(19px); background: var(--forest); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pbody { padding: 6px 16px 16px; }
.brow { margin: 12px 0; }
.brow > div:first-child { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--forest-dark); margin-bottom: 5px; }
.track { height: 8px; border-radius: 0; background: var(--th); }
.fill { height: 100%; border-radius: 0; background: var(--forest); width: 0; transition: width .7s cubic-bezier(.2, .7, .2, 1); }
.form { padding: 6px 16px 16px; max-width: 560px; }
.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 11px; letter-spacing: .04em; color: var(--forest-dark); }
.form .field { margin-top: 4px; }
.trow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #E4DBCF; font-size: 13px; }
.codes code { background: var(--th); padding: 2px 8px; border-radius: 0; font-weight: 600; }

/* ---- Login card ---- */
body.login { display: grid; place-items: center; padding: 16px; }

/* ---- Split-screen login layout ---- */
.lwrap { display: flex; width: min(1060px, 100%); background: var(--card); border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(43, 23, 1, .18); overflow: hidden; }
.lside { flex: 1 1 46%; min-height: 640px; padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; background: linear-gradient(160deg, var(--forest) 0%, var(--forest-dark) 70%); color: #EFEBE5; position: relative; }
.lside::before { content: "✳"; position: absolute; top: -26px; right: -14px; font-size: 190px; color: rgba(228, 211, 182, .1); pointer-events: none; }
.lside-brand { font-family: "Chewy", cursive; font-size: 40px; color: var(--logo-red); text-decoration: none; text-transform: none; }
.lside-brand span { color: var(--lime); }
.lside-title { margin: 0; font-family: var(--serif); font-size: clamp(24px, 2.6vw, 32px); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
.lside-title em { color: var(--lime); font-style: normal; }
.lside-copy { margin: 0; color: rgba(239, 235, 229, .75); font-size: 13.5px; line-height: 1.7; }
.lside-points { display: grid; gap: 12px; font-size: 12.5px; letter-spacing: .02em; color: rgba(239, 235, 229, .85); }
.lside-foot { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: rgba(239, 235, 229, .45); }
.lmain { flex: 1 1 54%; display: grid; place-items: center; padding: 34px; background:
  radial-gradient(circle at 88% -10%, rgba(228, 211, 182, .5), transparent 34%), var(--cream); }

/* ---- Card ---- */
.lcard { background: var(--card); border: 1px solid var(--line); padding: 38px 36px 30px; width: min(430px, 100%); box-shadow: 0 14px 44px rgba(58, 32, 2, .14); position: relative; }
.lcard::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--logo-red), var(--lime)); }
.lcard .brand { color: var(--logo-red); padding: 0 0 18px; }
.lcard .brand .i { color: var(--lime); }
.lhead { margin: 0 0 6px; font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--forest-dark); }
.lsub { margin: 0 0 20px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.lcard label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--forest-dark); }
.lcard .field { margin-top: 5px; height: 46px; border-radius: 8px; }
.lcard .field:focus { border-color: var(--forest); }
.llink { margin: 2px 0 0; }
.lhint { margin: 4px 0 0; padding: 10px 12px; background: var(--soft); border-left: 3px solid var(--lime); font-size: 11.5px !important; line-height: 1.55; color: var(--muted) !important; }
.lhint b { color: var(--forest-dark); }
.lerr { margin: 8px 0 0 !important; color: var(--orange) !important; font-size: 13px; font-weight: 600; }
.lprimary { width: 100%; height: 48px; margin-top: 16px; font-size: 14px; letter-spacing: .02em; }
.lprimary:hover { filter: brightness(1.12); }
.ldivider { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.ldivider::before, .ldivider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lgoogle { width: 100%; height: 46px; margin-top: 16px; background: #fff; color: var(--ink); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.lgoogle:hover { border-color: var(--forest); background: var(--soft); }
.lfoot { margin: 18px 0 0 !important; text-align: center; font-size: 13px; }
.lcard p { color: var(--muted); }
.lcard a { color: var(--forest); font-weight: 700; }
.lcard a:hover { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .lwrap { flex-direction: column-reverse; }
  .lside { min-height: 0; padding: 36px 30px; }
  .lside::before { font-size: 120px; }
  .lmain { padding: 24px 16px 36px; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  body { flex-direction: column; }
  .side { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px; overflow-x: auto; gap: 8px; }
  .brand { padding: 0 10px 0 4px; }
  .side nav, .side .foot { flex-direction: row; flex: none; }
  .side a { white-space: nowrap; }
  .tag { display: none; }
  .main { padding: 18px 16px 36px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }

/* keep existing interaction niceties */
button, .btn, .chip, .card, .side a { transition: transform .12s, background .2s, box-shadow .2s, filter .2s; }
button:active, .btn:active, .chip:active, .side a:active { transform: scale(.97); }
.stats .card { cursor: pointer; }
.stats .card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(58, 32, 2, .12); }
tbody tr:hover { background: var(--soft); }
.tools .avatar { padding: 0; border: 0; }
.tools .avatar:hover { color: var(--forest-dark); }
.bell.read::after { display: none; }
.side a.brand { height: auto; padding: 0 12px 40px; }
.side a.brand:hover { background: none; }

@media (prefers-reduced-motion: reduce) {
  .side a {
    transition: none;
  }

  .side a:hover,
  .side a:focus-visible {
    transform: none;
  }
}
