:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e9e9ee;
  --border-strong: #dcdce3;

  --ink-900: #11121a;
  --ink-700: #3f4150;
  --ink-500: #767886;
  --ink-400: #9a9ca8;
  --ink-300: #c2c3cd;

  --accent: #3d3dff;
  --accent-ink: #11121a;

  --success: #1a8a52;
  --danger: #d13b50;
  --warning: #b4790a;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;

  --shadow-xs: 0 1px 2px rgba(17,18,26,0.04);
  --shadow-sm: 0 4px 16px rgba(17,18,26,0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink-900);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ============ AUTH / LOGIN ============ */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}

.auth-mobile-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--ink-900);
  color: #fff;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  letter-spacing: -.01em;
}

.auth-visual {
  background: var(--ink-900);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
}

.auth-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0;
}

.auth-visual-content {
  max-width: 400px;
}

.auth-visual-content .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  margin-bottom: 22px;
}

.auth-visual-content h1 {
  font-size: 32px;
  line-height: 1.28;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -.015em;
}

.auth-visual-content p {
  color: rgba(255,255,255,0.55);
  font-size: 14.5px;
  line-height: 1.65;
}

.auth-stats {
  display: flex;
  gap: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.auth-stats div b {
  display: block;
  font-size: 21px;
  font-weight: 600;
  color: #fff;
}

.auth-stats div span {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.auth-form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--surface);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  margin: auto 0;
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink-900);
  letter-spacing: -.01em;
}

.auth-card .auth-sub {
  color: var(--ink-500);
  font-size: 14px;
  margin-bottom: 30px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-700);
  margin-bottom: 7px;
}

.form-control-premium {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface);
  color: var(--ink-900);
  transition: border-color .12s ease;
  font-family: inherit;
}

.form-control-premium::placeholder { color: var(--ink-300); }

.form-control-premium:focus {
  outline: none;
  border-color: var(--ink-900);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 5px;
  display: block;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 13px;
}

.checkbox-premium {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-500);
}

.checkbox-premium input { accent-color: var(--ink-900); width: 14px; height: 14px; }

.auth-row a { color: var(--ink-900); font-weight: 500; }
.auth-row a:hover { color: var(--accent); }

.btn-premium {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--ink-900);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .12s ease;
}

.btn-premium:hover { opacity: .88; }
.btn-premium:active { opacity: .78; }

.alert-premium {
  background: #fdf1f2;
  border: 1px solid #f5d6da;
  color: var(--danger);
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
}

@media (max-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .auth-visual { display: none; }
  .auth-mobile-bar { display: flex; }
}

/* ============ DASHBOARD SHELL ============ */

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  color: var(--ink-700);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 84vw;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 0 1px var(--border);
  }

  .sidebar.is-open { transform: translateX(0); }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17,18,26,0.32);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .sidebar-backdrop.is-open {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 15px;
  margin-right: 12px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .menu-toggle { display: flex; }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14.5px;
  padding: 4px 8px 24px;
  color: var(--ink-900);
}

.sidebar-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink-900);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10.5px;
}

.nav-group { margin-bottom: 2px; }

.nav-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 16px 10px 6px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .15s ease;
}
.nav-section-title:hover { color: var(--ink-600); }

.nav-chevron {
  font-size: 12px;
  transition: transform .2s ease;
}
.nav-group.collapsed .nav-chevron { transform: rotate(-90deg); }

.nav-group-items {
  overflow: hidden;
  max-height: 500px;
  transition: max-height .25s ease;
}
.nav-group.collapsed .nav-group-items { max-height: 0; }

.nav-link-premium {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-500);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 1px;
  transition: background .12s ease, color .12s ease;
}

.nav-link-premium i { font-size: 15px; width: 18px; text-align: center; color: var(--ink-400); }

.nav-link-premium:hover {
  background: var(--bg);
  color: var(--ink-900);
}
.nav-link-premium:hover i { color: var(--ink-700); }

