:root {
  /* Admin and public site both use the Asvika Wear logo palette. */
  color-scheme: light;
  --ink: #100c0d;
  --muted: #75676b;
  --line: #dfc9cf;
  --paper: #efe2dc;
  --soft: #f8efeb;
  --white: #ffffff;
  --rose: #b77a91;
  --rose-dark: #91596e;
  --green: #4f9f25;
  --danger: #b4233a;
  --shadow: 0 18px 48px rgba(80, 54, 60, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
}

h1,
h2,
h3,
h4,
h5,
h6,
button,
label,
input,
textarea,
select,
a,
span,
p,
li,
small {
  font-family: inherit;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

/* Top admin navigation with logo, public-site link, and logout. */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(239, 226, 220, 0.94);
  backdrop-filter: blur(16px);
}

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

.admin-brand img {
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(183, 122, 145, 0.1);
  border: 1px solid rgba(183, 122, 145, 0.2);
}

.user-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-badge.partner-1 {
  background: #b77a91;
  color: var(--white);
}

.user-badge.partner-2 {
  background: #4f9f25;
  color: var(--white);
}

.user-badge.partner-3 {
  background: #d09b38;
  color: var(--white);
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.top-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.ghost-link,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  color: var(--white);
  background: var(--rose);
}

.primary-btn:hover {
  background: var(--rose-dark);
}

.ghost-btn,
.ghost-link {
  color: var(--rose-dark);
  border-color: var(--line);
  background: var(--white);
}

.danger-btn {
  color: var(--white);
  background: var(--danger);
}

/* Login screen for the private admin control panel. */
.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 86px);
  padding: 32px 16px;
}

.login-card {
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-card img {
  width: 112px;
  height: 112px;
  display: block;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-card h1 {
  font-size: 30px;
  line-height: 1.08;
}

.login-card label,
.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-card label {
  margin-top: 16px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(183, 122, 145, 0.22);
  border-color: var(--rose);
}

.login-card .primary-btn {
  width: 100%;
  margin-top: 18px;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Dashboard cards, tabs, forms, and tables. */
.admin-shell {
  padding: 28px clamp(16px, 4vw, 54px) 54px;
}

.dashboard-head,
.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-head h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.metric-grid span,
.metric-grid strong {
  display: block;
}

.metric-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-grid strong {
  margin-top: 8px;
  font-size: 28px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.analytics-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8efeb 0%, #efe2dc 100%);
}

.analytics-grid span,
.analytics-grid strong,
.analytics-grid small {
  display: block;
}

.analytics-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analytics-grid strong {
  margin-top: 8px;
  font-size: 24px;
  color: var(--rose);
  font-weight: 800;
}

.analytics-grid small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* ====== SIDEBAR LAYOUT ====== */

.app-layout {
  display: flex;
  min-height: calc(100vh - 1px);
  gap: 0;
}

.app-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.sidebar-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-brand strong {
  font-size: 14px;
  font-weight: 800;
  display: block;
  color: var(--ink);
}

.sidebar-brand small {
  font-size: 11px;
  color: var(--muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  flex: 1;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  text-align: left;
}

.sidebar-btn:hover {
  background: var(--soft);
  color: var(--ink);
}

.sidebar-btn.active {
  background: var(--rose);
  color: var(--white);
}

.sb-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-help-link,
.sidebar-logout {
  display: block;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  text-align: left;
}

.sidebar-help-link:hover,
.sidebar-logout:hover {
  background: var(--soft);
  color: var(--ink);
}

.sidebar-logout {
  color: var(--danger);
}

.app-main {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  max-width: 100%;
}

/* Hamburger for mobile */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--ink);
}

/* Responsive sidebar */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .app-main {
    padding: 16px;
  }
}

.hamburger-overlay {
  display: none;
}

@media (max-width: 768px) {
  .hamburger-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .hamburger-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }
}

.admin-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.panel-heading h2 {
  font-size: 26px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.form-grid.narrow {
  max-width: 720px;
}

.span-2 {
  grid-column: 1 / -1;
}

.check-row {
  grid-template-columns: auto 1fr !important;
  align-items: center;
  align-content: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

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

.mini-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--rose-dark);
  background: var(--soft);
  font-weight: 800;
  cursor: pointer;
}

