:root {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --ink: #1d1f23;
  --muted: #6b6f78;
  --line: #e4e2dc;
  --soft: #f8f7f4;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --danger: #b4322a;
  --ok: #24764a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 8px 24px rgba(20, 20, 30, .06);
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border-radius: 20px; box-shadow: var(--shadow); padding: 36px 28px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.login-card p.sub { margin: 0 0 24px; color: var(--muted); }
.demo-hint { background: var(--soft); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 20px; }
.demo-hint code { font-weight: 700; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #16181c; color: #d9dbe0; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; align-self: start; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.brand b { display: block; color: #fff; font-size: 14px; line-height: 1.2; }
.brand small { color: #8b8f99; font-size: 12px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f7480; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: #cfd2d8; text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { background: #22252b; color: #fff; }
.nav a.active { background: #2a2e36; color: #fff; }
.nav a .count { margin-left: auto; font-size: 12px; color: #8b8f99; font-weight: 600; }
.sidebar .spacer { flex: 1; }
.sidebar .foot a { color: #9ea2ab; font-size: 13px; text-decoration: none; display: block; padding: 6px 10px; }
.sidebar .foot a:hover { color: #fff; }
.main { padding: 28px 32px 120px; min-width: 0; }
.topbar { display: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.crumb { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13px; display: inline-block; margin-bottom: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); padding: 9px 16px; border-radius: 10px; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: #cfccc4; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; padding: 12px; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--ink); border-color: #cfccc4; }

/* ---------- List ---------- */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.list { padding: 6px; }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; }
.row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.row:hover { background: var(--soft); }
.thumb { width: 64px; height: 48px; border-radius: 9px; background: var(--soft) center/cover no-repeat; border: 1px solid var(--line); }
.row-title { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #e9f4ee; color: var(--ok); }
.pill.off { background: #f1efea; color: var(--muted); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* ---------- Form ---------- */
.form { display: grid; gap: 18px; }
.section { padding: 22px; }
.section h3 { margin: 0 0 16px; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.field .help { color: var(--muted); font-size: 12.5px; }
.lang-badge { font-size: 10.5px; font-weight: 800; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.input, .field input[type=text], .field input[type=number], .field input[type=email], .field input[type=password], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.money { position: relative; }
.money span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money input { padding-left: 38px !important; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: #d8d5ce; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 21px; }

.lang-tabs { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.lang-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted); }
.lang-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Uploads ---------- */
.drop { border: 1.5px dashed #cdc9bf; border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); background: var(--soft); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); color: var(--ink); }
.drop strong { color: var(--ink); }
.drop small { display: block; margin-top: 4px; font-size: 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 10px; }
.gitem { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--soft) center/cover no-repeat; border: 1px solid var(--line); cursor: grab; }
.gitem.dragging { opacity: .4; }
.gitem .tools { position: absolute; inset: auto 6px 6px auto; display: flex; gap: 4px; }
.gitem .tools button { width: 26px; height: 26px; border-radius: 7px; border: 0; background: rgba(15,15,20,.72); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 13px; }
.gitem .tools button:hover { background: rgba(15,15,20,.92); }
.gitem .cover { position: absolute; left: 6px; top: 6px; font-size: 10.5px; font-weight: 800; background: rgba(255,255,255,.92); padding: 2px 7px; border-radius: 6px; }
.gitem.loading { display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 700; cursor: default; }
.single-img { width: 220px; aspect-ratio: 4 / 3; }

.savebar { position: fixed; left: 250px; right: 0; bottom: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 32px; display: flex; justify-content: flex-end; gap: 10px; align-items: center; z-index: 5; }
.savebar .status { margin-right: auto; color: var(--muted); font-size: 13px; font-weight: 600; }

/* ---------- Orders ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.status { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; display: inline-block; text-transform: capitalize; }
.status.pendente { background: #fff4dc; color: #8a5b00; }
.status.pago { background: #e5f4ec; color: var(--ok); }
.status.enviado { background: #e6eefc; color: #2747a0; }
.status.entregue { background: #eceaf9; color: #4a3a9c; }
.status.cancelado { background: #f9e7e5; color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; }
.stat small { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; margin-top: 4px; }
.order-detail { background: var(--soft); border-radius: 10px; padding: 14px; margin-top: 10px; font-size: 14px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 16px; bottom: 80px; display: grid; gap: 8px; z-index: 50; }
.toast { background: #16181c; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); max-width: 340px; animation: in .2s ease; }
.toast.err { background: var(--danger); }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #16181c; color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: transparent; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 0 4px; }
  .topbar b { font-size: 15px; }
  .main { padding: 20px 16px 120px; }
  .grid2 { grid-template-columns: 1fr; }
  .savebar { left: 0; padding: 12px 16px; }
  .row { grid-template-columns: 52px 1fr; }
  .thumb { width: 52px; height: 40px; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .stats { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { border: 0; padding: 4px 14px; }
}
