:root {
  --bg: #0e1220;
  --bg-soft: #151a2d;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.1);
  --text: #f4f6fb;
  --muted: #a8b2d1;
  --accent: #57c7ff;
  --accent-2: #9e7bff;
  --danger: #ff6b7a;
  --success: #58d69a;
  --border: rgba(255, 255, 255, 0.12);
  font-family: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(87, 199, 255, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(158, 123, 255, 0.18), transparent 24%),
    linear-gradient(180deg, #090b14 0%, var(--bg) 100%);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.page-shell { width: min(1400px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 48px; }
.topbar, .hero, .filters, .product-grid, .detail-layout, .auth-shell, .dashboard-grid, .admin-panels, .page-head, .table-list, .form-shell { margin-top: 20px; }
.footer {
  margin-top: 22px;
  padding: 18px 4px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px; border: 1px solid var(--border); background: rgba(10, 14, 28, 0.7);
  backdrop-filter: blur(14px); border-radius: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08111f; padding: 10px 12px; border-radius: 14px;
}
.nav { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); }
.nav a:hover { color: var(--text); }

.messages { display: grid; gap: 12px; margin-top: 18px; }
.message {
  padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: rgba(255,255,255,0.06);
}
.message-success { border-color: rgba(88, 214, 154, 0.35); }
.message-error { border-color: rgba(255, 107, 122, 0.35); }

.hero, .auth-shell, .detail-layout, .panel {
  border: 1px solid var(--border); background: var(--card); border-radius: 28px;
  box-shadow: 0 20px 70px rgba(0,0,0,.24);
}
.hero {
  display: grid; grid-template-columns: 1.6fr .8fr; gap: 24px; padding: 28px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .16em; color: var(--accent); font-size: .78rem; }
.hero h1, .auth-hero h1, .page-head h1, .detail-panel h1 { font-size: clamp(2rem, 4vw, 3.8rem); margin: 10px 0; line-height: 1.05; }
.hero-copy, .auth-hero p, .product-description, .table-row p { color: var(--muted); }
.hero-card, .stat-card {
  display: grid; align-content: center; padding: 24px; border-radius: 24px;
  background: linear-gradient(160deg, rgba(87,199,255,.18), rgba(158,123,255,.12));
  border: 1px solid var(--border);
}

.filters {
  padding: 18px 22px; border-radius: 24px; border: 1px solid var(--border); background: rgba(255,255,255,.04);
}
.filter-form, .form-grid {
  display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
}
.filter-form label, .auth-form label, .form-grid label, .gallery-formset label { display: grid; gap: 8px; color: var(--muted); }
input, select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  background: rgba(7, 10, 20, .72); color: var(--text);
}
textarea { resize: vertical; }
.checkbox-line { display: flex !important; align-items: center; gap: 10px; padding-bottom: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0;
  border-radius: 14px; padding: 12px 16px; cursor: pointer; font-weight: 700;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #08111f; }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(255, 107, 122, .16); color: #ffd0d6; border: 1px solid rgba(255, 107, 122, .3); }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-card, .panel, .table-row {
  border: 1px solid var(--border); background: rgba(255,255,255,.05); border-radius: 24px;
}
.product-card { position: relative; overflow: hidden; display: grid; }
.product-image-btn { position: relative; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.product-image-btn img { width: 100%; aspect-ratio: 1.1; object-fit: cover; }
.badge {
  position: absolute; top: 14px; left: 14px; padding: 8px 12px; border-radius: 999px; font-size: .8rem;
  background: rgba(255, 107, 122, .9); color: white;
}
.badge-soldout { left: auto; right: 14px; background: rgba(255, 196, 87, .92); color: #1b1200; }
.badge-floating { top: 18px; right: 18px; z-index: 2; }
.product-body { padding: 18px; display: grid; gap: 14px; }
.product-headline, .price-row, .modal-topline, .modal-price-row, .table-row, .page-head, .row-actions { display: flex; justify-content: space-between; gap: 16px; }
.product-headline h2, .modal-content h2, .page-head h1 { margin: 0; }
.product-brand { margin: 0; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.product-audience, .chip, .price-hidden, .promo-flag { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--border);
}
.chip-muted { opacity: .7; }
.price { font-size: 1.2rem; }
.price-old { color: var(--muted); text-decoration: line-through; display: block; }
.product-actions, .profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-actions form { margin: 0; }
.cart-note { color: var(--muted); margin-top: 10px; }
.profile-grid { margin-top: 20px; }
.user-review-card { display: grid; gap: 16px; }
.user-review-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.user-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.user-review-grid p { margin: 6px 0 0; color: var(--text); }

.detail-layout { display: grid; grid-template-columns: 1.1fr .9fr; padding: 18px; gap: 18px; }
.detail-main-image { border-radius: 22px; width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.gallery img { border-radius: 14px; aspect-ratio: 1/1; object-fit: cover; }
.detail-panel { padding: 22px; }
.detail-media { position: relative; }

.auth-shell { display: grid; grid-template-columns: .95fr 1.05fr; padding: 24px; gap: 18px; }
.auth-card, .panel { padding: 20px; }
.auth-tabs { display: flex; gap: 10px; margin-bottom: 16px; }
.auth-tab {
  border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text);
  border-radius: 999px; padding: 12px 16px; cursor: pointer;
}
.auth-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #08111f; border-color: transparent; }
.hidden { display: none; }
.field-error { color: #ffbac2; font-size: .88rem; }
.terms-note { color: var(--muted); margin: 0; }
.terms-panel { padding: 24px; }
.rich-text { color: var(--text); line-height: 1.7; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card strong { font-size: 2rem; }
.admin-panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.page-head { align-items: center; }
.table-list { display: grid; gap: 12px; }
.table-row {
  align-items: center; padding: 16px 18px;
  background: rgba(255,255,255,.04);
}
.row-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.form-shell .panel { display: grid; gap: 18px; }
.gallery-formset { display: grid; gap: 14px; }
.gallery-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; border: 1px dashed var(--border); border-radius: 20px; }

.product-editor-head {
  display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 26px;
}
.product-editor-head-actions { display: flex; gap: 10px; align-items: center; }
.product-editor-head h1 { margin: 6px 0 0; font-size: 2.4rem; }
.product-editor {
  margin-top: 20px; border-block: 1px solid var(--border); background: rgba(7,10,20,.35);
}
.product-editor-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(360px, .55fr); }
.product-editor-main { min-width: 0; border-right: 1px solid var(--border); }
.product-editor-section { padding: 28px; border-bottom: 1px solid var(--border); }
.product-editor-section:last-child { border-bottom: 0; }
.product-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.product-section-title > span {
  display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(87,199,255,.35);
  border-radius: 50%; color: var(--accent); font-size: .76rem; font-weight: 800;
}
.product-section-title h2 { margin: 0; font-size: 1.15rem; }
.product-fields { display: grid; gap: 14px; }
.product-fields-two { grid-template-columns: 1.3fr 1fr .8fr; }
.product-fields-price { grid-template-columns: repeat(2, minmax(0, 220px)); }
.product-commercial-section { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(260px, 1.15fr); gap: 34px; }
.product-field { display: grid; gap: 8px; color: var(--muted); min-width: 0; }
.product-field-wide { margin-top: 16px; }
.product-field textarea { min-height: 140px; }
.product-toggles { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.product-toggles label, .delete-image {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: rgba(255,255,255,.035); cursor: pointer;
}
.product-toggles input, .delete-image input, .size-selector input { width: 18px; height: 18px; margin: 0; }
.size-selector > div { display: flex; flex-wrap: wrap; gap: 9px; }
.size-selector > div > div label {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); background: rgba(255,255,255,.035); cursor: pointer;
}
.product-media-editor { min-width: 0; padding: 28px; background: rgba(255,255,255,.025); }
.product-media-sticky { position: sticky; top: 18px; }
.product-media-editor .product-section-title { align-items: flex-start; }
.product-media-editor .product-section-title p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.product-upload {
  position: relative; display: grid; place-items: center; min-height: 190px; padding: 28px; text-align: center;
  border: 1px dashed rgba(87,199,255,.5); border-radius: 8px; background: rgba(87,199,255,.055);
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.product-upload:hover, .product-upload.is-dragging { background: rgba(87,199,255,.12); border-color: var(--accent); }
.product-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.product-upload strong { font-size: 1rem; }
.product-upload small { margin-top: 7px; color: var(--muted); }
.product-image-organizer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.product-image-preview {
  position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: 8px; background: rgba(255,255,255,.04); cursor: grab;
}
.product-image-preview:first-child { grid-column: 1 / -1; }
.product-image-preview.is-dragging { opacity: .45; cursor: grabbing; }
.product-image-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-image-preview:first-child img { aspect-ratio: 1.45; }
.product-image-preview figcaption { display: flex; justify-content: space-between; gap: 6px; align-items: center; padding: 9px; }
.product-image-preview figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .75rem; }
.product-image-preview figcaption strong { width: max-content; color: var(--accent); font-size: .72rem; }
.product-image-controls { position: absolute; top: 8px; right: 8px; display: flex; gap: 5px; }
.product-image-controls button {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%; background: rgba(7,10,20,.82); color: white; cursor: pointer; font-size: 1rem;
}
.product-image-controls button:hover:not(:disabled) { background: rgba(87,199,255,.9); color: #08111f; }
.product-image-controls button:disabled { opacity: .35; cursor: default; }
.product-images-empty {
  grid-column: 1 / -1; margin: 0; padding: 24px; border: 1px dashed var(--border); border-radius: 8px;
  color: var(--muted); text-align: center;
}
.product-media-error { display: block; margin-top: 10px; }
.product-editor-actions {
  display: flex; justify-content: flex-end; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--border);
  background: rgba(10,14,28,.88); position: sticky; bottom: 0; z-index: 4;
}

.modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  padding: 20px; z-index: 50;
}
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 13, .72); }
.modal-panel {
  position: relative; z-index: 1; width: min(980px, 100%); background: #0d1221;
  border: 1px solid var(--border); border-radius: 28px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr;
}
.modal-panel img { width: 100%; height: 100%; object-fit: cover; min-height: 360px; }
.modal-content { padding: 24px; display: grid; gap: 16px; }
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 42px; height: 42px;
  border-radius: 999px; border: 0; background: rgba(255,255,255,.1); color: white; font-size: 1.6rem;
}

