:root {
  color-scheme: light;
  --bg-canvas: #f3f5f9;
  --bg-card: #ffffff;
  --ink: #111317;
  --ink-secondary: #5e6573;
  --ink-muted: #8b92a0;
  --line: #e9edf3;
  --line-subtle: #f0f3f7;
  --primary: #121316;
  --primary-hover: #22252a;
  --accent-gold: #f59e0b;
  --accent-gold-bg: #fef8eb;
  --accent-red: #e11d48;
  --accent-red-bg: #fff1f2;
  --accent-green: #10b981;
  --accent-green-bg: #ecfdf5;
  --accent-blue: #3b82f6;
  --accent-blue-bg: #eff6ff;
  --font: "Plus Jakarta Sans", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-card: 22px;
  --radius-pill: 9999px;
  --shadow-sm: 0 2px 8px rgba(17, 19, 23, 0.03);
  --shadow-md: 0 6px 24px rgba(17, 19, 23, 0.04), 0 2px 6px rgba(17, 19, 23, 0.02);
  --shadow-lg: 0 20px 50px rgba(17, 19, 23, 0.06), 0 4px 12px rgba(17, 19, 23, 0.02);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 85% 10%, rgba(245, 158, 11, 0.07), transparent 40%),
    radial-gradient(ellipse at 15% 85%, rgba(59, 130, 246, 0.05), transparent 40%),
    var(--bg-canvas);
  background-attachment: fixed;
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
}

[hidden] {
  display: none !important;
}

/* ===============================
   LOGIN VIEW (Inspired by Login1.jpg)
   =============================== */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(450px, 100%);
  position: relative;
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15), rgba(99, 102, 241, 0.12), transparent 70%);
  filter: blur(40px);
  z-index: -1;
  border-radius: 40px;
}

.login-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
  border-radius: 30px;
  padding: 44px 38px 36px;
  backdrop-filter: blur(20px);
}

.login-intro {
  margin: 22px 0 24px;
}

.login-intro h1 {
  margin: 6px 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.login-sub {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label,
.field {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
}

.input-group input,
.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fbfcfd;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.input-group input:focus,
.field input:focus,
.field select:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(18, 19, 22, 0.06);
}

.login-submit {
  width: 100%;
  height: 48px;
  margin-top: 10px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
}

.store-link {
  display: block;
  margin-top: 20px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: color 0.18s;
}

.store-link:hover {
  color: var(--ink);
}

.form-error {
  min-height: 18px;
  margin: 8px 0 4px;
  color: var(--accent-red);
  font-size: 12px;
  font-weight: 600;
}

/* ===============================
   ADMIN SHELL & SIDEBAR (Inspired by Dashboard3 Jobgio & Design.jpg)
   =============================== */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  padding: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 32px 6px;
  text-decoration: none;
  color: var(--ink);
}

.brand-spark {
  color: var(--accent-gold);
  font-size: 18px;
  line-height: 1;
}

.brand-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text span {
  color: var(--accent-red);
}

.admin-brand small {
  width: 100%;
  margin-top: -2px;
  margin-left: 26px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.8px;
}

.side-label,
.overline {
  margin: 0;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.side-label {
  padding: 0 12px 10px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-link {
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-link:hover {
  background: #f4f6fa;
  color: var(--ink);
}

.side-link.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(18, 19, 22, 0.16);
}

.side-icon {
  display: grid;
  width: 18px;
  place-items: center;
  font-size: 16px;
}

.nav-count {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: auto;
  border-radius: var(--radius-pill);
  background: #f1f3f7;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  transition: all 0.2s;
}

.side-link.active .nav-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line-subtle);
}

.secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 12px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
}

.secure-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.logout-button {
  color: var(--ink-secondary);
}

