﻿:root {
  --text: #f5f5f4;
  --muted: #a8a29e;
  --success: #86efac;
  --danger: #fda4af;
  --emerald-300: #6ee7b7;
  --emerald-400: #34d399;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --card-border: rgba(120, 113, 108, 0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at -10% -20%, #1f2937 0%, transparent 60%),
    radial-gradient(1000px 600px at 120% -10%, #052e24 0%, transparent 60%),
    linear-gradient(165deg, #0f172a 0%, #111827 35%, #0c0a09 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(80px);
  opacity: .25;
  pointer-events: none;
}

.bg-orb-a {
  width: 320px;
  height: 320px;
  top: -120px;
  left: -100px;
  background: #10b981;
}

.bg-orb-b {
  width: 360px;
  height: 360px;
  right: -120px;
  bottom: -120px;
  background: #0ea5e9;
}

.hidden { display: none !important; }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, 96vw);
  margin: 0 auto;
  padding: 26px 0 44px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--emerald-300);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 10px;
  font-weight: 800;
}

h1, h2 {
  margin: 0;
  font-family: 'Playfair Display', serif;
}

h1 {
  font-size: clamp(1.6rem, 1.3rem + .9vw, 2.3rem);
}

h2 {
  font-size: clamp(1.2rem, 1.1rem + .6vw, 1.6rem);
  margin-bottom: 14px;
}

.card {
  background: linear-gradient(165deg, rgba(41, 37, 36, .96), rgba(17, 24, 39, .92));
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .25);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  background: linear-gradient(145deg, rgba(6, 78, 59, .33), rgba(28, 25, 23, .84));
}

.owner-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  margin-bottom: 14px;
  background: rgba(28, 25, 23, .88);
  backdrop-filter: blur(8px);
}

.owner-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #e7e5e4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: .2s ease;
}

.owner-nav-link:hover {
  background: rgba(6, 95, 70, .35);
  border-color: rgba(52, 211, 153, .35);
}

.owner-nav-link.active {
  color: #ecfdf5;
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-700));
  border-color: rgba(16, 185, 129, .35);
  box-shadow: 0 8px 18px rgba(2, 44, 34, .35);
}

.login-card {
  max-width: 560px;
  margin: 36px auto 0;
}

.intro {
  margin: 6px 0 14px;
  color: var(--muted);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-shell {
  background:
    radial-gradient(800px 300px at 10% -20%, rgba(16, 185, 129, .14), transparent 60%),
    radial-gradient(700px 240px at 100% -10%, rgba(14, 165, 233, .14), transparent 62%),
    linear-gradient(165deg, rgba(41, 37, 36, .96), rgba(17, 24, 39, .92));
}

.dashboard-kpi {
  border: 1px solid rgba(120, 113, 108, .3);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(12, 10, 9, .6), rgba(6, 78, 59, .16));
}

.dashboard-kpi-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
}

.dashboard-kpi-value {
  margin: 0;
  color: #ecfdf5;
  font-size: 24px;
  font-weight: 800;
}

.queue-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.queue-filters button.active {
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-700));
  color: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, .35);
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-card {
  border: 1px solid rgba(120, 113, 108, .34);
  border-radius: 12px;
  padding: 12px;
  background: rgba(12, 10, 9, .45);
  display: grid;
  gap: 10px;
}

.queue-card-main {
  display: grid;
  gap: 4px;
}

.queue-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ecfdf5;
}

.queue-card-sub {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.queue-card-stage {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #6ee7b7;
  text-transform: uppercase;
}

.queue-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.orders-card {
  border: 1px solid rgba(120, 113, 108, .28);
  border-radius: 12px;
  background: rgba(12, 10, 9, .45);
  padding: 12px;
}

.orders-card h3 {
  margin: 0 0 10px;
  color: var(--emerald-300);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.import-result {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(120, 113, 108, .35);
  background: rgba(12, 10, 9, .75);
  color: #e7e5e4;
  font-size: 12px;
  max-height: 200px;
  overflow: auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
}

.modal-card {
  position: absolute;
  right: 12px;
  top: 12px;
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(120, 113, 108, .4);
  background: #111827;
  padding: 12px;
}

.queue-detail-head {
  border: 1px solid rgba(120, 113, 108, .3);
  border-radius: 10px;
  padding: 10px;
  background: rgba(12, 10, 9, .45);
}

.queue-detail-head p {
  margin: 0 0 4px;
  font-size: 12px;
}

.queue-detail-item {
  border: 1px solid rgba(120, 113, 108, .3);
  border-radius: 10px;
  padding: 10px;
  background: rgba(12, 10, 9, .45);
}

.queue-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.queue-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

.queue-checklist input {
  width: 14px;
  height: 14px;
}

.queue-timeline {
  margin: 8px 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-chart-card {
  border: 1px solid rgba(120, 113, 108, .28);
  border-radius: 12px;
  background: rgba(12, 10, 9, .45);
  padding: 10px;
  min-height: 240px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.dashboard-chart-card canvas {
  width: 100% !important;
  height: 190px !important;
}

.dashboard-chart-title {
  margin: 0 0 10px;
  color: #e7e5e4;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
}

.dashboard-diagrams {
  border: 1px solid rgba(120, 113, 108, .28);
  border-radius: 12px;
  background: rgba(12, 10, 9, .45);
  padding: 10px;
  margin-bottom: 12px;
}

.dashboard-health-list {
  display: grid;
  gap: 8px;
}

.dashboard-health-row {
  display: grid;
  gap: 6px;
}

.dashboard-health-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.dashboard-health-name {
  margin: 0;
  color: #e7e5e4;
  font-size: 13px;
  font-weight: 600;
}

.dashboard-health-value {
  margin: 0;
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-health-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 113, 108, .25);
  overflow: hidden;
}

.dashboard-health-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #0ea5e9);
}

.dashboard-tables {
  display: grid;
  gap: 10px;
}

.dashboard-table-card {
  border: 1px solid rgba(120, 113, 108, .28);
  border-radius: 12px;
  background: rgba(12, 10, 9, .45);
  padding: 10px;
}

.dashboard-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.products-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 14px;
}

.products-pane {
  border: 1px solid rgba(120, 113, 108, .28);
  border-radius: 14px;
  padding: 12px;
  background: rgba(12, 10, 9, .35);
}

.products-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.products-pane-header h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--emerald-300);
}

