@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/be-vietnam-pro-400.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/be-vietnam-pro-500.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/be-vietnam-pro-600.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/be-vietnam-pro-700.ttf") format("truetype"); }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap; src: url("../assets/fonts/be-vietnam-pro-800.ttf") format("truetype"); }
@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/dm-serif-display-400.ttf") format("truetype"); }

:root {
  color-scheme: light;
  --brand-black: #0a0a08;
  --brand-brown: #665635;
  --brand-orange: #f66e24;
  --brand-orange-light: #ffad72;
  --ink: #1a1711;
  --muted: #758079;
  --line: #e2e6e1;
  --paper: #f4f3ee;
  --white: #fff;
  --forest: var(--brand-black);
  --forest-soft: #2a2418;
  --gold: var(--brand-orange);
  --gold-soft: #fff0e5;
  --danger: #ad493d;
  --shadow: 0 28px 80px rgba(30, 40, 34, 0.14);
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }

.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.ambient-one { width: 520px; height: 520px; top: -220px; right: -120px; background: radial-gradient(circle, rgba(246, 110, 36, .17), transparent 68%); }
.ambient-two { width: 660px; height: 660px; bottom: -360px; left: 28%; background: radial-gradient(circle, rgba(102, 86, 53, .13), transparent 66%); }

.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-logo-wrap { display: grid; width: 184px; height: 47px; padding: 4px 8px; place-items: center; border: 1px solid rgba(246, 110, 36, .48); border-radius: 9px 3px 9px 3px; background: #fff8ed; box-shadow: 0 5px 18px rgba(0,0,0,.2); }
.brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy { display: grid; gap: 1px; }
.brand strong { color: var(--brand-orange); letter-spacing: .2em; font-size: 13px; }
.brand small { color: rgba(255,255,255,.62); font-size: 11px; }

.login-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(430px, .85fr); min-height: 100vh; }
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 6vw, 84px); overflow: hidden; color: #f7f5ef; background:
  linear-gradient(115deg, rgba(8,8,7,.95), rgba(43,35,22,.88)),
  url("../assets/pages/Y432.jpg") center/cover; position: relative; }