.logout-button:hover {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

/* ===============================
   TOPBAR
   =============================== */
.admin-main {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.topbar-title h1 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--ink);
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

.profile-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.profile-meta {
  display: flex;
  flex-direction: column;
}

.profile-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.profile-role {
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
}

.mobile-menu {
  display: none;
}

/* ===============================
   PAGE CONTENT & VIEWS
   =============================== */
.page-content {
  padding-bottom: 40px;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
  animation: viewFadeIn 0.22s ease-out;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.welcome-row,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.welcome-row h2,
.section-title h2 {
  margin: 3px 0 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.section-description {
  margin: 4px 0 0;
  color: var(--ink-secondary);
  font-size: 13px;
}

/* ===============================
   METRICS (Quick Stats from Dashboard3 & Dashboard1)
   =============================== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 22px 20px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f5f7fa;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.metric-label {
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
}

.metric strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 6px;
}

.metric-note {
  display: block;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 500;
}

/* ===============================
   BUTTONS & TOOLBARS
   =============================== */
.primary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(18, 19, 22, 0.16);
  transition: all 0.2s ease;
}

.primary-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(18, 19, 22, 0.22);
}

.quiet-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.quiet-button:hover {
  color: var(--ink);
  border-color: #d8dde6;
  background: #fafbfc;
}

.text-button {
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: all 0.18s;
}

.text-button:hover {
  background: #f0f2f7;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 16px;
}

.search-field {
  display: flex;
  width: min(340px, 100%);
  height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--ink-muted);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 19, 22, 0.05);
}

.search-field span {
  font-size: 18px;
}

.search-field input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.result-count {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
}

/* ===============================
   TABLES & ORDER LISTS
   =============================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}

th {
  height: 48px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--ink-secondary);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #fbfcfd;
}

.item-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-image {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #f0f2f5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

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

.subtext {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
}

.delivery-details {
  max-width: 240px;
  margin-top: 4px;
  white-space: normal;
}

.delivery-details summary {
  color: var(--ink-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.delivery-details > span {
  display: block;
  padding-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.4;
}

/* ===============================
   STATUS PILLS (Clean modern badges from D:\UI)
   =============================== */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.pending {
  background: var(--accent-gold-bg);
  color: #b45309;
}

.status.confirmed,
.status.paid {
  background: var(--accent-green-bg);
  color: #047857;
}

.status.shipped {
  background: var(--accent-blue-bg);
  color: #1d4ed8;
}

.status.delivered {
  background: #e6f9ee;
  color: #065f46;
}

.status.cancelled,
.status.refunded {
  background: var(--accent-red-bg);
  color: #be123c;
}

.table-select {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.table-select:focus {
  border-color: var(--primary);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.small-button {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.18s;
}

.small-button:hover {
  background: #f4f6fa;
  border-color: #d1d7e2;
}

.small-button.danger {
  color: var(--accent-red);
}

.small-button.danger:hover {
  background: var(--accent-red-bg);
  border-color: #fecdd3;
}

.empty-message {
  padding: 36px 20px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(400px, calc(100% - 48px));
  margin: 0;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.notice.show {
  opacity: 1;
  transform: none;
}

.notice.error {
  background: var(--accent-red);
}

/* ===============================
   PRODUCT MODAL DIALOG
   =============================== */
.product-dialog {
  position: fixed;
  inset: 0;
  margin: auto !important;
  width: min(620px, calc(100% - 32px));
  max-height: min(90vh, 780px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(18, 19, 22, 0.2);
  z-index: 999999;
}

.product-dialog:not([open]) {
  display: none !important;
}

.product-dialog::backdrop {
  background: rgba(18, 19, 22, 0.4);
  backdrop-filter: blur(8px);
}

.product-form {
  padding: 32px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.dialog-heading h2 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.icon-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4f6fa;
  color: var(--ink-secondary);
  font-size: 20px;
  transition: background 0.18s;
}

.icon-close:hover {
  background: #e9ecf2;
  color: var(--ink);
}

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

.full-field {
  grid-column: 1 / -1;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Photo Upload Box in Product Dialog */
.photo-upload-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.photo-upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-device-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(18, 19, 22, 0.15);
}

.btn-device-upload:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.upload-or-text {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

.photo-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-input-row input {
  flex: 1;
}

.photo-thumb-preview {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: #fff;
}

.photo-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-clear-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.btn-gallery-upload {
  background: #334155 !important;
}

.btn-gallery-upload:hover {
  background: #1e293b !important;
}

.gallery-thumbs-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ===============================
   OPTIONS CONFIG (SIZES & COLORS)
   =============================== */
.options-config-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 18px;
  margin-top: 6px;
}

.options-box-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.options-box-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.options-box-sub {
  font-size: 11.5px;
  color: var(--ink-secondary);
  margin-top: 2px;
}

.options-quick-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-text-action {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-text-action:hover {
  background: #eff6ff;
  border-color: var(--primary);
}

.btn-text-action.btn-text-clear {
  color: #dc2626;
}

.btn-text-action.btn-text-clear:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.size-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.size-chip {
  min-width: 44px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.size-chip:hover {
  border-color: var(--ink-secondary);
  background: #f8fafc;
}

.size-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(18, 19, 22, 0.2);
}

.color-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.color-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.color-preset-btn:hover {
  border-color: var(--ink-secondary);
  background: #f8fafc;
}

.color-preset-btn.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.2);
}

.color-swatch-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.custom-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.custom-add-row input[type="text"] {
  flex: 1;
  min-width: 150px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  background: #ffffff;
  outline: none;
  font-family: inherit;
}

.custom-add-row input[type="text"]:focus {
  border-color: var(--primary);
}

.custom-add-row input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: #ffffff;
}

.btn-add-chip {
  height: 36px;
  padding: 0 14px;
  background: #1e293b;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-add-chip:hover {
  background: #0f172a;
}

.selected-colors-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.selected-color-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.selected-color-tag .tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 12px;
  font-weight: 800;
  margin-left: 2px;
}

.selected-color-tag .tag-remove:hover {
  opacity: 1;
  color: #dc2626;
}

.gallery-thumb-item {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

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

.gallery-thumb-item .btn-remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: none;
  font-size: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}

.gallery-thumb-item .btn-remove-thumb:hover {
  background: var(--accent-red);
}

/* ========================================================
   OFFER / DISCOUNT SYSTEM STYLES
   ======================================================== */
.small-button.offer-btn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 700;
}