.nav-link-premium.active {
  background: var(--bg);
  color: var(--ink-900);
  font-weight: 600;
}
.nav-link-premium.active i { color: var(--ink-900); }

.sidebar-footer {
  margin-top: auto;
  padding: 13px 12px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-500);
}

.sidebar-footer b { color: var(--ink-900); display: block; margin-bottom: 3px; font-size: 12.5px; font-weight: 600; }

.main-area { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  width: 280px;
  color: var(--ink-400);
  font-size: 13.5px;
}

@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
}

@media (max-width: 640px) {
  .topbar-search { display: none; }
}

.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  width: 100%;
  font-family: inherit;
  color: var(--ink-900);
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  position: relative;
  cursor: pointer;
  font-size: 14px;
}

.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink-900);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.user-chip .name { font-size: 13.5px; font-weight: 600; line-height: 1.2; color: var(--ink-900); }
.user-chip .role { font-size: 11.5px; color: var(--ink-500); }

@media (max-width: 560px) {
  .user-chip .name, .user-chip .role { display: none; }
  .user-chip { padding-left: 10px; gap: 6px; }
  .icon-btn:nth-of-type(2) { display: none; }
}

.logout-btn {
  background: none;
  border: none;
  color: var(--ink-400);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 0 4px 8px;
}
.logout-btn:hover { color: var(--danger); }

.content { padding: 28px; }

@media (max-width: 640px) {
  .content { padding: 18px; }
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 21px; font-weight: 600; margin: 0 0 4px; color: var(--ink-900); letter-spacing: -.01em; }
.page-header p { color: var(--ink-500); font-size: 13.5px; margin: 0; }

@media (max-width: 480px) {
  .page-header h1 { font-size: 18px; }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}

.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: var(--bg);
  color: var(--ink-700);
}

.kpi-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

.kpi-value { font-size: 23px; font-weight: 600; margin-bottom: 3px; color: var(--ink-900); letter-spacing: -.01em; }
.kpi-label { font-size: 13px; color: var(--ink-500); }

.panel-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}

@media (max-width: 1100px) { .panel-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  min-width: 0;
}

@media (max-width: 640px) {
  .panel { padding: 16px; }
}

.table-scroll {
  overflow-x: auto;
  margin: 0 -4px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-head h3 { font-size: 14.5px; font-weight: 600; margin: 0; color: var(--ink-900); }
.panel-head a { font-size: 12.5px; color: var(--ink-500); font-weight: 500; }
.panel-head a:hover { color: var(--ink-900); }

table.table-premium { width: 100%; min-width: 460px; border-collapse: collapse; }
table.table-premium th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-400);
  padding: 0 8px 10px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
table.table-premium td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--ink-700);
}
table.table-premium tr:last-child td { border-bottom: none; }

.badge-status {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-block;
}
.badge-status.success { background: #eaf6ef; color: var(--success); }
.badge-status.pending { background: #fbf2e3; color: var(--warning); }
.badge-status.danger { background: #fbeaec; color: var(--danger); }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}

.activity-item .t { font-size: 13.5px; font-weight: 500; color: var(--ink-900); }
.activity-item .d { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

/* ============ PRODUCT CATALOG ============ */

.catalog-shell {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .catalog-shell { grid-template-columns: 1fr; }
}

/* ── Filter Panel ── */

.catalog-filters {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  padding: 18px;
  position: sticky;
  top: 84px;
}

@media (max-width: 960px) {
  .catalog-filters {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 300px;
    max-width: 86vw;
    z-index: 70;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(17,18,26,0.12);
  }
  .catalog-filters.is-open { transform: translateX(0); }
}

.filter-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,18,26,0.32);
  z-index: 65;
  opacity: 0;
  transition: opacity .2s ease;
}
.filter-backdrop.is-open { display: block; opacity: 1; }

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.filter-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 7px;
}

.filter-clear-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.filter-clear-btn:hover { text-decoration: underline; }

.filter-section {
  margin-bottom: 6px;
}

.filter-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm);
}
.filter-section-title:hover { background: var(--bg); }
.filter-section-title i { font-size: 11px; transition: transform .15s ease; }
.filter-section-title.collapsed i { transform: rotate(-90deg); }

