/* ==========================================================================
   Suplytech · admin panel
   ========================================================================== */

:root {
  --ink: #0b0d10;
  --ink-2: #14171c;
  --ink-3: #1e232b;
  --paper: #f7f6f2;
  --paper-2: #efeee8;
  --white: #ffffff;
  --orange: #ff5a1f;
  --orange-2: #ff7a45;
  --orange-soft: #ffe9df;
  --green: #1f9d63;
  --amber: #b97708;
  --red: #c0392b;
  --muted: #6b6f76;
  --muted-2: #9a9ea6;
  --line: rgba(11, 13, 16, 0.12);
  --line-soft: rgba(11, 13, 16, 0.08);
  --img-bg: #f4f3ef;
  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--orange); color: var(--ink); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(11, 13, 16, 0.18); border-radius: 20px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: rgba(11, 13, 16, 0.32); }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono { font-family: var(--font-mono); }

/* brand */

.brand { display: inline-flex; align-items: center; gap: 10px; }

.brand-mark { width: 38px; height: 38px; color: var(--orange); flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; }

.brand-text { display: flex; flex-direction: column; gap: 1px; }

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}

.brand-r { font-size: 7px; vertical-align: super; font-weight: 500; }

.brand-tag {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.brand-light { color: var(--white); }
.brand-light .brand-tag { color: rgba(255, 255, 255, 0.42); }

/* buttons */

.btn-primary,
.btn-ghost,
.btn-mini,
.btn-danger,
.btn-danger-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 11px 16px;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: var(--orange-2); box-shadow: 0 8px 20px rgba(255, 90, 31, 0.25); }
.btn-primary .icon { width: 14px; height: 14px; }

.btn-ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--white); }
.btn-ghost .icon { width: 14px; height: 14px; }

.btn-mini {
  border-radius: 7px;
  padding: 8px 11px;
  border-color: var(--line);
  background: var(--white);
  font-size: 10px;
}

.btn-mini:hover { border-color: var(--ink); }
.btn-mini .icon { width: 12px; height: 12px; }

.btn-danger { background: var(--red); color: var(--white); border-radius: 999px; padding: 11px 18px; }
.btn-danger:hover { background: #a53024; }

.btn-danger-ghost { background: transparent; color: var(--red); border-color: rgba(192, 57, 43, 0.25); border-radius: 999px; }
.btn-danger-ghost:hover { background: #fbece9; border-color: var(--red); }
.btn-danger-ghost .icon { width: 14px; height: 14px; }

.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.icon-btn .icon { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow.light { color: rgba(255, 255, 255, 0.5); }

.pulse-dot { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); flex: none; }
.pulse-dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--orange); animation: pulse 2.4s ease-out infinite; }

@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  70%, 100% { transform: scale(1.8); opacity: 0; }
}

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

.login-view { display: grid; grid-template-columns: 46% 54%; min-height: 100dvh; }

.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 38px 44px;
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}

.login-art-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url('/img/hero-flatlay.webp') center / cover no-repeat;
  opacity: 0.26;
  filter: grayscale(0.4);
}

.login-art::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 500px at 80% 20%, rgba(255, 90, 31, 0.18), transparent 65%),
    linear-gradient(180deg, rgba(11, 13, 16, 0.55), var(--ink) 88%);
}

.login-art-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.login-chip {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.login-art-copy { margin-top: auto; max-width: 500px; }

.login-art-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 4.8vw, 72px);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.login-art-copy > p:not(.eyebrow) {
  max-width: 380px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
}

.login-art-foot {
  display: flex;
  gap: 38px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.login-art-foot div { display: flex; flex-direction: column; gap: 2px; }
.login-art-foot strong { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1; color: var(--orange); }
.login-art-foot span { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.4); }

.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 44px 32px; background: var(--paper); }

.login-card { width: min(370px, 100%); }

.login-kicker { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; }

.login-card h2 { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 8px; }
.login-sub { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 26px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.field input,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11, 13, 16, 0.05); }

#loginForm { display: flex; flex-direction: column; gap: 14px; }
#loginForm .btn-primary { padding: 13px 16px; font-size: 12px; }

.form-error { color: var(--red); font-size: 11px; line-height: 1.4; min-height: 0; }
.form-error:empty { display: none; }

.login-divider { display: flex; align-items: center; gap: 10px; margin: 24px 0 14px; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.login-note { font-size: 10.5px; line-height: 1.55; color: var(--muted); margin-bottom: 22px; }

.back-link { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color 0.2s; }
.back-link:hover { color: var(--orange); }

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

.admin-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100dvh; }