.mini-btn.danger {
  color: var(--danger);
}

.status-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--rose-dark);
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

/* Brand guide cards show logo, colors, and typography information. */
.brand-guide {
  display: grid;
  gap: 16px;
}

.brand-guide article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.brand-guide h3 {
  margin: 0 0 8px;
}

.brand-guide p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.brand-logo-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.brand-logo-card img {
  width: 160px;
  height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

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

.swatch-grid div {
  display: grid;
  gap: 6px;
}

.swatch {
  display: block;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.swatch-grid small {
  color: var(--muted);
  font-weight: 800;
}

.swatch.mauve {
  background: #b77a91;
}

.swatch.blush {
  background: #efe2dc;
}

.swatch.black {
  background: #100c0d;
}

.swatch.leaf {
  background: #4f9f25;
}

/* Inventory Management Styles */
.inventory-controls {
  display: flex;
  gap: 10px;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
}

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

.stat-card {
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, #f8efeb 0%, #efe2dc 100%);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(80, 54, 60, 0.15);
}

.stat-card.in-stock {
  border-color: #4f9f25;
  background: linear-gradient(135deg, #f0fde4 0%, #e8f8d3 100%);
}

.stat-card.sold {
  border-color: #d09b38;
  background: linear-gradient(135deg, #fdf9e8 0%, #fdf3d3 100%);
}

.stat-card.profit {
  border-color: #b77a91;
  background: linear-gradient(135deg, #fef0f5 0%, #fde8f0 100%);
}

.stat-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.stat-value {
  display: block;
  margin: 8px 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--rose);
}

.stat-card.in-stock .stat-value {
  color: #4f9f25;
}

.stat-card.sold .stat-value {
  color: #d09b38;
}

.stat-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.inventory-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.inventory-table thead {
  background: linear-gradient(135deg, #b77a91 0%, #91596e 100%);
  color: var(--white);
}

.inventory-table th {
  padding: 14px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inventory-table td {
  padding: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.inventory-table tbody tr:hover {
  background: rgba(183, 122, 145, 0.04);
}

.unit-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 11px;
}

.unit-status.instock {
  background: #e8f8d3;
  color: #2d6a0f;
}

.unit-status.sold {
  background: #fdf3d3;
  color: #8b5e00;
}

.inventory-add-form {
  padding: 22px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: rgba(183, 122, 145, 0.04);
}

.inventory-add-form h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
}

.form-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ===== Report Section Styles ===== */
.report-section {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.report-section h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.report-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8efeb 0%, #efe2dc 100%);
}

.report-card span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.report-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--rose);
}

.report-card small.trend {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

/* ===== Trend Chart Styles ===== */
.trend-chart {
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-dot.sales-dot { background: var(--rose); }
.chart-dot.profit-dot { background: var(--green); }

.chart-bars-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-bottom: 24px;
  position: relative;
}

.chart-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  position: relative;
  animation: chartFadeIn 0.4s ease forwards;
  opacity: 0;
}

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

.chart-bar-container.today {
  background: rgba(183, 122, 145, 0.06);
  border-radius: 6px;
}

.chart-bar-stack {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}

.chart-bar {
  width: 70%;
  min-width: 8px;
  max-width: 36px;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease, opacity 0.3s ease;
}

.chart-bar.sales-bar {
  background: linear-gradient(180deg, #c799a8 0%, #b77a91 100%);
}

.chart-bar.profit-bar {
  background: linear-gradient(180deg, #7bc94a 0%, #4f9f25 100%);
}

.chart-bar-container:hover .chart-bar {
  opacity: 0.8;
}

.chart-label {
  position: absolute;
  bottom: -20px;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.chart-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  pointer-events: none;
}

.chart-bar-container:hover .chart-tooltip {
  display: block;
}

/* ===== Password Eye Toggle ===== */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 42px;
}

.eye-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  border-radius: 6px;
  padding: 0;
  transition: color 0.2s, background 0.2s;
}

.eye-toggle:hover {
  color: var(--rose);
  background: rgba(183, 122, 145, 0.08);
}

.eye-toggle svg {
  width: 18px;
  height: 18px;
}

/* Search bar for admin tables */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.search-input {
  max-width: 360px;
}

.search-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* Image preview in product form */
.image-preview {
  display: block;
  max-width: 160px;
  max-height: 160px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  margin: 0;
  padding: 13px 16px;
  border-radius: 8px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .metric-grid,
  .analytics-grid,
  .form-grid,
  .swatch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .admin-brand img {
    width: 44px;
    height: 44px;
  }

  .admin-brand strong {
    font-size: 15px;
  }

  .dashboard-head,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .dashboard-head h1 {
    font-size: 26px;
  }

  .panel-heading h2 {
    font-size: 20px;
  }

  .admin-shell {
    padding: 16px 12px 32px;
  }

  .admin-panel {
    padding: 16px 14px;
  }

  .metric-grid,
  .analytics-grid,
  .form-grid,
  .swatch-grid,
  .brand-logo-card {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    gap: 10px;
  }

  .metric-grid article {
    padding: 14px;
  }

  .metric-grid strong {
    font-size: 22px;
  }

  .span-2 {
    grid-column: auto;
  }

  .login-card {
    padding: 22px;
  }

  .login-card h1 {
    font-size: 24px;
  }

  .table-wrap table {
    font-size: 12px;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 8px 10px;
  }

  .date-range-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .date-range-filter label {
    width: 100%;
  }

  .date-range-filter label input {
    width: 100%;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-input {
    max-width: none;
    width: 100%;
  }

  .report-section {
    padding: 14px;
  }

  .report-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .report-card {
    padding: 12px;
  }

  .report-card strong {
    font-size: 18px;
  }

  .row-actions {
    flex-direction: column;
    gap: 4px;
  }

  .mini-btn {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  .user-info {
    padding: 6px 10px;
  }

  .user-name {
    font-size: 12px;
  }

  .customer-card summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 14px;
  }

  .customer-card summary strong {
    min-width: 0;
    font-size: 13px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .ghost-link,
  .danger-btn {
    font-size: 13px;
    min-height: 36px;
    padding: 0 12px;
  }

  .icon-btn {
    padding: 4px 8px;
    font-size: 14px;
  }
}

/* ---- Payment methods admin ---- */
.payment-methods-admin {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.payment-method-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}
.payment-method-row input {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85rem;
  min-width: 80px;
}
.pm-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.pm-remove {
  background: none;
  border: none;
  color: var(--error, #c0392b);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.pm-remove:hover {
  color: #e74c3c;
}
.pm-bank-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  padding-left: 20px;
}
.pm-id { width: 80px; }
.pm-label { width: 120px; }
.pm-account { width: 140px; }
.pm-qr { width: 160px; }

/* ====== DARK MODE ====== */
body.dark {
  --ink: #f0e6e0;
  --muted: #a8948b;
  --line: #4a3a3e;
  --paper: #1a1412;
  --soft: #2a221f;
  --white: #221a17;
  --shadow: 0 18px 48px rgba(0,0,0,0.4);
}

body.dark .login-card,
body.dark .admin-panel,
body.dark table,
body.dark input, body.dark select, body.dark textarea {
  background: var(--white);
  color: var(--ink);
}
body.dark th {
  background: var(--soft);
}
body.dark .status-pill {
  background: var(--soft);
}
body.dark .chart-bar-container.today {
  background: rgba(255,255,255,0.05);
}
body.dark .chart-tooltip {
  background: #2a221f;
  border-color: #4a3a3e;
}

/* ====== TOGGLE SWITCH ====== */
.toggle-switch {
  position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; margin: 0; position: absolute; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--line); border-radius: 20px; transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; left: 2px; bottom: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* Inactive row styling */
tr.inactive-row td { opacity: 0.5; }
tr.inactive-row:hover td { opacity: 0.7; }

/* ====== LOW STOCK ALERT ====== */
#lowStockAlert {
  display: none;
  background: #fff3cd;
  color: #664d03;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid #ffecb5;
}
body.dark #lowStockAlert {
  background: #332b00;
  color: #ffd970;
  border-color: #665500;
}
#lowStockAlert.visible { display: block; }
#lowStockAlert .alert-icon { margin-right: 6px; }
#lowStockAlert strong { font-weight: 600; }
tr.low-stock-row td { background: rgba(255, 193, 7, 0.08); }
tr.low-stock-row:hover td { background: rgba(255, 193, 7, 0.15); }

/* ====== CUSTOMER CARDS ====== */
#customerList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.customer-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.customer-card summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  gap: 12px;
}
.customer-card summary strong { font-size: 14px; min-width: 160px; }
.customer-meta { font-size: 12px; color: var(--muted); }
.customer-orders { padding: 0 16px 12px; }
.customer-orders table { font-size: 12px; }
.customer-orders table th { background: var(--soft); }
.customer-orders table td, .customer-orders table th { padding: 4px 8px; }

/* ====== DATE RANGE FILTER ====== */
.date-range-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.date-range-filter label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--muted);
  gap: 2px;
}
.date-range-filter label input {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: var(--soft);
  color: var(--ink);
}