.small-button.offer-btn:hover {
  background: #fde68a;
  color: #78350f;
  border-color: #fcd34d;
}

.small-button.offer-btn.has-offer {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.small-button.offer-btn.has-offer:hover {
  background: #fecaca;
  color: #991b1b;
}

.offer-dialog {
  width: min(520px, calc(100% - 32px));
}

.offer-shoe-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.offer-shoe-card img {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.discount-preset-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-pill {
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-pill:hover,
.preset-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-1px);
}

.badge-quick-btn {
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f4f6fa;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.badge-quick-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.offer-calc-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 14px 18px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #1e293b;
}

.quick-calc-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}

.quick-calc-btn {
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-calc-btn:hover {
  background: #fde68a;
  color: #78350f;
}

.quick-calc-clear {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.quick-calc-clear:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */
@media (max-width: 1024px) {
  .admin-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    padding: 12px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-shell {
    display: block;
    padding: 12px;
  }
  .sidebar {
    position: fixed;
    z-index: 100;
    top: 0;
    bottom: 0;
    left: 0;
    width: 270px;
    height: 100vh;
    border-radius: 0 24px 24px 0;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  }
  .sidebar.open {
    transform: none;
  }
  .mobile-menu {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: var(--radius-pill);
    background: #f4f6fa;
    color: var(--ink);
    font-size: 16px;
  }
  .topbar {
    padding: 12px 18px;
    margin-bottom: 18px;
  }
  .topbar-title h1 {
    font-size: 18px;
  }
  .profile-role {
    display: none;
  }
  .metric-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   STANDALONE ADD PRODUCT PAGE & TOPBAR BUTTON
   ======================================================== */
.topbar-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(18, 19, 22, 0.16);
  transition: all 0.2s ease;
}

.topbar-add-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(18, 19, 22, 0.24);
}

.add-product-card-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 32px 30px;
  box-shadow: var(--shadow-sm);
  max-width: 900px;
}

.standalone-form .field span:first-child {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

@media (max-width: 768px) {
  .topbar-add-btn span:not(:first-child) {
    display: none;
  }
  .topbar-add-btn {
    padding: 0 12px;
  }
  .add-product-card-wrap {
    padding: 20px 16px;
  }
}

/* ===============================
   ENHANCED ORDERS & PACKING SLIP
   =============================== */
.order-items-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

/* ===============================
   ADMIN ORDERS TABLE — PREMIUM MODERN UI
   =============================== */
#view-orders .table-wrap {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

#view-orders table {
  table-layout: fixed;
  width: 100%;
}

#view-orders th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.6px;
  border-bottom: 1px solid #e2e8f0;
}