.side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 26px 18px 20px;
  background: var(--ink);
  color: var(--white);
  overflow-y: auto;
  z-index: 60;
}

.side-brand { margin-bottom: 38px; padding-left: 6px; }
.side-brand .brand-mark { width: 34px; height: 34px; }
.side-brand .brand-name { font-size: 15px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-label { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.3); padding: 0 12px 8px; }

.side-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  transition: background 0.2s, color 0.2s;
}

.side-item .icon { width: 16px; height: 16px; }
.side-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--white); }
.side-item.active { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.side-item.active::before { content: ''; position: absolute; left: -18px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }

.side-note { display: flex; gap: 8px; margin-top: auto; padding: 11px; border: 1px solid rgba(255, 90, 31, 0.22); border-radius: 9px; background: rgba(255, 90, 31, 0.07); }
.side-note .icon { width: 14px; height: 14px; color: var(--orange); margin-top: 1px; }
.side-note p { font-family: var(--font-mono); font-size: 7.5px; line-height: 1.6; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.45); text-transform: uppercase; }

.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.side-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: var(--ink); font-family: var(--font-mono); font-size: 9px; font-weight: 600; flex: none; }
.side-user span:last-child { display: flex; flex-direction: column; min-width: 0; }
.side-user strong { font-size: 10.5px; font-weight: 600; }
.side-user small { font-size: 8.5px; color: rgba(255, 255, 255, 0.38); }

.side-logout { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 50%; background: transparent; color: rgba(255, 255, 255, 0.55); transition: background 0.2s, color 0.2s, border-color 0.2s; flex: none; }
.side-logout:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.side-logout .icon { width: 14px; height: 14px; }

/* main */

.admin-main { min-width: 0; padding: 30px clamp(20px, 3.2vw, 44px) 36px; }

.admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.admin-top h1 { font-family: var(--font-display); font-size: 33px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.admin-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; max-width: 480px; }
.admin-top-actions { display: flex; align-items: center; gap: 8px; flex: none; padding-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }

.stat-card { position: relative; display: flex; flex-direction: column; padding: 15px 16px 14px; background: var(--white); border: 1px solid var(--line-soft); border-radius: 13px; }
.stat-icon { position: absolute; top: 14px; right: 14px; color: var(--muted-2); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-icon.warn { color: var(--orange); }
.stat-label { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat-card strong { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin: 9px 0 3px; }
.stat-card small { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.04em; color: var(--muted-2); }

/* table */

.panel { background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }

.search-box { display: flex; align-items: center; gap: 8px; width: min(330px, 100%); padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); transition: border-color 0.2s, background 0.2s; }
.search-box:focus-within { border-color: var(--ink); background: var(--white); }
.search-box .icon { width: 14px; height: 14px; color: var(--muted-2); }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; padding: 9px 0; font-size: 11.5px; outline: none; }

.panel-tools { display: flex; align-items: center; gap: 10px; }
.panel-tools select { appearance: none; padding: 8px 28px 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%236b6f76' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 10px center; font-size: 10.5px; cursor: pointer; outline: none; }
.table-count { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); white-space: nowrap; }

.table-scroll { overflow-x: auto; }

.product-table { width: 100%; min-width: 720px; border-collapse: collapse; }