.filter-section-body {
  padding: 4px 4px 8px;
  max-height: 500px;
  overflow: hidden;
  transition: max-height .2s ease, opacity .15s ease;
}
.filter-section-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 4px;
  overflow: hidden;
}

.filter-search {
  position: relative;
}
.filter-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  font-size: 13px;
}
.filter-search input {
  padding-left: 34px;
  font-size: 13px;
}

.filter-cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .1s ease, color .1s ease;
}
.filter-cat-btn i { font-size: 14px; width: 18px; text-align: center; }
.filter-cat-btn:hover { background: var(--bg); color: var(--ink-900); }
.filter-cat-btn.active { background: var(--bg); color: var(--ink-900); font-weight: 600; }

.cat-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-400);
  font-weight: 500;
}

.filter-cat-group { margin-bottom: 2px; }

.filter-sub-list {
  padding-left: 26px;
}

.filter-sub-btn {
  display: block;
  width: 100%;
  padding: 5px 8px;
  border: none;
  background: none;
  font-size: 12.5px;
  color: var(--ink-500);
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
  font-family: inherit;
}
.filter-sub-btn:hover { background: var(--bg); color: var(--ink-900); }
.filter-sub-btn.active { color: var(--accent); font-weight: 600; }

.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.price-range-inputs input { font-size: 13px; padding: 8px 10px; }
.price-sep { color: var(--ink-400); font-size: 12px; }

.btn-filter-apply {
  width: 100%;
  padding: 7px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .1s ease;
}
.btn-filter-apply:hover { background: var(--border); }

.filter-loading {
  padding: 12px 4px;
  color: var(--ink-400);
  font-size: 12.5px;
}

.btn-close-filters {
  display: none;
  margin-top: 12px;
}
@media (max-width: 960px) {
  .btn-close-filters { display: block; }
}

.filter-section-body .checkbox-premium {
  padding: 4px 0;
}

/* ── Catalog Main ── */

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.catalog-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.catalog-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-mobile-filter {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
@media (max-width: 960px) {
  .btn-mobile-filter { display: flex; }
}

.catalog-result-count {
  font-size: 13px;
  color: var(--ink-500);
  font-weight: 500;
}

.catalog-sort {
  width: auto;
  min-width: 180px;
  font-size: 13px;
  padding: 8px 12px;
}

.catalog-table-panel {
  padding: 0;
  overflow: hidden;
}

.catalog-table-panel .table-scroll { margin: 0; }

.catalog-table-panel table.table-premium { min-width: 700px; }

.catalog-table-panel table.table-premium th {
  padding: 14px 12px 10px;
  background: var(--bg);
}
.catalog-table-panel table.table-premium td {
  padding: 10px 12px;
  vertical-align: middle;
}

.table-empty {
  text-align: center;
  padding: 48px 12px !important;
  color: var(--ink-400);
  font-size: 14px;
}
.table-empty i { margin-right: 6px; }

/* ── Product Cells ── */

.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.product-thumb:hover {
  border-color: var(--ink-300);
  box-shadow: var(--shadow-sm);
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-code {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-900);
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  letter-spacing: .02em;
}

.product-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 2px;
}

.product-desc {
  font-size: 12px;
  color: var(--ink-400);
  line-height: 1.4;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-700);
  display: block;
}

.subcat-label {
  font-size: 11.5px;
  color: var(--ink-400);
  display: block;
  margin-top: 1px;
}

.cell-price {
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
}

.cell-stock {
  white-space: nowrap;
}

/* ── Active Filters ── */

.active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-700);
  font-weight: 500;
}
.active-filter-tag button {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--ink-400);
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}
.active-filter-tag button:hover { color: var(--danger); }

/* ── Pagination ── */

