:root {
  --ink: #191816;
  --muted: #706b64;
  --paper: #f7f3ed;
  --surface: #fff;
  --line: #e8e0d6;
  --accent: #ff5a3c;
  --accent-dark: #db4026;
  --lime: #c7f36b;
  --green: #178a55;
  --danger: #be3e35;
  --sidebar: #171815;
  --shadow: 0 24px 65px rgba(46, 34, 20, .10);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
img { max-width: 100%; display: block; }
code { padding: 2px 6px; border-radius: 6px; background: #eee7dc; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px; background: var(--sidebar); color: #fff; display: flex; flex-direction: column; z-index: 20; }
.admin-brand { display: flex; align-items: center; gap: 11px; }
.admin-brand > span { width: 42px; height: 42px; border-radius: 14px; background: var(--accent); display: grid; place-items: center; font-size: 20px; font-weight: 900; transform: rotate(-5deg); }
.admin-brand > div { display: grid; gap: 2px; }
.admin-brand strong { font-size: 18px; }
.admin-brand small { color: rgba(255,255,255,.5); font-size: 10px; }
.sidebar nav { display: grid; gap: 7px; margin-top: 46px; }
.sidebar nav a { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 13px; color: rgba(255,255,255,.65); font-size: 13px; font-weight: 800; }
.sidebar nav a span { width: 21px; text-align: center; font-size: 16px; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.08); }
.sidebar nav a.active { box-shadow: inset 3px 0 var(--lime); }
.sidebar-bottom { margin-top: auto; padding: 17px; border-radius: 16px; background: rgba(255,255,255,.06); display: grid; gap: 4px; }
.sidebar-bottom small { color: rgba(255,255,255,.46); }
.sidebar-bottom a { margin-top: 9px; color: var(--lime); font-size: 12px; }
.admin-main { min-width: 0; }
.admin-topbar { min-height: 78px; padding: 0 34px; background: rgba(247,243,237,.88); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 10; }
.admin-topbar > div { display: grid; gap: 2px; }
.admin-topbar span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .11em; }
.admin-topbar strong { font-size: 15px; }
.menu-toggle { display: none; border: 0; background: transparent; font-size: 24px; }
.admin-content { width: min(1240px, calc(100% - 60px)); margin: 0 auto; padding: 44px 0 70px; }
.welcome-row, .page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.welcome-row h1, .page-heading h1 { margin: 10px 0 0; font-size: clamp(37px, 4vw, 56px); line-height: 1; letter-spacing: -.055em; }
.welcome-row p, .page-heading p { max-width: 650px; margin: 13px 0 0; color: var(--muted); line-height: 1.6; }
.admin-eyebrow { color: var(--accent); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.admin-btn { min-height: 48px; border: 0; border-radius: 13px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 900; transition: transform .2s, background .2s; }
.admin-btn:hover { transform: translateY(-2px); }
.admin-btn.primary { color: #fff; background: var(--accent); box-shadow: 0 13px 27px rgba(255,90,60,.22); }
.admin-btn.primary:hover { background: var(--accent-dark); }
.admin-btn.secondary { background: #fff; border: 1px solid var(--line); }
.admin-btn.compact { min-height: 40px; padding: 0 15px; font-size: 12px; }
.admin-btn.full { width: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 25px; }
.metric-grid article { min-height: 145px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 20px; display: flex; align-items: flex-start; gap: 15px; }
.metric-icon { flex: 0 0 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 13px; font-weight: 900; }
.metric-icon.coral { background: #ffe1d9; color: #b73e28; }
.metric-icon.lime { background: #e9f8c9; color: #527c18; }
.metric-icon.purple { background: #ebe0ff; color: #6a49b2; }
.metric-icon.blue { background: #dcecff; color: #316cae; }
.metric-grid div { display: grid; gap: 4px; }
.metric-grid small { color: var(--muted); font-size: 11px; }
.metric-grid strong { margin-top: 4px; font-size: 24px; letter-spacing: -.035em; }
.metric-grid p { margin: 0; color: #9b958c; font-size: 10px; }
.admin-card { margin-bottom: 24px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 12px 35px rgba(46,34,20,.04); overflow: hidden; }
.card-heading { min-height: 86px; padding: 22px 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.card-heading h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.04em; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 840px; }
th { padding: 13px 20px; color: #989189; background: #fbf8f3; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
td { padding: 14px 20px; border-top: 1px solid #f0ebe4; font-size: 12px; vertical-align: middle; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 285px; }
.product-cell img { width: 56px; height: 52px; border-radius: 12px; object-fit: cover; background: #f3eee7; }
.product-cell div { display: grid; gap: 4px; }
.product-cell small { max-width: 230px; color: var(--muted); line-height: 1.4; }
.table-tag, .status { display: inline-flex; padding: 7px 9px; border-radius: 999px; font-size: 9px; font-weight: 900; }
.table-tag { background: #f0ebe4; color: #5d574f; }
.status.active { background: #ddf4e7; color: #207849; }
.status.inactive { background: #f3e7e5; color: #975048; }
.row-actions { display: flex; align-items: center; gap: 9px; }
.row-actions a, .row-actions button { border: 0; background: transparent; color: #4b6fab; cursor: pointer; font-size: 11px; font-weight: 800; }
.row-actions button { color: var(--danger); }
.row-actions form { margin: 0; }
.admin-empty { padding: 50px 25px; text-align: center; }
.admin-empty h3 { margin: 0; }
.admin-empty p { margin: 7px 0 0; color: var(--muted); }
.order-list { display: grid; }
.order-list article { padding: 17px 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #f0ebe4; }
.order-list article:first-child { border-top: 0; }
.order-list article > div { display: grid; gap: 4px; }
.order-list article > div:last-child { text-align: right; }
.order-list span { color: var(--muted); font-size: 11px; }
.alert { margin-bottom: 22px; padding: 13px 16px; border-radius: 13px; font-size: 12px; font-weight: 800; }
.alert.success { background: #dcf4e7; color: #146b41; }
.alert.danger { background: #f9e2df; color: #a2382f; }
.editor-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 24px; align-items: start; }
.form-card { overflow: visible; }
.admin-form { padding: 25px; display: grid; gap: 18px; }
.admin-form label { display: grid; gap: 7px; }
.admin-form label > span { font-size: 11px; font-weight: 900; }
.admin-form label small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 13px 14px; outline: 0; color: var(--ink); }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,60,.09); }
.field-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.switch-row { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; }
.switch-row > div { display: grid; gap: 3px; }
.switch-row small { color: var(--muted); font-size: 10px; }
.switch { position: relative; width: 46px; height: 27px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d8d2ca; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(19px); }
.image-preview { margin: 25px 25px 0; padding: 8px; border-radius: 20px; background: #f3eee7; }
.image-preview img { width: 100%; aspect-ratio: 1.18; object-fit: cover; border-radius: 14px; }
.image-card > .admin-btn { width: calc(100% - 50px); margin: 0 25px 25px; }
.or-divider { display: flex; align-items: center; gap: 10px; color: #aaa39b; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.or-divider::before, .or-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.settings-grid .wide { grid-column: 1 / -1; }
.settings-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

.login-page { min-height: 100vh; background: #171815; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-panel { padding: clamp(35px, 7vw, 100px); background: var(--paper); display: flex; flex-direction: column; justify-content: center; }
.login-panel .admin-brand { margin-bottom: 70px; }
.login-panel .admin-brand small { color: var(--muted); }
.login-copy h1 { margin: 10px 0 0; font-size: clamp(52px, 7vw, 82px); line-height: .95; letter-spacing: -.065em; }
.login-copy p { max-width: 520px; color: var(--muted); line-height: 1.7; }
.login-form { padding: 25px 0 0; max-width: 520px; }
.login-hint { max-width: 520px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.login-art { padding: 50px; display: grid; place-items: center; background: radial-gradient(circle at 20% 20%, #454a2f, #171815 62%); }
.art-card { width: min(510px, 100%); min-height: 600px; padding: 45px; border-radius: 36px; color: #fff; background: linear-gradient(145deg, #ff684c, #d43e89); box-shadow: 0 35px 100px rgba(0,0,0,.35); display: flex; flex-direction: column; justify-content: space-between; transform: rotate(3deg); }
.art-card > span { font-size: 11px; text-transform: uppercase; letter-spacing: .16em; font-weight: 900; }
.art-card > strong { font-size: clamp(50px, 6vw, 78px); line-height: .95; letter-spacing: -.06em; }
.mini-stats { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 12px; }
.mini-stats b { color: var(--lime); font-size: 28px; }
.mini-stats small { color: rgba(255,255,255,.66); }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 250px; transition: transform .25s; box-shadow: 20px 0 60px rgba(0,0,0,.28); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .admin-topbar { padding: 0 20px; }
  .admin-content { width: min(100% - 30px, 1240px); padding-top: 30px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .wide, .settings-actions { grid-column: auto; }
}
@media (max-width: 560px) {
  .admin-topbar > div { display: none; }
  .welcome-row, .page-heading { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .field-grid.two { grid-template-columns: 1fr; }
  .card-heading { padding: 18px; }
  .admin-form { padding: 18px; }
  .order-list article { align-items: flex-start; flex-direction: column; }
  .order-list article > div:last-child { text-align: left; }
  .login-panel { padding: 30px 24px; }
  .login-panel .admin-brand { margin-bottom: 45px; }
}