.empty-state {
  padding: 40px; border: 1px dashed var(--border); border-radius: 24px; color: var(--muted);
}

.cart-row {
  display: grid; grid-template-columns: minmax(140px, 1fr) minmax(280px, 1.3fr) auto;
  gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--border); border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.profile-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); }
.cart-product p, .checkout-row p, .order-history-row small, .orders-table-row small { margin: 5px 0 0; color: var(--muted); }
.cart-edit-form { display: grid; grid-template-columns: 90px minmax(120px, 1fr) auto; gap: 10px; align-items: end; }
.cart-edit-form label, .order-filters label, .checkout-contact label { display: grid; gap: 6px; color: var(--muted); }
.cart-static-field { display: grid; gap: 9px; min-height: 70px; align-content: end; }
.cart-static-field span { color: var(--muted); }
.cart-row-end { display: grid; gap: 10px; justify-items: end; }
.panel-footer-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.order-history { margin-top: 20px; }
.section-heading h2 { margin-top: 0; }
.order-history-row { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.order-history-row summary {
  display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 18px; align-items: center;
  padding: 16px 18px; cursor: pointer; list-style: none;
}
.order-history-row summary::-webkit-details-marker { display: none; }
.order-history-row summary > span:first-child { display: grid; }
.order-history-items { display: grid; gap: 10px; padding: 0 18px 18px; border-top: 1px solid var(--border); }
.order-history-items > div { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; }
.status-badge {
  display: inline-flex; width: max-content; align-items: center; min-height: 30px; padding: 6px 10px;
  border-radius: 999px; border: 1px solid var(--border); font-size: .78rem; font-weight: 700;
}
.status-new { color: #9bdcff; background: rgba(87,199,255,.12); }
.status-sent { color: #9cf0c5; background: rgba(88,214,154,.12); }
.status-archived { color: #c4caDA; background: rgba(168,178,209,.1); }
.checkout-layout { display: grid; grid-template-columns: 1.4fr .8fr; gap: 18px; margin-top: 20px; align-items: start; }
.checkout-row { display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.checkout-contact form { display: grid; gap: 16px; }
.contact-summary { display: grid; gap: 10px; margin: 0; }
.contact-summary div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; }
.contact-summary dt { color: var(--muted); }
.contact-summary dd { margin: 0; }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.order-toolbar {
  display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-top: 20px;
  padding: 16px 18px; border-block: 1px solid var(--border);
}
.order-filters { display: grid; grid-template-columns: minmax(240px, 1.6fr) 180px 190px auto; gap: 12px; align-items: end; flex: 1; }
.orders-table { margin-top: 16px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.orders-table-head, .orders-table-row {
  display: grid; grid-template-columns: 28px minmax(150px, .8fr) minmax(230px, 1.4fr) 100px 110px minmax(310px, 1.6fr);
  gap: 14px; align-items: center; padding: 14px 16px;
}
.orders-table-head { color: var(--muted); font-size: .8rem; text-transform: uppercase; background: rgba(255,255,255,.06); }
.orders-table-row { border-top: 1px solid var(--border); background: rgba(255,255,255,.025); }
.orders-table-row > div { display: grid; min-width: 0; }
.orders-table-row small { overflow-wrap: anywhere; }
.orders-table input[type="checkbox"] { width: 18px; height: 18px; }
.order-actions { display: flex !important; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.order-actions form { margin: 0; }
.order-actions .btn { min-height: 38px; padding: 8px 10px; font-size: .82rem; }
.btn-icon { background: rgba(87,199,255,.12); color: #bce9ff; border: 1px solid rgba(87,199,255,.3); }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; }

@media (max-width: 1100px) {
  .filter-form, .product-grid, .detail-layout, .auth-shell, .admin-panels, .dashboard-grid, .hero { grid-template-columns: 1fr; }
  .topbar, .page-head, .table-row, .product-headline, .price-row, .modal-topline, .modal-price-row { flex-direction: column; align-items: flex-start; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-form { grid-template-columns: 1fr; }
  .modal-panel { grid-template-columns: 1fr; }
  .footer, .user-review-head, .user-review-grid, .product-actions, .profile-grid { grid-template-columns: 1fr; flex-direction: column; }
  .cart-row, .checkout-layout { grid-template-columns: 1fr; }
  .cart-row-end { justify-items: start; }
  .order-toolbar { align-items: stretch; flex-direction: column; }
  .order-filters { grid-template-columns: 1fr 1fr; }
  .orders-table { border: 0; overflow: visible; display: grid; gap: 12px; }
  .orders-table-head { display: none; }
  .orders-table-row { grid-template-columns: 28px 1fr auto; border: 1px solid var(--border); border-radius: 16px; }
  .orders-table-row > div:nth-of-type(2), .order-actions { grid-column: 2 / -1; }
  .order-actions { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .product-editor-layout { grid-template-columns: 1fr; }
  .product-editor-main { border-right: 0; }
  .product-media-editor { border-top: 1px solid var(--border); }
  .product-media-sticky { position: static; }
  .product-commercial-section { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cart-edit-form, .order-filters, .checkout-row, .order-history-row summary { grid-template-columns: 1fr; }
  .order-history-items > div { flex-direction: column; }
  .orders-table-row { grid-template-columns: 24px 1fr; }
  .orders-table-row > * { grid-column: 2; }
  .orders-table-row > span:first-child { grid-column: 1; grid-row: 1; }
  .order-actions { grid-column: 1 / -1; }
  .product-editor-head { align-items: flex-start; flex-direction: column; }
  .product-editor-head-actions { width: 100%; }
  .product-editor-head-actions .btn { flex: 1; }
  .product-editor-head h1 { font-size: 2rem; }
  .product-editor-section, .product-media-editor { padding: 20px 16px; }
  .product-fields-two, .product-fields-price { grid-template-columns: 1fr; }
  .product-image-organizer { grid-template-columns: 1fr 1fr; }
  .product-editor-actions { padding: 14px 16px; position: static; }
  .product-editor-actions .btn { flex: 1; }
}