.catalog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 18px 0 4px;
}

.pg-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background .1s ease, border-color .1s ease;
}
.pg-btn:hover:not(:disabled):not(.active) { background: var(--bg); border-color: var(--border-strong); }
.pg-btn.active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.pg-btn:disabled { opacity: .4; cursor: default; }

.pg-dots { color: var(--ink-400); font-size: 13px; padding: 0 4px; }

/* ── Lightbox ── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17,18,26,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }

.lightbox-content {
  max-width: 600px;
  max-height: 80vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 48px rgba(0,0,0,0.4);
}

.lightbox-caption {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-top: 12px;
  font-weight: 500;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease;
  z-index: 2;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

/* ── Thumb Count Badge ── */

.product-thumb { position: relative; }
.thumb-count {
  position: absolute;
  bottom: 2px; right: 2px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 6px;
  line-height: 1.3;
}

/* ── Image Upload Zone ── */

.image-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  min-height: 120px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  position: relative;
  overflow: hidden;
}
.image-upload-zone:hover,
.image-upload-zone.drag-over {
  border-color: var(--ink-400);
  background: var(--bg);
}

.image-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  gap: 8px;
  color: var(--ink-400);
}
.image-upload-placeholder i { font-size: 28px; }
.image-upload-placeholder span { font-size: 13px; }

.image-upload-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.image-upload-progress-bar {
  height: 100%;
  background: var(--ink-900);
  border-radius: 2px;
  transition: width .2s ease;
  width: 0;
}

/* ── Image Gallery (in modal) ── */

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.image-gallery-item {
  width: 80px; height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  position: relative;
  cursor: grab;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.image-gallery-item:hover { border-color: var(--ink-300); }
.image-gallery-item.is-primary { border-color: var(--ink-900); }
.image-gallery-item.dragging { opacity: .4; }

.image-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.image-gallery-actions {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity .12s ease;
}
.image-gallery-item:hover .image-gallery-actions { opacity: 1; }

.img-action-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: var(--ink-900);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s ease;
}
.img-action-btn:hover { background: #fff; }
.img-action-btn.img-action-delete:hover { background: #fee; color: #c33; }

.image-primary-badge {
  position: absolute;
  bottom: 3px; left: 3px;
  background: var(--ink-900);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ── Quantity Controls ── */

.add-to-cart-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--bg);
  color: var(--ink-700);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background .1s ease;
}
.qty-btn:hover { background: var(--border); }

.qty-input {
  width: 40px;
  height: 30px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  background: var(--surface);
  font-family: inherit;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; }

.btn-add-cart {
  width: 34px;
  height: 30px;
  border: 1px solid var(--ink-900);
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .12s ease;
  flex-shrink: 0;
}
.btn-add-cart:hover { opacity: .85; }
.btn-add-cart:disabled { opacity: .5; cursor: default; }

.text-muted { color: var(--ink-400); font-size: 13px; }

/* ── Nav Cart Badge ── */

.nav-cart-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

/* ── Notification Dropdown ── */

.notif-wrapper { position: relative; }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(17,18,26,0.12);
  z-index: 1000;
  overflow: hidden;
}

.notif-dropdown.open { display: flex; flex-direction: column; }

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.notif-header span {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-900);
}