#view-orders th:nth-child(1),
#view-orders td:nth-child(1) {
  width: 28%;
  min-width: 250px;
}

#view-orders th:nth-child(2),
#view-orders td:nth-child(2) {
  width: 28%;
  min-width: 250px;
}

#view-orders th:nth-child(3),
#view-orders td:nth-child(3) {
  width: 17%;
  min-width: 160px;
}

#view-orders th:nth-child(4),
#view-orders td:nth-child(4) {
  width: 16%;
  min-width: 155px;
}

#view-orders th:nth-child(5),
#view-orders td:nth-child(5) {
  width: 11%;
  min-width: 115px;
  text-align: right;
}

#view-orders td {
  vertical-align: top;
  padding: 18px 20px;
  border-bottom: 1px solid #f1f5f9;
}

#view-orders tbody tr:hover {
  background: #fcfdfe;
}

/* Order Header & Time */
.order-cell-primary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-num-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: 0.2px;
}

.order-num-pill .hash {
  color: #64748b;
  font-weight: 600;
}

.order-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.order-date-tag svg {
  color: #94a3b8;
}

/* Items Stack */
.order-items-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-item-row-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  transition: all 0.15s ease;
}

.order-item-row-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.order-item-qty-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.order-item-name-text {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.order-item-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.order-spec-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.order-spec-badge.spec-size {
  background: #e2e8f0;
  color: #334155;
}

.order-spec-badge.spec-color {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #dbeafe;
}

/* Customer & Shipping Column */
.customer-profile-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customer-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.customer-full-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: normal;
  word-break: break-word;
}

.customer-contact-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.customer-tel-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.customer-tel-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.customer-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff !important;
  background: #16a34a;
  padding: 3px 9px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.2);
}

.customer-wa-btn:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.customer-email-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #64748b;
  white-space: normal;
  word-break: break-all;
}

/* Modern Address Dropdown */
.delivery-details {
  margin-top: 2px;
  position: relative;
}

.delivery-details summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.delivery-details summary::-webkit-details-marker {
  display: none;
}

.delivery-details summary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.delivery-details[open] summary {
  background: #f1f5f9;
  border-color: #0f172a;
  color: #0f172a;
}

.delivery-details summary .chev-icon {
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.delivery-details[open] summary .chev-icon {
  transform: rotate(180deg);
}

.delivery-dropdown-card {
  margin-top: 6px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
}

.delivery-address-full {
  color: #1e293b;
  font-weight: 600;
}

.delivery-city-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: #0369a1;
  font-weight: 700;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
}

.delivery-note-box {
  margin-top: 6px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

/* Payment & Total Column */
.payment-cell-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.payment-amount-display {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.payment-method-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  width: fit-content;
}

.payment-method-pill.pill-cod {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.payment-method-pill.pill-bank {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.payment-discount-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  width: fit-content;
  flex-wrap: wrap;
}

.payment-discount-pill .coupon-code-pill {
  background: #be123c;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Status Controls Column */
.status-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-control-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.status-control-label {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-select-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.status-select-custom {
  width: 100%;
  height: 32px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  appearance: none;
  -webkit-appearance: none;
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

/* Semantic Status Color Themes */
/* Order Statuses */
.status-select-custom.st-pending {
  background-color: #fffbeb;
  color: #b45309;
  border: 1.5px solid #fde68a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23b45309'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.status-select-custom.st-confirmed {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1.5px solid #bfdbfe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231d4ed8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.status-select-custom.st-shipped {
  background-color: #eef2ff;
  color: #4338ca;
  border: 1.5px solid #c7d2fe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234338ca'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.status-select-custom.st-delivered {
  background-color: #ecfdf5;
  color: #047857;
  border: 1.5px solid #a7f3d0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23047857'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.status-select-custom.st-cancelled {
  background-color: #fff1f2;
  color: #be123c;
  border: 1.5px solid #fecdd3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23be123c'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* Payment Statuses */
.status-select-custom.pay-pending {
  background-color: #fffbeb;
  color: #b45309;
  border: 1.5px solid #fde68a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23b45309'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.status-select-custom.pay-paid {
  background-color: #ecfdf5;
  color: #047857;
  border: 1.5px solid #a7f3d0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23047857'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.status-select-custom.pay-refunded {
  background-color: #f5f3ff;
  color: #6d28d9;
  border: 1.5px solid #ddd6fe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236d28d9'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

/* Invoice / Slip Column */
.order-slip-action-wrap {
  display: flex;
  justify-content: flex-end;
}

.btn-order-slip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.btn-order-slip:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.btn-order-slip svg {
  color: currentColor;
}

/* Customer Directory Table */
#view-customers .table-wrap {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

#view-customers table {
  table-layout: fixed;
  width: 100%;
}

#view-customers th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.6px;
  border-bottom: 1px solid #e2e8f0;
}

#view-customers th:nth-child(1),
#view-customers td:nth-child(1) {
  width: 25%;
  min-width: 220px;
}

#view-customers th:nth-child(2),
#view-customers td:nth-child(2) {
  width: 26%;
  min-width: 230px;
}

#view-customers th:nth-child(3),
#view-customers td:nth-child(3) {
  width: 25%;
  min-width: 220px;
}

#view-customers th:nth-child(4),
#view-customers td:nth-child(4) {
  width: 12%;
  min-width: 110px;
}

#view-customers th:nth-child(5),
#view-customers td:nth-child(5) {
  width: 12%;
  min-width: 110px;
}