.product-table th {
  padding: 9px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: #faf9f6;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.product-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 11.5px; }
.product-table tbody tr { transition: background 0.15s; }
.product-table tbody tr:hover { background: #fbfaf7; }
.product-table tbody tr:last-child td { border-bottom: 0; }

.cell-product { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.cell-product img { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; background: var(--img-bg); border: 1px solid var(--line-soft); flex: none; }
.cell-product > div { display: flex; flex-direction: column; min-width: 0; }
.cell-product strong { font-size: 11.5px; font-weight: 600; line-height: 1.25; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-product span { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.04em; color: var(--muted-2); margin-top: 2px; }

.chip { display: inline-flex; padding: 4px 7px; border-radius: 5px; background: var(--paper-2); font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.03em; color: var(--muted); white-space: nowrap; }

.price-cell strong { display: block; font-family: var(--font-display); font-size: 12.5px; font-weight: 700; }
.price-cell small { display: block; font-family: var(--font-mono); font-size: 7.5px; color: var(--muted-2); text-decoration: line-through; }

.stock-pill { display: inline-flex; padding: 4px 7px; border-radius: 5px; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.04em; white-space: nowrap; }
.stock-pill.ok { background: #e8f5ee; color: #157347; }
.stock-pill.low { background: #fbf1dc; color: #96620a; }
.stock-pill.out { background: #fbe9e7; color: var(--red); }

.star-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #c9c7bf; transition: color 0.2s, background 0.2s; }
.star-btn .icon { width: 15px; height: 15px; }
.star-btn:hover { background: var(--orange-soft); color: var(--orange); }
.star-btn.active { color: var(--orange); }
.star-btn.active .icon { fill: var(--orange); }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }

.row-btn { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.row-btn .icon { width: 14px; height: 14px; }
.row-btn:hover { background: var(--paper-2); border-color: var(--line); color: var(--ink); }
.row-btn.danger:hover { background: #fbece9; border-color: rgba(192, 57, 43, 0.2); color: var(--red); }

.table-empty { padding: 44px 20px !important; text-align: center; color: var(--muted); }
.table-empty strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--ink); margin-bottom: 3px; }

.admin-footer-note { margin-top: 16px; text-align: center; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.05em; color: var(--muted-2); }

/* -------------------------------- modal ---------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 13, 16, 0.55);
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.modal.open { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  display: flex;
  flex-direction: column;
  width: min(820px, 100%);
  max-height: calc(100dvh - 48px);
  margin: auto;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: rise 0.3s var(--ease);
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 24px; background: var(--white); border-bottom: 1px solid var(--line-soft); flex: none; }
.modal-head .eyebrow { margin-bottom: 5px; }
.modal-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }

.modal-body { padding: 18px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }

.form-section { padding: 16px; background: var(--white); border: 1px solid var(--line-soft); border-radius: 11px; }

.form-section-title {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 13px;
}

.form-section-title span { margin-left: 7px; font-family: var(--font-body); font-size: 9.5px; letter-spacing: 0; text-transform: none; color: var(--muted-2); font-weight: 400; }

.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-title-row .form-section-title { margin-bottom: 0; }
.image-count { font-family: var(--font-mono); font-size: 8px; color: var(--muted-2); letter-spacing: 0.04em; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.span-2 { grid-column: 1 / -1; }

.check-line { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; font-size: 11.5px; cursor: pointer; }
.check-line input { width: 15px; height: 15px; accent-color: var(--orange); margin: 0; cursor: pointer; }

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 20px 16px;
  border: 1.5px dashed rgba(255, 90, 31, 0.45);
  border-radius: 10px;
  background: rgba(255, 90, 31, 0.03);
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.upload-zone:hover, .upload-zone.dragover { background: rgba(255, 90, 31, 0.07); border-color: var(--orange); }
.upload-zone .icon { width: 23px; height: 23px; color: var(--orange); margin-bottom: 4px; }
.upload-zone strong { font-size: 11px; font-weight: 600; }
.upload-zone span { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.03em; color: var(--muted-2); }

.image-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.image-list:empty { display: none; }

.img-card { position: relative; aspect-ratio: 1; border: 1px solid var(--line-soft); border-radius: 7px; overflow: hidden; background: var(--img-bg); }
.img-card.is-main { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.img-card img { width: 100%; height: 100%; object-fit: cover; }

.main-tag { position: absolute; top: 4px; left: 4px; padding: 3px 5px; border-radius: 3px; background: var(--orange); color: var(--ink); font-family: var(--font-mono); font-size: 6.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; z-index: 2; }

.img-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 4px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.72)); }
.img-tools button { display: grid; place-items: center; width: 21px; height: 21px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.22); color: var(--white); transition: background 0.15s, color 0.15s; }
.img-tools button:hover { background: var(--white); color: var(--ink); }
.img-tools button.remove:hover { background: var(--red); color: var(--white); }
.img-tools .icon { width: 10px; height: 10px; }
.img-tools button:disabled { opacity: 0.25; cursor: default; }

.url-row { display: flex; gap: 7px; margin-top: 9px; }
.url-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); font-size: 10.5px; outline: none; }
.url-row input:focus { border-color: var(--ink); }
.upload-status { font-family: var(--font-mono); font-size: 8px; color: var(--muted); margin-top: 6px; min-height: 10px; }
.upload-status.error { color: var(--red); }
.upload-status.success { color: var(--green); }

.spec-list { display: flex; flex-direction: column; gap: 7px; }

.spec-row { display: grid; grid-template-columns: 1fr 1.4fr 29px; gap: 7px; }

.spec-row input { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); font-size: 10.5px; outline: none; }
.spec-row input:focus { border-color: var(--ink); }
.spec-row .remove-spec { display: grid; place-items: center; border: 0; border-radius: 7px; background: var(--paper-2); color: var(--muted); transition: background 0.2s, color 0.2s; }
.spec-row .remove-spec:hover { background: #fbece9; color: var(--red); }
.spec-row .remove-spec .icon { width: 12px; height: 12px; }

.spec-empty { font-size: 10px; color: var(--muted-2); padding: 4px 0 2px; }

.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: var(--white); border-top: 1px solid var(--line-soft); flex: none; }
.modal-foot-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.is-hidden { display: none !important; }

/* confirm */

.confirm-modal { z-index: 130; align-items: center; }

.confirm-panel { width: min(390px, 100%); padding: 26px; border-radius: 15px; background: var(--white); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3); text-align: center; animation: rise 0.25s var(--ease); }

.confirm-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; background: #fbece9; color: var(--red); }
.confirm-icon .icon { width: 20px; height: 20px; }

.confirm-panel h3 { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.confirm-panel p { font-size: 11.5px; line-height: 1.6; color: var(--muted); margin-bottom: 20px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* -------------------------------- toast ---------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 11.5px;
  font-weight: 500;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
  max-width: calc(100% - 40px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------- responsive ------------------------------ */

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .image-list { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 960px) {
  .login-view { grid-template-columns: 1fr; }
  .login-art { min-height: 300px; padding: 24px 26px; gap: 26px; }
  .login-art-copy h1 { font-size: clamp(36px, 7vw, 50px); margin-bottom: 12px; }
  .login-art-copy > p:not(.eyebrow) { display: none; }
  .login-art-foot { display: none; }
  .login-form-wrap { padding: 40px 22px 56px; }
  .login-card { width: min(390px, 100%); }

  .admin-shell { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 9px 18px;
    overflow: visible;
  }
  .side-brand { margin: 0; padding: 0; }
  .side-brand .brand-tag { display: none; }
  .side-nav { flex-direction: row; align-items: center; gap: 4px; }
  .side-label, .side-item.active { display: none; }
  .side-item { padding: 8px 10px; font-size: 11px; }
  .side-note { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-user { display: none; }
  .admin-main { padding: 24px 20px 34px; }
}

@media (max-width: 760px) {
  .admin-top { flex-direction: column; align-items: stretch; gap: 16px; }
  .admin-top h1 { font-size: 28px; }
  .admin-top-actions { padding: 0; }
  .admin-top-actions .btn-primary, .admin-top-actions .btn-ghost { flex: 1; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; }
  .panel-tools { justify-content: space-between; }
  .panel-tools select { flex: 1; }

  .modal { padding: 0; }
  .modal-panel { max-height: 100dvh; min-height: 100dvh; border-radius: 0; width: 100%; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .image-list { grid-template-columns: repeat(3, 1fr); }
  .modal-foot { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .modal-foot-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .btn-danger-ghost { justify-content: center; }
  .confirm-modal { padding: 20px; }
  .login-chip { display: none; }

  .product-table { display: block; min-width: 0; }
  .product-table thead { display: none; }
  .product-table tbody { display: flex; flex-direction: column; }
  .product-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "product product star"
      "price stock actions";
    gap: 8px 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
  }
  .product-table tbody tr:last-child { border-bottom: 0; }
  .product-table td { padding: 0; border: 0; }
  .product-table td:nth-child(1) { grid-area: product; }
  .product-table td:nth-child(2) { display: none; }
  .product-table td:nth-child(3) { grid-area: price; }
  .product-table td:nth-child(4) { grid-area: stock; }
  .product-table td:nth-child(5) { grid-area: star; justify-self: end; }
  .product-table td:nth-child(6) { grid-area: actions; }
  .cell-product { min-width: 0; }
  .cell-product strong {
    max-width: 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .row-actions { justify-content: flex-end; }
  .table-empty { padding: 36px 16px !important; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card strong { font-size: 21px; }
  .stat-icon { display: none; }
  .side { gap: 10px; padding: 9px 14px; }
  .side-brand .brand-name { font-size: 13px; }
  .side-brand .brand-mark { width: 30px; height: 30px; }
  .side-item { font-size: 10px; padding: 7px 8px; }
  .side-item .icon { width: 14px; height: 14px; }
  .admin-main { padding: 20px 14px 30px; }
  .admin-sub { font-size: 10.5px; }
  .spec-row { grid-template-columns: 1fr 1fr 28px; }
  .image-list { grid-template-columns: repeat(2, 1fr); }
  .login-art { min-height: 230px; }
  .login-art-copy h1 { font-size: 32px; }
  .login-form-wrap { padding-top: 30px; }
  .login-card h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}