.notif-mark-all {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.notif-mark-all:hover { text-decoration: underline; }

.notif-list {
  overflow-y: auto;
  flex: 1;
  max-height: 380px;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.notif-item:hover { background: var(--bg); }

.notif-item.unread { background: rgba(61,61,255,0.04); }

.notif-item.unread .notif-title { font-weight: 600; }

.notif-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 14px;
}

.notif-body { flex: 1; min-width: 0; }

.notif-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-900);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-msg {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-time {
  font-size: 11px;
  color: var(--ink-400);
  margin-top: 4px;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 16px;
  color: var(--ink-400);
  font-size: 13px;
}

.notif-empty i { font-size: 28px; }

@media (max-width: 560px) {
  .notif-dropdown { width: 300px; right: -40px; }
}

/* ── Topbar Cart ── */

.topbar-cart-btn { text-decoration: none; }

.cart-count-dot {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Remove Item Button ── */

.btn-remove-item {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: color .12s ease, background .12s ease;
}
.btn-remove-item:hover { color: var(--danger); background: #fbeaec; }

/* ── Toast Notification ── */

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(17,18,26,0.16);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.toast-notification.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast-success { background: #eaf6ef; color: var(--success); border: 1px solid #c8e6d4; }
.toast-error { background: #fbeaec; color: var(--danger); border: 1px solid #f5d6da; }
.toast-info { background: #e8e8ff; color: var(--accent); border: 1px solid #d0d0ff; }

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#toast-container .toast-notification {
  position: static;
}
@media (max-width: 480px) {
  #toast-container { left: 12px; right: 12px; bottom: 12px; }
}

/* ── Skeleton Loading ── */

@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.skeleton-row td { padding: 14px 16px; }
.skeleton-cell {
  height: 14px;
  border-radius: var(--radius-sm);
  background: var(--border);
  animation: pulse 1.2s ease-in-out infinite;
}

/* ── Bulk Action Bar ── */

.bulk-action-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: #e8e8ff;
  border: 1px solid #d0d0ff;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--accent-ink);
}
.bulk-action-bar.is-visible { display: flex; }
.bulk-action-bar .bulk-action-buttons { display: flex; gap: 8px; }

@media (max-width: 560px) {
  .bulk-action-bar.is-visible { flex-direction: column; align-items: stretch; }
  .bulk-action-bar .bulk-action-buttons { flex-direction: column; }
}

/* ============ CART PAGE ============ */

.cart-shell {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .cart-shell { grid-template-columns: 1fr; }
}

.cart-table-panel {
  overflow: hidden;
}

.cart-table-panel .panel-head {
  padding: 16px 18px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.cart-table-panel .table-scroll { margin: 0; }

.cart-table-panel table.table-premium { min-width: 650px; }

.cart-table-panel table.table-premium th {
  padding: 14px 12px 10px;
  background: var(--bg);
}
.cart-table-panel table.table-premium td {
  padding: 10px 12px;
  vertical-align: middle;
}

/* ── Cart Summary ── */

.cart-summary {
  position: sticky;
  top: 84px;
}

.cart-summary .panel {
  padding: 22px;
}

.cart-summary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0 0 18px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--ink-500);
}
.cart-summary-row span:last-child {
  font-weight: 600;
  color: var(--ink-700);
}

.cart-summary-divider {
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.cart-summary-total {
  font-size: 15px;
  padding: 12px 0;
}
.cart-summary-total span:first-child { font-weight: 600; color: var(--ink-900); }
.cart-summary-total span:last-child { font-size: 18px; font-weight: 700; color: var(--ink-900); }

.cart-order-btn {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cart-order-btn:disabled { opacity: .4; cursor: default; }

.cart-continue-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-500);
  font-weight: 500;
}
.cart-continue-link:hover { color: var(--ink-900); }
.cart-continue-link i { margin-right: 4px; }

/* ============ ORDERS PAGE ============ */

.btn-detail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .1s ease, border-color .1s ease;
}
.btn-detail:hover { background: var(--bg); border-color: var(--ink-300); color: var(--ink-900); }
.btn-detail i { font-size: 13px; }

.badge-status.info { background: #e8e8ff; color: var(--accent); }

.date-range-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.date-range-inputs input { font-size: 13px; padding: 8px 10px; }
.date-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-500);
}

/* ── Order Detail Modal ── */

.order-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17,18,26,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.order-detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.order-detail-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 64px rgba(17,18,26,0.2);
  width: 90%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.order-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.order-detail-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--ink-900);
}

.order-detail-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--ink-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background .1s ease;
}
.order-detail-close:hover { background: var(--bg); color: var(--ink-900); }