#view-customers td {
  vertical-align: top;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

#view-customers tbody tr:hover {
  background: #fcfdfe;
}

/* Order Receipt Modal */
.order-receipt-dialog {
  position: fixed;
  inset: 0;
  margin: auto !important;
  width: min(720px, calc(100% - 32px));
  max-height: min(92vh, 850px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(18, 19, 22, 0.25);
  z-index: 999999;
}

.order-receipt-dialog:not([open]) {
  display: none !important;
}

.order-receipt-dialog::backdrop {
  background: rgba(18, 19, 22, 0.55);
  backdrop-filter: blur(8px);
}

.receipt-modal-content {
  padding: 32px;
}

.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.receipt-store-brand {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  margin: 4px 0 2px;
}

.receipt-date {
  font-size: 12px;
  color: var(--ink-secondary);
}

.btn-print-receipt {
  background: #1e293b;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-print-receipt:hover {
  background: #0f172a;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 24px;
}

.receipt-col h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.receipt-strong {
  font-weight: 800;
  color: var(--ink);
  font-size: 14px;
}

.receipt-col div {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.receipt-table th {
  text-align: left;
  background: #f1f5f9;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.receipt-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: var(--ink);
}

.receipt-summary-strip {
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
  margin-left: auto;
}

.receipt-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-secondary);
}

.receipt-total-row {
  border-top: 1.5px solid #e2e8f0;
  padding-top: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

@media print {
  body * {
    visibility: hidden;
  }
  #orderReceiptDialog, #orderReceiptDialog * {
    visibility: visible;
  }
  #orderReceiptDialog {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0 !important;
    padding: 0;
    box-shadow: none;
    border: none;
  }
  .btn-print-receipt, .icon-close {
    display: none !important;
  }
}

/* ========================================================
   WHATSAPP AUTOMATION BOT & PHONE SIMULATOR
   ======================================================== */
.wa-digit-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 50px;
  background: #ffffff;
  border: 2px solid #22c55e;
  border-radius: 10px;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.wa-digit-separator {
  display: inline-flex;
  align-items: center;
  font-size: 26px;
  font-weight: 800;
  color: #94a3b8;
  margin: 0 6px;
}

.wa-phone-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wa-phone-input-wrap:focus-within {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.wa-phone-prefix {
  padding: 0 14px;
  background: #f8fafc;
  border-right: 1.5px solid #cbd5e1;
  color: #334155;
  font-weight: 700;
  font-size: 13.5px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.wa-phone-input-wrap input {
  border: none !important;
  height: 46px !important;
  padding: 0 14px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  flex: 1;
  outline: none !important;
  box-shadow: none !important;
}

.wa-status-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.wa-status-banner.is-simulated {
  background: #f0fdf4;
  border-color: #86efac;
}

.wa-status-banner.is-live {
  background: #ecfdf5;
  border-color: #34d399;
}

.wa-status-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wa-status-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: waPulse 2s infinite;
  flex-shrink: 0;
}

@keyframes waPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.wa-status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
}

.wa-workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(340px, 1fr);
  gap: 24px;
  align-items: start;
}

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

