/* =========================================================================
   SORNAM CRACKERS - admin dashboard
   ========================================================================= */

:root {
  --a-bg:      #fff8fb;
  --a-panel:   #ffffff;
  --a-ink:     #1f2937;
  --a-soft:    #6b7280;
  --a-mute:    #9ca3af;
  --a-line:    #f0e6ec;
  --a-brand:   #f30577;
  --a-brand-2: #f729a4;
  --a-side:    #023f18;
  --a-green:   #16a34a;
  --a-blue:    #2563eb;
  --a-amber:   #d97706;
  --a-r:       12px;
  --a-shadow:  0 1px 3px rgba(17, 24, 39, .06), 0 8px 24px rgba(17, 24, 39, .05);
  --side-w:    248px;
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--a-bg); color: var(--a-ink);
  font: 14px/1.6 Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: Outfit, "Segoe UI", sans-serif; margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --------------------------------------------------------------- login page */

.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 560px at 50% -10%, #ffe3f1, #fff8fb 62%);
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 34px;
  border: 1px solid #f6dce8; box-shadow: 0 24px 56px rgba(166, 20, 95, .16);
}
.login-card .mark {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: linear-gradient(135deg, var(--a-brand-2), var(--a-brand)); color: #fff; margin-bottom: 16px;
}
.login-card h1 { font-size: 23px; }
.login-card p.sub { color: var(--a-soft); font-size: 13.5px; margin: 6px 0 22px; }
.login-hint {
  margin-top: 18px; background: #fff6e0; border: 1px solid #f6dfa4; color: #8a5a06;
  border-radius: var(--a-r); padding: 12px 14px; font-size: 12.5px; line-height: 1.6;
}
.login-back { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--a-soft); }
.login-back:hover { color: var(--a-brand); }

/* ------------------------------------------------------------------- shell */

.a-shell { display: flex; min-height: 100vh; }