.order-detail-body {
  padding: 22px;
  overflow-y: auto;
}

.order-detail-info {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.order-detail-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13.5px;
}
.order-detail-info-row span:first-child { color: var(--ink-500); }
.order-detail-info-row span:last-child { font-weight: 500; color: var(--ink-900); }

.order-detail-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
}
.order-detail-total span:last-child { font-size: 18px; font-weight: 700; }

/* ── Order Status Timeline ── */

.order-timeline-title {
  font-size: 13px; font-weight: 600; color: var(--ink-700);
  margin: 18px 0 10px;
}

.order-timeline {
  list-style: none; margin: 0 0 18px; padding: 0;
}

.order-timeline-item {
  position: relative; padding-left: 22px; padding-bottom: 16px;
}
.order-timeline-item:last-child { padding-bottom: 0; }

.order-timeline-item::before {
  content: ''; position: absolute; left: 4px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}
.order-timeline-item::after {
  content: ''; position: absolute; left: 8px; top: 14px; bottom: 0;
  width: 1px; background: var(--border);
}
.order-timeline-item:last-child::after { display: none; }

.order-timeline-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.order-timeline-date {
  font-size: 12px; color: var(--ink-500);
}
.order-timeline-meta {
  font-size: 12px; color: var(--ink-500); margin-top: 3px;
}
.order-timeline-notes {
  font-size: 12.5px; color: var(--ink-700); margin-top: 3px;
}

@media (max-width: 640px) {
  .order-detail-panel { width: 96%; max-height: 92vh; }
  .order-detail-body { padding: 16px; }
}
@media (max-width: 480px) {
  .order-detail-overlay { padding: 0; align-items: flex-end; }
  .order-detail-panel { width: 100%; max-height: 96vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

/* ── Payment Button (Toolbar) ── */

.btn-pay-toolbar {
  background: var(--ink-900); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: opacity .12s ease;
  font-family: inherit; white-space: nowrap;
}
.btn-pay-toolbar:hover { opacity: .88; }
.btn-pay-toolbar:active { opacity: .78; }

/* ── Payment Method Grid ── */

.payment-method-grid { display: flex; flex-direction: column; gap: 10px; }

.payment-method-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
  text-align: left; width: 100%;
}
.payment-method-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.payment-method-card i { font-size: 24px; color: var(--accent); flex-shrink: 0; }
.payment-method-title { font-weight: 600; font-size: 14px; display: block; color: var(--ink-900); }
.payment-method-desc { font-size: 12px; color: var(--ink-500); display: block; margin-top: 2px; }

/* ── Payment Form ── */

.pay-form { display: flex; flex-direction: column; gap: 16px; }
.pay-form-group { display: flex; flex-direction: column; gap: 6px; }
.pay-form-group label { font-size: 12px; font-weight: 600; color: var(--ink-700); }
.pay-form-row { display: flex; gap: 12px; }

.pay-form textarea.form-control-premium {
  resize: vertical; min-height: 60px; font-family: inherit; font-size: 13px;
}

.pay-submit {
  margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; font-size: 14px;
}

/* ── Bank Account List ── */

.bank-account-list { display: flex; flex-direction: column; gap: 8px; }

.bank-account-item {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s;
}
.bank-account-item:hover { border-color: var(--accent); }
.bank-account-item.selected { border-color: var(--accent); background: rgba(61,61,255,.04); }
.bank-account-name { font-weight: 600; font-size: 13px; color: var(--ink-900); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.bank-account-iban { font-size: 13px; color: var(--ink-700); font-family: monospace; letter-spacing: .5px; }
.bank-account-detail { font-size: 11px; color: var(--ink-500); margin-top: 4px; }

/* ── Detail Button ── */

.btn-detail {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 10px; font-size: 12px; color: var(--ink-700); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-detail:hover { border-color: var(--accent); color: var(--accent); }

/* ── Badge Status ── */

.badge-status {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
}
.badge-status.success { background: rgba(26,138,82,.1); color: var(--success); }
.badge-status.pending { background: rgba(245,166,35,.12); color: #b8860b; }
.badge-status.danger { background: rgba(209,59,80,.1); color: var(--danger); }

/* ── Category Sub Count ── */

.category-sub-count {
  display: block; font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
}

/* ── Spin Animation ── */

@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin .8s linear infinite; }

/* ============ ADMIN MODAL ============ */

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17,18,26,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.admin-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 64px rgba(17,18,26,0.2);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px);
  transition: transform .2s ease;
}
.admin-modal-overlay.is-open .admin-modal-panel {
  transform: translateY(0);
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.admin-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--ink-900);
}