.webhook-url-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.webhook-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  flex-wrap: wrap;
}

.webhook-lbl {
  font-weight: 600;
  color: var(--ink-muted);
  width: 110px;
  flex-shrink: 0;
}

.webhook-line code {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: #0f172a;
  word-break: break-all;
}

.btn-copy-mini {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-copy-mini:hover {
  background: #dbeafe;
}

/* SMARTPHONE DEVICE CONTAINER */
.wa-phone-device {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  border: 10px solid #111827;
  border-radius: 36px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  background: #efeae2;
  display: flex;
  flex-direction: column;
  height: 560px;
  position: relative;
}

.wa-phone-notch {
  background: #111827;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.wa-phone-speaker {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: #374151;
}

.wa-phone-camera {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1f2937;
  border: 1px solid #374151;
}

/* WHATSAPP APP BAR */
.wa-phone-appbar {
  background: #008069;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 2;
}

.wa-phone-back {
  font-size: 16px;
  cursor: pointer;
}

.wa-phone-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #111b21;
  color: #25d366;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  border: 1.5px solid rgba(255,255,255,0.4);
}

.wa-phone-titlewrap {
  line-height: 1.2;
}

.wa-phone-name {
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-phone-status {
  font-size: 10px;
  color: #d1fae5;
}

/* CHAT CANVAS */
.wa-phone-chat-area {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #efeae2;
  background-image: radial-gradient(#d1d7db 0.75px, transparent 0.75px);
  background-size: 16px 16px;
}

.wa-chat-date-pill {
  text-align: center;
  margin: 4px 0;
}

.wa-chat-date-pill span {
  background: rgba(255, 255, 255, 0.85);
  font-size: 10.5px;
  font-weight: 600;
  color: #54656f;
  padding: 3px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
}

.wa-biz-info-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
}

.wa-biz-big-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #000000;
  color: #25d366;
  font-weight: 800;
  font-size: 11px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

/* MESSAGE BUBBLE */
.wa-msg-bubble {
  max-width: 88%;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  position: relative;
  word-break: break-word;
}

.wa-bubble-bot {
  background: #ffffff;
  align-self: flex-start;
  border-radius: 0 10px 10px 10px;
  color: #111b21;
}

.wa-bubble-user {
  background: #d9fdd3;
  align-self: flex-end;
  border-radius: 10px 0 10px 10px;
  color: #111b21;
  padding: 6px 9px;
}

.wa-card-header {
  font-weight: 700;
  font-size: 12.5px;
  color: #0f172a;
  padding: 8px 12px 4px;
}

.wa-card-body {
  padding: 4px 12px 6px;
  color: #111b21;
  white-space: pre-line;
}

.wa-bubble-time {
  text-align: right;
  font-size: 9.5px;
  color: #667781;
  padding: 0 8px 6px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.wa-interactive-actions {
  border-top: 1px solid #f0f2f5;
  display: flex;
  flex-direction: column;
}

.wa-action-btn {
  background: transparent;
  border: none;
  border-top: 1px solid #f0f2f5;
  padding: 10px 12px;
  color: #00a884;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
  width: 100%;
}

.wa-action-btn:hover {
  background: #f8fafc;
}

.wa-action-btn:active {
  background: #e2e8f0;
}

.wa-user-quote-box {
  background: #e2f7cb;
  border-left: 3px solid #00a884;
  border-radius: 4px;
  padding: 3px 6px;
  margin-bottom: 4px;
}

.wa-user-reply-text {
  font-weight: 600;
  font-size: 12.5px;
  color: #111b21;
}

/* PHONE INPUT BAR */
.wa-phone-inputbar {
  background: #f0f2f5;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e9edef;
}

.wa-phone-mic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #008069;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* SIMULATOR CONTROLS BELOW PHONE */
.wa-simulator-controls {
  margin-top: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}

html {
  overflow-x: clip;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 380px) {
  .topbar {
    gap: 8px;
    padding: 10px 12px;
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar-title h1 {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar > div:last-child {
    gap: 6px !important;
  }

  .topbar-add-btn {
    width: 36px;
    flex: 0 0 36px;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .topbar-add-btn span:first-child {
    font-size: 16px;
  }

  .admin-profile {
    gap: 0;
    padding: 3px;
  }

  .admin-profile .profile-meta {
    display: none;
  }
}