/* ====== ICON BUTTON ====== */
.icon-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--ink);
}
.icon-btn:hover { background: var(--soft); }

/* ====== CLICKABLE STATUS ====== */
.status-pill.clickable { cursor: pointer; }
.status-pill.clickable:hover { opacity: 0.8; }

/* ====== DELETE MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  width: 360px;
  max-width: 90vw;
  box-shadow: var(--shadow);
}
.modal-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
}
.modal-reasons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.modal-reasons label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 0;
}
.modal-reasons input[type="radio"] {
  accent-color: var(--rose);
  width: 16px;
  height: 16px;
  margin: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ====== SIZE STOCK FIELDS ====== */
.size-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  margin-bottom: 10px;
}
.size-stock-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.size-stock-item label {
  font-size: 12px;
  font-weight: 700;
  color: var(--rose);
}
.size-stock-item input {
  text-align: center;
  min-height: 36px;
  padding: 6px;
}

/* ====== ORDER EDIT MODAL ====== */
.edit-order-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.edit-order-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.edit-order-form label.span-2 { grid-column: 1 / -1; }
.edit-order-form input, .edit-order-form select, .edit-order-form textarea {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}
.edit-order-form textarea { min-height: 60px; }
.edit-order-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ====== CSV UPLOAD ====== */
.csv-upload-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
}
.csv-upload-area input[type="file"] { flex: 1; }