.admin-modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--ink-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background .1s ease;
}
.admin-modal-close:hover { background: var(--bg); color: var(--ink-900); }

.admin-modal-body {
  padding: 22px;
  overflow-y: auto;
}

.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

.admin-modal-form-group {
  margin-bottom: 16px;
}
.admin-modal-form-group:last-child { margin-bottom: 0; }
.admin-modal-form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-700);
  margin-bottom: 7px;
}

.admin-btn {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-700);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .12s ease;
  font-family: inherit;
}
.admin-btn:hover { border-color: var(--ink-400); color: var(--ink-900); }

.admin-btn-primary {
  background: var(--ink-900);
  color: #fff;
  border-color: var(--ink-900);
}
.admin-btn-primary:hover { opacity: .88; border-color: var(--ink-900); color: #fff; }

.admin-btn-danger {
  background: none;
  color: var(--danger);
  border-color: var(--danger);
}
.admin-btn-danger:hover { background: var(--danger); color: #fff; }

.admin-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  color: var(--ink-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .12s ease;
}
.admin-btn-icon:hover { border-color: var(--ink-400); color: var(--ink-900); }

.admin-btn-add {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--ink-900);
  color: #fff;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity .12s ease;
  font-family: inherit;
  white-space: nowrap;
}
.admin-btn-add:hover { opacity: .88; }

/* ── Warning Modal ── */

.warning-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(209,59,80,.1);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 16px;
}

.warning-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  text-align: center;
  margin: 0 0 8px;
}

.warning-modal-text {
  font-size: 13.5px;
  color: var(--ink-500);
  text-align: center;
  margin: 0 0 20px;
  line-height: 1.5;
}

.warning-modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ── Delete Confirm ── */

.delete-confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(209,59,80,.1);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 16px;
}

/* ── Custom Toggle ── */

.custom-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
  height: 28px;
}
.custom-toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--border-strong);
  position: relative;
  transition: background .25s ease;
  flex-shrink: 0;
}
.custom-toggle[data-active="true"] .custom-toggle-track {
  background: var(--success);
}
.custom-toggle:hover .custom-toggle-track {
  background: var(--ink-300);
}
.custom-toggle[data-active="true"]:hover .custom-toggle-track {
  background: #168a45;
}
.custom-toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left .25s cubic-bezier(.4,.0,.2,1);
  box-shadow: 0 1px 3px rgba(17,18,26,0.15);
}
.custom-toggle[data-active="true"] .custom-toggle-thumb {
  left: 23px;
}
.custom-toggle-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-400);
  line-height: 1;
}
.custom-toggle[data-active="true"] .custom-toggle-text {
  color: var(--success);
}

/* ── Drag & Drop ── */

.drag-handle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-300);
  cursor: grab;
  font-size: 16px;
  flex-shrink: 0;
  transition: color .12s ease;
}
.drag-handle:hover { color: var(--ink-700); }
.drag-handle:active { cursor: grabbing; }

tr.dragging {
  opacity: 0.4;
  background: var(--bg);
}
tr.drag-over td {
  border-top: 2px solid var(--ink-900) !important;
}

/* ── Edit/Delete footer layout ── */