.login-brand::after { content: ""; position: absolute; inset: 24px; border: 1px solid rgba(246,110,36,.27); pointer-events: none; }
.login-brand > * { position: relative; z-index: 1; }
.login-copy { max-width: 700px; margin: 13vh 0 8vh; }
.eyebrow, .section-kicker { display: block; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.login-copy h1 { max-width: 670px; margin: 22px 0; font-size: clamp(43px, 5.2vw, 76px); font-weight: 500; letter-spacing: -.045em; line-height: 1.04; }
.login-copy h1 em { color: var(--brand-orange-light); font-family: "DM Serif Display", Georgia, serif; font-weight: 400; }
.login-copy p { max-width: 520px; color: rgba(255,255,255,.62); font-size: 17px; line-height: 1.7; }
.login-note { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.54); font-size: 12px; }
.login-note span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-orange); box-shadow: 0 0 0 5px rgba(246,110,36,.12); }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(430px, 100%); padding: 46px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.78); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.login-card h2 { margin: 10px 0 7px; font-size: 34px; letter-spacing: -.035em; }
.login-card > div:first-child p { margin: 0 0 30px; color: var(--muted); }
.setup-alert { margin-bottom: 20px; padding: 15px 17px; border: 1px solid #e1c482; border-radius: 12px; background: #fff8e8; }
.setup-alert p { margin: 4px 0 0; color: #74613a; font-size: 13px; line-height: 1.5; }
.setup-alert code { font-size: 11px; }

.field { display: grid; gap: 8px; margin: 17px 0; }
.field > span { font-size: 12px; font-weight: 700; }
.field input, .field select, .search-box input { width: 100%; border: 1px solid var(--line); outline: none; background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.field input, .field select { height: 49px; padding: 0 14px; border-radius: 10px; }
.field select { cursor: pointer; }
.field input:focus, .field select:focus, .search-box:focus-within { border-color: var(--brand-orange); box-shadow: 0 0 0 4px rgba(246,110,36,.12); }
.primary-button, .secondary-button { min-height: 42px; padding: 0 17px; border-radius: 9px; border: 1px solid transparent; font-weight: 700; font-size: 13px; transition: transform .16s, background .16s, opacity .16s; }
.primary-button { background: var(--brand-orange); color: #fff; box-shadow: 0 9px 18px rgba(246,110,36,.2); }
.primary-button:hover { background: var(--forest-soft); transform: translateY(-1px); }
.secondary-button { border-color: var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { border-color: #c2c9c3; background: #fafaf8; }
button:disabled { cursor: wait; opacity: .55; transform: none !important; }
.login-button { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-top: 24px; min-height: 52px; padding: 0 19px; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: 12px; }
.back-link { display: block; margin-top: 19px; color: var(--muted); font-size: 12px; text-align: center; }

.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 254px; flex-direction: column; padding: 28px 20px 20px; color: #f6f3ea; background: var(--forest); }
.sidebar::before { content: ""; position: absolute; inset: 0; opacity: .08; background: url("../assets/pages/Y432.jpg") center/cover; mix-blend-mode: luminosity; pointer-events: none; }
.sidebar > * { position: relative; }
.side-nav { display: grid; gap: 7px; margin-top: 54px; }
.nav-item { display: flex; width: 100%; min-height: 46px; align-items: center; gap: 13px; padding: 0 14px; border: 0; border-radius: 9px; color: rgba(255,255,255,.6); background: transparent; font-size: 13px; text-align: left; }
.nav-item:hover, .nav-item.is-active { color: #fff; background: rgba(255,255,255,.09); }
.nav-item.is-active { box-shadow: inset 3px 0 var(--brand-orange); }
.nav-icon { display: grid; width: 20px; place-items: center; color: var(--brand-orange-light); font-size: 18px; }
.sidebar-footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer div { display: grid; gap: 2px; min-width: 0; }
.sidebar-footer strong { font-size: 11px; }
.sidebar-footer small { overflow: hidden; color: rgba(255,255,255,.43); font-size: 10px; text-overflow: ellipsis; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-orange); box-shadow: 0 0 0 4px rgba(246,110,36,.12); }
.icon-button, .menu-button, .close-button { border: 0; background: transparent; }
.icon-button { color: rgba(255,255,255,.58); font-size: 18px; }
.admin-main { min-height: 100vh; margin-left: 254px; }
.admin-header { position: sticky; z-index: 10; top: 0; display: flex; min-height: 100px; align-items: center; gap: 22px; padding: 19px clamp(24px, 4vw, 62px); border-bottom: 1px solid rgba(220,224,218,.8); background: rgba(244,243,238,.88); backdrop-filter: blur(18px); }
.admin-header h1 { margin: 4px 0 0; font-size: 27px; letter-spacing: -.035em; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.save-state { margin-right: 8px; color: var(--muted); font-size: 11px; }
.save-state.is-dirty { color: #a47220; }
.menu-button { display: none; font-size: 22px; }
.content-area { padding: clamp(25px, 4vw, 56px) clamp(20px, 4vw, 62px) 70px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 23px; }
.summary-card { display: grid; min-height: 132px; align-content: center; padding: 22px 25px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.72); }
.summary-card > span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; }
.summary-card strong { margin: 7px 0 1px; font-size: 31px; letter-spacing: -.04em; }
.summary-card small { color: var(--muted); }
.summary-card.accent { color: #fff; border-color: var(--forest); background: linear-gradient(120deg, var(--forest), #2b4438); }
.summary-card.accent > span, .summary-card.accent small { color: rgba(255,255,255,.53); }
.summary-card.accent strong { color: #ddc681; font-size: 26px; }
.catalog-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.84); box-shadow: 0 18px 45px rgba(35,42,37,.06); }
.catalog-toolbar { display: flex; align-items: center; gap: 24px; padding: 24px 25px; border-bottom: 1px solid var(--line); }
.catalog-toolbar h2 { margin: 0; font-size: 19px; }
.catalog-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.toolbar-actions { display: flex; gap: 9px; margin-left: auto; }
.search-box { display: flex; min-width: 230px; height: 42px; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.search-box input { height: 100%; padding: 0; border: 0; box-shadow: none !important; }
.product-list { display: grid; }
.product-row { display: grid; grid-template-columns: 36px 70px minmax(140px, 1fr) minmax(110px, .42fr) 108px 132px; align-items: center; gap: 15px; padding: 13px 22px; border-bottom: 1px solid #edf0ec; transition: background .16s; }
.product-row:hover { background: #fafaf7; }
.product-row:last-child { border-bottom: 0; }
.drag-handle { color: #b3bbb5; letter-spacing: -2px; cursor: grab; }
.product-thumb { width: 70px; height: 70px; border-radius: 9px; object-fit: cover; background: #eceee9; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.product-info { min-width: 0; }
.product-info strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.product-info small, .product-code { color: var(--muted); font-size: 11px; }
.visibility-badge { justify-self: start; padding: 5px 9px; border-radius: 20px; color: #31704b; background: #e8f4eb; font-size: 10px; font-weight: 700; }
.visibility-badge.is-off { color: #7d817e; background: #eef0ee; }
.visibility-badge.is-new { color: #93631b; background: #fff3d6; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-action { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: #5d6861; background: #fff; }
.row-action:hover { border-color: #b7c0ba; color: var(--ink); }
.row-action.danger:hover { color: var(--danger); border-color: #dfb0aa; background: #fff8f7; }
.empty-state { padding: 70px 20px; color: var(--muted); text-align: center; }
.empty-state > span { color: var(--gold); font-size: 38px; }
.empty-state h3 { margin: 10px 0 3px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13px; }

.modal { width: min(830px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 18px; background: transparent; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(10,18,14,.68); backdrop-filter: blur(5px); }
.modal-card { overflow: hidden; border-radius: 18px; background: #fff; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 23px 26px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 5px 0 0; font-size: 23px; }
.close-button { width: 36px; height: 36px; color: var(--muted); font-size: 27px; }
.modal-body { padding: 27px; }
.product-editor { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(280px, 1fr); gap: 29px; }
.image-editor { display: grid; align-content: start; gap: 12px; }
.image-preview { display: grid; width: 100%; aspect-ratio: 4 / 5; place-items: center; overflow: hidden; border: 1px dashed #cbd1cc; border-radius: 13px; color: var(--muted); background: #f3f4f1; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.image-editor > small { color: var(--muted); font-size: 10px; text-align: center; }
.editor-fields .field { margin-top: 0; margin-bottom: 17px; }
.toggle-field { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.toggle-field input { position: absolute; opacity: 0; }
.switch { position: relative; width: 40px; height: 23px; border-radius: 20px; background: #cbd0cc; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.toggle-field input:checked + .switch { background: var(--brand-orange); }
.toggle-field input:checked + .switch::after { transform: translateX(17px); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 17px 25px; border-top: 1px solid var(--line); background: #fafaf8; }
.media-modal { width: min(960px, calc(100% - 30px)); }
.media-toolbar { display: flex; align-items: center; gap: 20px; padding: 16px 25px; }
.media-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.media-toolbar button { margin-left: auto; }
.media-grid { display: grid; max-height: 57vh; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; overflow: auto; padding: 5px 25px 24px; }
.media-item { position: relative; aspect-ratio: 1; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: #eef0ec; }
.media-item:hover { border-color: var(--brand-orange); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-select { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; }
.media-delete { position: absolute; z-index: 2; top: 5px; right: 5px; display: grid; width: 26px; height: 26px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(126,39,31,.84); opacity: 0; }
.media-item:hover .media-delete { opacity: 1; }
.modal-loading { padding: 50px; color: var(--muted); text-align: center; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 44px)); padding: 13px 17px; border-radius: 9px; color: #fff; background: var(--brand-brown); box-shadow: 0 16px 35px rgba(0,0,0,.25); font-size: 12px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { background: #813c34; }

@media (max-width: 980px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { min-height: 42vh; padding: 35px; }
  .login-copy { margin: 8vh 0 3vh; }
  .login-copy h1 { font-size: clamp(38px, 8vw, 60px); }
  .login-note { display: none; }
  .login-panel { padding: 45px 20px 70px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  body.sidebar-open .sidebar { transform: none; }
  .admin-main { margin-left: 0; }
  .menu-button { display: block; }
  .product-row { grid-template-columns: 26px 64px minmax(120px, 1fr) 95px 130px; }
  .product-code { display: none; }
}

@media (max-width: 720px) {
  .admin-header { min-height: 82px; padding: 15px 17px; }
  .admin-header .section-kicker, .admin-header h1 { display: none; }
  .save-state, #reloadButton { display: none; }
  .content-area { padding: 18px 13px 50px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .summary-card { min-height: 105px; padding: 17px; }
  .summary-card strong { font-size: 25px; }
  .summary-card.accent { grid-column: 1 / -1; min-height: 90px; }
  .catalog-toolbar { display: grid; padding: 18px; }
  .toolbar-actions { display: grid; width: 100%; grid-template-columns: 1fr auto; margin: 0; }
  .search-box { min-width: 0; }
  .product-row { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 11px; padding: 12px; }
  .drag-handle, .product-code, .visibility-badge { display: none; }
  .product-thumb { width: 54px; height: 59px; }
  .row-actions .move-action { display: none; }
  .product-editor { grid-template-columns: 1fr; }
  .image-preview { max-height: 260px; }
  .modal { max-height: calc(100vh - 16px); }
  .modal-card { max-height: calc(100vh - 16px); overflow: auto; }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .login-brand { min-height: 35vh; }
  .login-brand::after { inset: 14px; }
  .login-copy { margin: 6vh 0 1vh; }
  .login-copy h1 { margin: 13px 0 0; font-size: 35px; }
  .login-copy p { display: none; }
  .login-card { padding: 29px 23px; border-radius: 18px; }
  .catalog-toolbar .toolbar-actions { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
}