/* ====== TOP PRODUCTS ====== */
.top-products-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.top-product-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: center;
}
.top-product-card strong { display: block; font-size: 20px; color: var(--rose); }
.top-product-card span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ====== KPI DASHBOARD ====== */
.kpi-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--white), var(--soft));
  text-align: center;
  box-shadow: 0 2px 8px rgba(80,54,60,0.06);
}
.kpi-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--rose);
}

/* ====== KANBAN BOARD ====== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  min-height: 320px;
}
.kanban-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.5);
  min-height: 200px;
}
.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.kanban-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rose);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
}
.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.kanban-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(80,54,60,0.1);
}
.kanban-card .order-code {
  font-weight: 800;
  font-size: 13px;
  display: block;
}
.kanban-card .order-customer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.kanban-card .order-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--rose);
  margin-top: 4px;
}
.kanban-card .order-size {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--soft);
}

@media (max-width: 900px) {
  .kpi-dashboard,
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .kpi-dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .kpi-card { padding: 12px 14px; }
  .kpi-value { font-size: 18px; }
  .kanban-board { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kanban-col { padding: 10px; min-height: 160px; }
}

body.dark .kpi-card {
  background: linear-gradient(135deg, var(--white), var(--soft));
  border-color: var(--line);
}
body.dark .kanban-col { background: rgba(42,34,31,0.5); }
body.dark .kanban-card { background: var(--white); }