.products-actions {
  display: flex;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.products-list-pane .products-pane-header {
  align-items: flex-start;
}

.products-list-pane .products-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.products-list-pane .products-actions button {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
}

#deleteProductBtn {
  grid-column: 1 / -1;
}

.product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 540px;
  overflow: auto;
}

.product-list-item {
  border: 1px solid rgba(120, 113, 108, .32);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  background: rgba(41, 37, 36, .65);
}

.product-list-item:hover {
  border-color: rgba(52, 211, 153, .35);
}

.product-list-item.active {
  border-color: rgba(52, 211, 153, .55);
  background: rgba(6, 95, 70, .24);
}

.product-list-name {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 13px;
}

.product-list-price {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.product-image-preview-wrap {
  border: 1px solid rgba(120, 113, 108, .34);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(12, 10, 9, .85);
  margin-bottom: 10px;
}

.product-image-preview {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.product-gallery-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.product-gallery-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid rgba(120, 113, 108, .35);
  border-radius: 8px;
  background: rgba(12, 10, 9, .9);
  cursor: pointer;
}

.product-gallery-thumb.active {
  outline: 2px solid rgba(52, 211, 153, .7);
  outline-offset: 1px;
}

.product-gallery-slot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  border: 1px dashed rgba(120, 113, 108, .45);
  border-radius: 8px;
  background: rgba(12, 10, 9, .5);
  cursor: pointer;
}

.product-gallery-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.product-slot-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.product-list-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
}

.page-form-grid {
  display: grid;
  gap: 10px;
  max-height: 540px;
  overflow: auto;
  padding-right: 4px;
}

.page-form-field {
  display: grid;
  gap: 6px;
}

.page-form-field label {
  margin: 0;
}

.owner-page {
  animation: fadeUp .24s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stack {
  display: grid;
  gap: 10px;
}

.smart-field {
  display: grid;
  gap: 6px;
}

.smart-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(120, 113, 108, .35);
  border-radius: 10px;
  background: rgba(12, 10, 9, .55);
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
  font-size: 13px;
}

.smart-checkbox input {
  width: 16px;
  height: 16px;
}

.smart-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.smart-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(120, 113, 108, .35);
  border-radius: 999px;
  background: rgba(12, 10, 9, .55);
  font-size: 12px;
  color: #e7e5e4;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}

.smart-radio-item input {
  width: 14px;
  height: 14px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(120, 113, 108, .45);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(12, 10, 9, .88);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--emerald-400);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .16);
}

textarea { resize: vertical; }

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 11px;
  color: #ecfdf5;
  background: linear-gradient(135deg, var(--emerald-800), var(--emerald-700));
  box-shadow: 0 8px 18px rgba(2, 44, 34, .35);
}

button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }

button.ghost {
  background: rgba(41, 37, 36, .92);
  color: #f5f5f4;
  border: 1px solid rgba(120, 113, 108, .4);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #9f1239, #be123c);
  color: #fff;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.two-col .full { grid-column: 1 / -1; }

.hint {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

code {
  border-radius: 8px;
  padding: 2px 8px;
  background: rgba(6, 78, 59, .23);
  color: var(--emerald-300);
}

.error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--success);
  font-weight: 700;
}

.orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.orders-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.orders-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(120, 113, 108, .35);
  border-radius: 12px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.orders-table th,
.orders-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(120, 113, 108, .25);
  text-align: left;
  font-size: 13px;
}

.orders-table th {
  color: var(--emerald-300);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.orders-empty {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr; }
  .products-workspace { grid-template-columns: 1fr; }
  .product-gallery-preview { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-charts { grid-template-columns: 1fr; }
  .orders-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { width: 94vw; padding-top: 18px; }
  .topbar { padding: 14px; }
  .owner-nav { overflow-x: auto; }
  .owner-nav-link { white-space: nowrap; }
  .row { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .product-gallery-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-kpis { grid-template-columns: 1fr; }
}