.a-side {
  width: var(--side-w); flex: none; background: var(--a-side); color: #c6dcc6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.a-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.a-brand .mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px;
  background: linear-gradient(135deg, var(--a-brand-2), var(--a-brand)); color: #fff; flex: none;
}
.a-brand b { font-family: Outfit, sans-serif; font-size: 15px; color: #fff; display: block; line-height: 1.2; }
.a-brand span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #9cba9d; }

.a-nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.a-nav .grp {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #7e9c80;
  padding: 14px 10px 6px;
}
.a-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; color: #c6dcc6; margin-bottom: 2px;
}
.a-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.a-nav a.is-active { background: linear-gradient(135deg, var(--a-brand-2), var(--a-brand)); color: #fff; font-weight: 600; }
.a-nav a .ico { width: 20px; text-align: center; }
.a-nav a .pill {
  margin-left: auto; background: #f3be27; color: #03210a; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 1px 8px;
}
.a-side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; }
.a-side-foot a { display: block; padding: 4px 0; color: #9cba9d; }
.a-side-foot a:hover { color: #f3be27; }

.a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.a-top {
  background: #fff; border-bottom: 1px solid var(--a-line);
  padding: 14px 26px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 30;
}
.a-top h1 { font-size: 20px; }
.a-top .sub { color: var(--a-soft); font-size: 13px; }
.a-top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.a-user { display: flex; align-items: center; gap: 9px; padding: 6px 12px; border: 1px solid var(--a-line); border-radius: 999px; }
.a-user .av {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, var(--a-brand-2), var(--a-brand)); color: #fff; font-size: 13px;
}
.a-user small { display: block; font-size: 10.5px; color: var(--a-mute); letter-spacing: .06em; text-transform: uppercase; }
.a-user b { font-size: 13px; }

.a-body { padding: 24px 26px 60px; flex: 1; }
.a-burger { display: none; width: 40px; height: 38px; border-radius: 9px; border: 1px solid var(--a-line); background: #fff; cursor: pointer; }

/* ------------------------------------------------------------------ pieces */

.card { background: var(--a-panel); border: 1px solid var(--a-line); border-radius: var(--a-r); box-shadow: var(--a-shadow); }
.card-head {
  padding: 15px 18px; border-bottom: 1px solid var(--a-line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { font-size: 16px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 22px; }
.stat-card {
  background: #fff; border: 1px solid var(--a-line); border-radius: var(--a-r); padding: 18px;
  box-shadow: var(--a-shadow); display: flex; gap: 14px; align-items: center;
}
.stat-card .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex: none; }
.stat-card .ico.r { background: #fef2f2; } .stat-card .ico.g { background: #f0fdf4; }
.stat-card .ico.b { background: #eff6ff; } .stat-card .ico.a { background: #fffbeb; }
.stat-card b { display: block; font-family: Outfit, sans-serif; font-size: 25px; line-height: 1.2; }
.stat-card span { font-size: 12.5px; color: var(--a-soft); }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--a-mute);
  padding: 11px 14px; border-bottom: 1px solid var(--a-line); background: #fafafa; white-space: nowrap;
}
table.grid td { padding: 11px 14px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #fcfcfd; }
table.grid td.n { text-align: right; font-family: Outfit, sans-serif; font-weight: 700; white-space: nowrap; }
.thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: #f3f4f6; }
.table-wrap { overflow-x: auto; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  letter-spacing: .03em; white-space: nowrap;
}
.b-new  { background: #eff6ff; color: #1d4ed8; }
.b-ok   { background: #f0fdf4; color: #15803d; }
.b-warn { background: #fffbeb; color: #b45309; }
.b-off  { background: #f3f4f6; color: #4b5563; }
.b-red  { background: #fef2f2; color: #b91c1c; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: 13.5px;
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(.96); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--a-brand-2), var(--a-brand)); color: #fff; }
.btn-dark    { background: #111827; color: #fff; }
.btn-light   { background: #fff; border-color: var(--a-line); color: var(--a-ink); }
.btn-danger  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn-sm      { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block   { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--a-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--a-line); border-radius: 9px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--a-brand-2); box-shadow: 0 0 0 3px rgba(249, 115, 22, .13);
}
.field textarea { min-height: 110px; resize: vertical; }
.field .help { font-size: 12px; color: var(--a-mute); margin-top: 5px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.f3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--a-brand); }

.alert { border-radius: var(--a-r); padding: 12px 16px; margin-bottom: 18px; font-size: 13.5px; }
.a-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.a-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.a-warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.a-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select {
  padding: 9px 13px; border: 1px solid var(--a-line); border-radius: 9px; background: #fff; outline: none;
}
.filters input:focus, .filters select:focus { border-color: var(--a-brand-2); }
.filters input[type=search] { min-width: 240px; }

.pager { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 36px; height: 36px; display: grid; place-items: center; padding: 0 10px;
  border: 1px solid var(--a-line); border-radius: 9px; background: #fff; font-size: 13px;
}
.pager .is-active { background: var(--a-brand); border-color: var(--a-brand); color: #fff; font-weight: 700; }
.pager a:hover { border-color: var(--a-brand-2); }

.empty-state { text-align: center; padding: 54px 20px; color: var(--a-mute); }
.empty-state .big { font-size: 46px; margin-bottom: 10px; }

.split { display: grid; grid-template-columns: 1.35fr .65fr; gap: 20px; align-items: start; }
.muted { color: var(--a-mute); }
.mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mb-2 { margin-bottom: 20px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nowrap { white-space: nowrap; }

.bulk-bar {
  display: none; gap: 10px; align-items: center; background: #111827; color: #fff;
  padding: 10px 16px; border-radius: var(--a-r); margin-bottom: 14px;
}
.bulk-bar.is-on { display: flex; }
.bulk-bar select { background: #1f2937; border: 1px solid #374151; color: #fff; border-radius: 8px; padding: 7px 11px; }

@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
  .f3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .a-side {
    position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: 0 0 50px rgba(0,0,0,.35);
  }
  .a-side.is-open { transform: none; }
  .a-burger { display: block; }
  .a-body { padding: 18px 14px 50px; }
  .a-top { padding: 12px 14px; }
  .f2 { grid-template-columns: 1fr; }
}

.thumb-up { position: relative; display: inline-block; cursor: pointer; }
.thumb-up .thumb { display: block; transition: opacity .15s; }
.thumb-plus {
  position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; border-radius: 50%;
  background: #e0127a; color: #fff; font-size: 14px; line-height: 18px; text-align: center; font-weight: 700;
}
.thumb-up:hover .thumb, .thumb-up.is-drag .thumb { outline: 2px solid #e0127a; }
.thumb-up.is-busy .thumb { opacity: .35; }
.thumb-up.is-done .thumb-plus { background: #16a34a; }

/* password show / hide */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px !important; }
.pw-eye {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; background: transparent; color: var(--a-soft);
  cursor: pointer; display: grid; place-items: center; border-radius: 8px;
}
.pw-eye:hover { color: var(--a-brand); background: #fff4fa; }

/* camera upload */
.pic { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cam-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  background: #fff4fa; color: #e0127a; border: 1px solid #f7c3de; border-radius: 8px;
  min-width: 44px; height: 30px; font-size: 15px; font-weight: 600;
}
.cam-btn em { display: none; font-style: normal; font-size: 14px; }
.pic.is-busy { opacity: .5; pointer-events: none; }
.pic.is-done .cam-btn { background: #ecfdf5; color: #16a34a; border-color: #a7f3d0; }
.cam-big { width: 100%; justify-content: center; margin-bottom: 10px; padding: 14px; font-size: 16px; cursor: pointer; }
input[type=file] { max-width: 100%; }

/* phone: product list becomes cards, bigger touch targets */
@media (max-width: 820px) {
  .a-body input, .a-body select, .a-body textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .filters input[type=search], .filters select { min-width: 0; flex: 1 1 140px; }
  .bulk-bar.is-on { flex-wrap: wrap; }
  .a-top .right .btn, .a-user span:last-child { display: none; }
  .card-body { padding: 14px; }

  table.cards-m, table.cards-m tbody { display: block; }
  table.cards-m thead { display: none; }
  table.cards-m tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; position: relative;
    padding: 14px; border-bottom: 1px solid #eef0f3;
  }
  table.cards-m td { display: block; padding: 0; border: 0; }
  table.cards-m td.c-chk { position: absolute; top: 14px; right: 14px; }
  table.cards-m td.c-chk input { width: 22px; height: 22px; }
  table.cards-m td.c-pic { flex: 0 0 96px; }
  table.cards-m .thumb { width: 96px; height: 96px; }
  table.cards-m .cam-btn { width: 96px; height: 40px; }
  table.cards-m .cam-btn em { display: inline; }
  table.cards-m td.c-pic + td { flex: 1 1 0; min-width: 0; padding-right: 30px; }
  table.cards-m td.c-pic + td b { font-size: 16px; }
  table.cards-m td.c-cat, table.cards-m td.c-pack, table.cards-m td.c-rate { flex: 0 0 auto; font-size: 13px; }
  table.cards-m td.c-act { flex: 1 1 100%; display: flex; gap: 8px; }
  table.cards-m td.c-act .btn { flex: 1; justify-content: center; }
}
