:root {
  --primary: #c0392b;
  --dark: #111111;
  --bg: #f6f7f9;
  --radius: 10px;
  --maxw: 1000px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); color: #1c1e21; background: var(--bg); line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
header { background: var(--dark); color: #fff; }
header .top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 14px 16px; max-width: var(--maxw); margin: 0 auto; }
.logo { font-size: 1.25rem; font-weight: 700; }
.logo .tag { font-weight: 400; font-size: .8rem; opacity: .7; }
nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
nav a { color: #fff; opacity: .85; }
nav a.on { opacity: 1; border-bottom: 2px solid var(--primary); }
nav a.admin-link { color: #ffd54d; }
main { flex: 1 1 auto; padding: 24px 16px 48px; }
h1 { margin-top: 0; } h2 { margin-top: 0; }
.card { background: #fff; border: 1px solid #e3e6ea; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card.narrow { max-width: 480px; }
.card.wide { max-width: 800px; }
.meta { color: #8a8f98; font-size: .85rem; }
.muted { color: #8a8f98; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid .product .price { font-size: 1.15rem; font-weight: 700; color: #111; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .95rem; }
label.check { font-weight: 400; display: flex; gap: 10px; align-items: center; }
input, textarea, select {
  width: 100%; padding: 10px 12px; margin-top: 5px;
  border: 1.5px solid #cfd4da; border-radius: 8px; font: inherit; font-weight: 400; background: #fff;
}
input[type=checkbox] { width: 22px; height: 22px; margin: 0; flex: none; }
.btn {
  display: inline-block; background: var(--primary); border: none; color: #fff;
  padding: 12px 20px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; margin-top: 6px;
}
.btn:hover { background: color-mix(in srgb, var(--primary) 85%, black); text-decoration: none; }
.btn.small { padding: 9px 13px; font-size: .88rem; margin: 0 3px 4px 0; }
.btn.danger { background: #6b7280; }
.btn.danger:hover { background: #4b5563; }
.btn.ghost { background: #fff; color: var(--dark); }
.btn.wide { width: 100%; font-size: 1.05rem; padding: 15px; }
.flash { padding: 12px 15px; border-radius: 8px; margin: 14px 0; font-size: .95rem; }
.flash.success { background: #e7f6ec; color: #1e6b3a; border: 1px solid #bfe5cc; }
.flash.error { background: #fdecec; color: #a02828; border: 1px solid #f2c4c4; }
.flash.info { background: #eaf1fb; color: #1f4e8c; border: 1px solid #c5d8f3; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid #e9ecef; vertical-align: top; }
.table th { background: #f1f3f5; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: #555; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs a { padding: 9px 15px; background: #fff; border: 1.5px solid #d7dbe0; border-radius: 999px; color: #333; font-weight: 600; font-size: .92rem; }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
footer { background: var(--dark); color: #cfd4da; padding: 28px 0 18px; margin-top: 40px; }
footer h3 { margin: 0 0 6px; color: #fff; font-size: .95rem; }
footer a { color: #ffd54d; }
footer .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 18px; }
@media (max-width: 640px) { footer .cols { grid-template-columns: 1fr; } }
.fine { font-size: .8rem; opacity: .7; border-top: 1px solid #333; padding-top: 12px; }
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--dark); color: #fff; padding: 14px 0; box-shadow: 0 -4px 18px rgba(0,0,0,.25); }
.cookie-banner .wrap { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.cookie-banner button { background: var(--primary); border: none; color: #fff; padding: 10px 16px; border-radius: 7px; cursor: pointer; font: inherit; font-weight: 600; }
.cookie-banner button + button { background: #4b5563; }
.cookie-banner a { color: #ffd54d; }
.hero { background: var(--dark); color: #fff; }
.hero h1 { font-size: 1.6rem; }
.hero-text { font-size: 1.05rem; opacity: .9; }

/* ================= ADMIN (phone-first) ================= */
body.admin { padding-bottom: 86px; }
body.admin .admin-main { padding-top: 16px; padding-bottom: 24px; }
.admin-top { background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 40; }
.admin-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; }
.admin-id { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.admin-badge { background: var(--primary); border-radius: 6px; padding: 3px 8px; font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.admin-top-actions { display: flex; align-items: center; gap: 8px; }
.admin-user { font-size: .85rem; opacity: .85; }

/* dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0 24px; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: #fff; border: 1px solid #e3e6ea; border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-tile:active { background: #eef0f3; }
.stat-tile .st-ico { font-size: 1.5rem; }
.stat-tile .st-n { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-tile .st-l { font-size: .82rem; color: #666; font-weight: 600; }
.alert-box { display: block; background: #fff6e5; border: 1.5px solid #f0c36d; color: #7a5410; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-size: .95rem; }
.alert-box.ok { background: #e7f6ec; border-color: #bfe5cc; color: #1e6b3a; }
.alert-box:active { filter: brightness(.97); }
.action-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.action-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #e3e6ea; border-radius: var(--radius); padding: 14px 16px; color: #111; }
.action-row:active { background: #eef0f3; }
.action-row .ar-ico { font-size: 1.6rem; }
.action-row small { color: #666; }
.action-row .arr { margin-left: auto; font-size: 1.4rem; color: #aaa; }

/* content items: rows with big toggle */
.item-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 0; border-bottom: 1px solid #e9ecef; }
.item-row:last-of-type { border-bottom: none; }
.item-info { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.toggle { flex: none; }
.toggle input[type=checkbox] {
  width: 54px; height: 30px; min-height: 0;
  appearance: none; -webkit-appearance: none;
  background: #cfd4da; border-radius: 999px; position: relative; cursor: pointer;
  transition: background .15s; vertical-align: middle;
}
.toggle input[type=checkbox]:checked { background: var(--primary); }
.toggle input[type=checkbox]::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.toggle input[type=checkbox]:checked::after { left: 27px; }

/* users */
.user-card { border: 1px solid #e3e6ea; border-radius: var(--radius); padding: 13px 14px; margin-bottom: 12px; background: #fff; }
.user-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.user-row { font-size: .9rem; margin-bottom: 10px; }
.user-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.user-actions .grow { flex: 1; min-width: 140px; margin: 0; }
.user-actions select { padding: 13px; font-size: 1rem; font-weight: 600; }

/* newsletters */
.mail-card { border: 1px solid #e3e6ea; border-radius: var(--radius); padding: 13px 14px; margin-bottom: 12px; background: #fff; }
.mail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.chip { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.chip.sent { background: #e7f6ec; color: #1e6b3a; }
.chip.sched { background: #eaf1fb; color: #1f4e8c; }
.chip.ready { background: #f1f3f5; color: #555; }
.mail-body { color: #555; font-size: .92rem; margin: 4px 0 8px; }

/* design */
.color-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.color-row input[type=color] { width: 60px; height: 48px; padding: 4px; margin: 0; flex: none; }
.color-row input[type=text] { flex: 1; }

/* bottom tab bar */
.admin-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; background: #fff; border-top: 1.5px solid #e3e6ea;
  padding-bottom: env(safe-area-inset-bottom);
}
.admin-bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px 8px; color: #777; font-size: .72rem; font-weight: 700;
}
.admin-bottom a .ico { font-size: 1.35rem; line-height: 1; }
.admin-bottom a.on { color: var(--primary); }
.admin-bottom a.on .ico { transform: scale(1.08); }

/* admin: inline text editing (pen buttons) */
.pen {
  display: inline-block; vertical-align: middle; margin-left: 4px;
  background: none; border: none; cursor: pointer; font-size: .85em;
  color: var(--primary); opacity: .8; padding: 4px;
}
.pen:active { opacity: 1; }
h1 .pen, h2 .pen, h3 .pen { font-size: .9em; }
/* admin: background image support */
body { background-image: var(--img-bg); background-size: cover; background-attachment: fixed; background-position: center; }
header { background-image: var(--img-header); background-size: cover; background-position: center; }
.card.hero { background-image: var(--img-hero); background-size: cover; background-position: center; background-blend-mode: multiply; }