.admin-modal-footer-left {
  display: flex;
  align-items: center;
}
.admin-modal-footer-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .admin-modal-panel { width: 96%; max-height: 92vh; }
  .admin-modal-body { padding: 16px; }
  .admin-modal-footer, .admin-modal-footer-between { padding: 12px 16px; }
}
@media (max-width: 480px) {
  .admin-modal-overlay { padding: 0; align-items: flex-end; }
  .admin-modal-panel { width: 100%; max-height: 96vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .admin-modal-footer-between { flex-direction: column; align-items: stretch; gap: 10px; }
  .admin-modal-footer-between > div:last-child { display: flex; flex-direction: column; gap: 8px; }
}

/* ── Hierarchical Category Row ── */

.cat-row-child td:nth-child(3) { padding-left: 28px; }
.cat-row-child .product-name::before {
  content: '└';
  margin-right: 6px;
  color: var(--ink-300);
  font-size: 13px;
}

/* ── Icon Help Link ── */

.icon-help-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-400);
  text-decoration: none;
  transition: color .12s ease;
}
.icon-help-link:hover { color: var(--accent); }
.icon-help-link i { font-size: 11px; }

/* ── Admin Product Page ── */

.admin-modal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) {
  .admin-modal-form-row { grid-template-columns: 1fr; }
}

/* ============ MODAL TABS ============ */

.admin-modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  gap: 0;
}
.admin-modal-tab {
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-400);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s ease;
  font-family: inherit;
  white-space: nowrap;
}
.admin-modal-tab:hover { color: var(--ink-700); }
.admin-modal-tab.active {
  color: var(--ink-900);
  border-bottom-color: var(--ink-900);
}
.admin-modal-tab-content { display: none; }
.admin-modal-tab-content.active { display: block; }

/* ============ SETTINGS PAGE TABS ============ */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 4px;
  flex-wrap: wrap;
}
.settings-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-400);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s ease;
  font-family: inherit;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-tab:hover { color: var(--ink-700); }
.settings-tab.active {
  color: var(--ink-900);
  border-bottom-color: var(--ink-900);
}
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }

.settings-logo-preview {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.settings-logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) { .settings-form-grid { grid-template-columns: 1fr; } }
.settings-template-list { display: flex; flex-direction: column; gap: 10px; }
.settings-template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 12px;
}
.settings-template-item .name { font-weight: 500; font-size: 13.5px; color: var(--ink-900); }
.settings-template-item .sub { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

/* ============ ADDRESS CARDS ============ */

.address-list { display: flex; flex-direction: column; gap: 10px; }

.address-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  transition: border-color .12s ease;
}
.address-card:hover { border-color: var(--border-strong); }
.address-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.address-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.address-card-default {
  font-size: 11px;
  font-weight: 500;
  color: var(--success);
  background: rgba(26,138,82,.08);
  padding: 2px 8px;
  border-radius: 4px;
}
.address-card-actions {
  display: flex;
  gap: 4px;
}
.address-card-body {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.5;
}
.address-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--ink-400);
  font-size: 13.5px;
}
.address-empty i {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
  color: var(--ink-300);
}

.admin-btn-add-sm {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: none;
  color: var(--ink-500);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .12s ease;
  font-family: inherit;
  width: 100%;
  justify-content: center;
}
.admin-btn-add-sm:hover {
  border-color: var(--ink-400);
  color: var(--ink-900);
  background: var(--bg);
}

/* ============ FAVORITES & QUICK ORDER ============ */

.btn-fav {
  width: 34px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-400);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s ease, color .1s ease, border-color .1s ease;
}
.btn-fav:hover { border-color: var(--danger); color: var(--danger); }
.btn-fav.is-active { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-fav:disabled { opacity: .6; cursor: default; }

.order-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-order-example {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ink-700);
  margin: 8px 0 4px;
  white-space: pre;
}

.quick-status-cell { font-size: 12.5px; }

.quick-row-remove {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background .1s ease, color .1s ease, border-color .1s ease;
}
.quick-row-remove:hover { background: var(--bg); border-color: var(--danger); color: var(--danger); }

.quick-order-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
