@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@1,600;1,700&display=swap");

:root {
  font-family: "Montserrat", sans-serif;
  color: #000000;
  background: #ffffff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --accent: #7a13aa;
  --accent-dark: #000000;
  --lavender-pale: #ffffff;
  --lavender: #7a13aa;
  --charcoal: #000000;
  --muted: #000000;
  --line: #7a13aa;
  --paper: #ffffff;
}

* { box-sizing: border-box; }
button { transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, filter .18s ease; }
button:not(:disabled):hover { filter: brightness(.94); }
body { min-width: 320px; min-height: 100vh; margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { display: none; height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 6.25vw; background: #ffffff; border-bottom: 1px solid #7a13aa; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; font-weight: 700; font-size: 17px; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; color: #ffffff; background: var(--accent); border-radius: 50% 50% 50% 8px; font-family: "Montserrat", sans-serif; font-size: 17px; }
.brand-number { color: var(--lavender); }
.topbar-right { display: flex; align-items: center; gap: 25px; }
.workspace-label, .eyebrow, .sidebar-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.1px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 0 18px; border: 0; border-radius: 3px; font-size: 13px; font-weight: 600; transition: background .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-dark { color: #ffffff; background: var(--accent); }
.button-dark:hover, .button-primary:hover { background: var(--accent-dark); }
.button-primary { color: #ffffff; background: var(--accent); }
.button-large { min-width: 156px; min-height: 50px; font-size: 14px; }
.welcome { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 7vw; padding: 52px 10.5vw 70px; overflow: hidden; }
.welcome-copy { max-width: 490px; padding-bottom: 18px; animation: rise-in .55s ease both; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; display: inline-block; border-radius: 50%; background: #7a13aa; }
h1, h2, p { margin-top: 0; }
.welcome h1, .login-aside h1 { margin: 0 0 24px; color: var(--accent); font-family: "Montserrat", sans-serif; font-size: clamp(46px, 5vw, 66px); font-weight: 500; line-height: 1.07; }
.welcome h1 em, .login-aside h1 em { color: var(--lavender); font-weight: 500; }
.welcome-description { max-width: 400px; margin-bottom: 27px; color: #000000; font-size: 15px; line-height: 1.8; }
.welcome-note { margin: 18px 0 0; color: #000000; font-size: 11px; }
.welcome-visual { position: relative; width: 100%; min-height: 450px; max-width: 500px; justify-self: center; overflow: hidden; background: #ffffff; animation: fade-in .7s .12s ease both; }
.sun-disc { position: absolute; top: 45px; right: 56px; width: 128px; aspect-ratio: 1; border-radius: 50%; background: #7a13aa; }
.package { position: absolute; z-index: 2; top: 137px; left: 50%; width: 235px; height: 225px; transform: translateX(-50%) rotate(-4deg); background: #7a13aa; box-shadow: 16px 20px 34px #00000020; }
.package::before { position: absolute; top: 0; left: 0; width: 100%; height: 46px; content: ''; background: #7a13aa; clip-path: polygon(0 0, 100% 0, 83% 100%, 17% 100%); }
.package::after { position: absolute; top: 46px; bottom: 0; left: 50%; width: 28px; content: ''; transform: translateX(-50%); background: #7a13aa; opacity: .8; }
.package-seal { position: absolute; z-index: 1; top: 40px; left: 50%; width: 54px; height: 50px; transform: translateX(-50%); border-radius: 50%; background: #ffffff; }
.package-wordmark { position: absolute; z-index: 2; top: 113px; left: 50%; color: #ffffff; text-align: center; font-family: "Montserrat", sans-serif; font-size: 19px; font-style: italic; line-height: 1.1; transform: translateX(-50%); }
.package-spark { position: absolute; z-index: 2; right: 27px; bottom: 28px; color: #ffffff; font-size: 21px; }
.leaf { position: absolute; z-index: 1; width: 73px; height: 138px; border-radius: 100% 0 100% 0; background: #7a13aa; transform: rotate(30deg); }
.leaf-one { right: 43px; bottom: 61px; }
.leaf-two { right: 93px; bottom: 17px; width: 52px; height: 111px; background: #7a13aa; transform: rotate(-16deg); }
.visual-caption { position: absolute; right: 21px; bottom: 17px; left: 21px; display: flex; justify-content: space-between; color: #7a13aa; font-size: 10px; }
.is-hidden { display: none !important; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #ffffff; animation: fade-in .3s ease both; }
.login-aside { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 70px 10vw; overflow: hidden; color: #ffffff; background: #7a13aa; }
.login-photo { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.login-aside::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, rgba(86,11,121,.92), rgba(86,11,121,.72)); }
.login-aside > *:not(.login-photo) { position: relative; }
.login-aside > .login-wordmark { position: absolute; top: 30px; left: 10vw; z-index: 2; color: #ffffff; font-family: "Montserrat", sans-serif; font-size: 23px; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.login-wordmark .kh-brand__kays { font-family: "Montserrat", sans-serif; font-style: italic; font-weight: 700; }
.login-wordmark .kh-brand__haven { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; }
.login-aside h1 { color: #ffffff; font-family: var(--kh-heading-font); font-size: clamp(42px, 4.4vw, 59px); }
.login-aside > p:not(.eyebrow) { max-width: 330px; color: #000000; font-size: 14px; line-height: 1.8; }
.text-button { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; color: var(--accent); background: transparent; font-size: 12px; font-weight: 700; }
.login-aside .text-button { margin-top: 28px; }
.login-panel { width: min(100%, 430px); align-self: center; justify-self: center; padding: 55px 34px; }
.login-panel .eyebrow { margin-bottom: 12px; }
.login-panel h2 { margin-bottom: 8px; color: var(--charcoal); font-size: 23px; font-weight: 600; }
.form-intro { margin-bottom: 27px; color: var(--muted); font-size: 13px; }
.login-panel label { display: block; margin: 18px 0 8px; color: #000000; font-size: 12px; font-weight: 600; }
.login-panel input { width: 100%; height: 45px; padding: 0 13px; border: 1px solid #7a13aa; border-radius: 3px; outline: 0; color: var(--charcoal); background: #ffffff; font-size: 13px; }
.login-panel input:focus { border-color: #7a13aa; box-shadow: 0 0 0 3px #7a13aa1c; }
.login-panel input::placeholder { color: #000000; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 60px; }
.password-toggle { position: absolute; top: 0; right: 0; height: 45px; padding: 0 12px; border: 0; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
.form-error { min-height: 17px; margin: 8px 0 0; color: #7a13aa; font-size: 12px; }
.submit-button { width: 100%; margin-top: 6px; }
.demo-access { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 15px; color: #000000; font-size: 11px; }
.demo-access summary { color: var(--accent); cursor: pointer; font-weight: 700; }
.demo-access p { margin: 10px 0 0; line-height: 1.7; }
.demo-access code { color: #000000; font-size: 10px; }
.security-note { margin: 17px 0 0; color: #000000; font-size: 10px; line-height: 1.6; }

.dashboard { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); background: #ffffff; animation: fade-in .3s ease both; }
.sidebar { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 26px 17px 18px; border-right: 1px solid var(--line); background: #ffffff; }
.sidebar-heading { padding: 0 11px 25px; border-bottom: 1px solid var(--line); }
.sidebar-label { display: block; margin-bottom: 9px; font-size: 9px; }
.store-name { gap: .18em; color: #000000; font-size: 13px; font-weight: 700; }
.store-caret { margin-left: 5px; color: #000000; font-size: 10px; }
.side-nav { display: grid; gap: 5px; margin-top: 21px; }
.nav-item { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 11px; padding: 0 11px; border: 0; border-radius: 3px; color: #000000; text-align: left; background: transparent; font-size: 12px; }
.nav-item:hover { background: #ffffff; }
.nav-item.is-active { color: var(--accent); background: #ffffff; font-weight: 700; }
.nav-icon { width: 16px; text-align: center; font-size: 15px; }
.nav-count { margin-left: auto; color: #000000; font-size: 10px; }
.sidebar-bottom { margin-top: auto; }
.profile { display: flex; align-items: center; gap: 10px; padding: 15px 8px; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; display: grid; flex: 0 0 32px; place-items: center; border-radius: 50%; color: #7a13aa; background: #ffffff; font-size: 10px; font-weight: 700; }
.profile-details { display: grid; gap: 3px; min-width: 0; }
.profile-details strong { overflow: hidden; color: #000000; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-details small { color: #000000; font-size: 9px; }
.logout-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 9px; border: 0; color: #000000; background: transparent; text-align: left; font-size: 11px; }
.logout-button:hover { color: #7a13aa; }
.dashboard-main { min-width: 0; padding: 0 4.3vw 18px; }
.dashboard-topline { height: 55px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: #000000; font-size: 10px; }
.breadcrumb strong { color: #000000; font-weight: 600; }
.breadcrumb span { padding: 0 7px; color: #7a13aa; }
.today-label { color: #000000; }
.dashboard-view { padding-top: 29px; animation: rise-in .3s ease both; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-heading .eyebrow { margin-bottom: 8px; font-size: 9px; }
.page-heading h1 { margin-bottom: 6px; color: #000000; font-family: "Montserrat", sans-serif; font-size: 31px; font-weight: 500; }
.page-heading h1 span { color: #7a13aa; }
.page-subtitle { margin-bottom: 0; color: #000000; font-size: 12px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 27px; padding: 0 10px; border: 1px solid #7a13aa; border-radius: 20px; color: #7a13aa; background: #ffffff; font-size: 8px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.metric { position: relative; min-height: 150px; overflow: hidden; padding: 17px 18px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: #000000; font-size: 9px; font-weight: 700; letter-spacing: .6px; }
.metric-icon { color: #000000; font-size: 13px; }
.metric > strong { display: block; margin-top: 11px; color: #000000; font-family: "Montserrat", sans-serif; font-size: 29px; font-weight: 500; }
.metric > p { margin: 5px 0 0; color: #000000; font-size: 10px; }
.trend-up { color: #7a13aa; font-weight: 700; }
.metric-neutral { color: #7a13aa; font-weight: 600; }
.sparkline { position: absolute; right: 16px; bottom: 16px; width: 92px; height: 32px; display: flex; align-items: end; gap: 4px; }
.sparkline i { width: 7px; display: block; border-radius: 2px 2px 0 0; background: #7a13aa; }
.metric-progress { height: 4px; margin: 14px 0 6px; overflow: hidden; border-radius: 4px; background: #7a13aa; }
.metric-progress span { height: 100%; display: block; border-radius: 4px; background: #7a13aa; }
.metric > small { color: #000000; font-size: 9px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; margin-top: 16px; }
.orders-panel, .simple-panel { min-width: 0; padding: 18px 18px 8px; border: 1px solid var(--line); border-radius: 4px; background: #ffffff; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-heading .eyebrow { margin-bottom: 5px; font-size: 8px; }
.section-heading h2 { margin-bottom: 0; color: #000000; font-family: "Montserrat", sans-serif; font-size: 18px; font-weight: 500; }
.section-heading .text-button { color: #7a13aa; font-size: 10px; white-space: nowrap; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 10px 9px; border-bottom: 1px solid #7a13aa; color: #000000; font-size: 8px; font-weight: 700; letter-spacing: .5px; }
td { padding: 12px 9px; border-bottom: 1px solid #7a13aa; color: #000000; font-size: 10px; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; text-align: right; }
.order-number { color: #000000; font-weight: 700; }
.order-status { display: inline-flex; align-items: center; min-height: 21px; padding: 0 8px; border-radius: 20px; font-size: 8px; font-weight: 600; }
.status-ready { color: #ffffff; background: #7a13aa; }
.status-packed { color: #ffffff; background: #7a13aa; }
.status-new { color: #ffffff; background: #7a13aa; }
.status-badge { min-height: 25px; padding: 4px 10px; font-size: 10px; white-space: nowrap; }
.status-pending { color: #ffffff; background: #7a13aa; }
.status-paid { color: #ffffff; background: #7a13aa; }
.status-processed { color: #7a13aa; background: #ffffff; }
.status-failed { color: #000000; background: #f5f5f5; }
.brand-haven, .store-name .kh-brand__haven { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; }
.status-cell { white-space: nowrap; }
.status-action { display: block; margin-top: 5px; padding: 0; border: 0; color: var(--accent); background: transparent; font: inherit; font-size: 9px; font-weight: 700; text-align: left; }
.status-action:hover { text-decoration: underline; }
.status-action:disabled { opacity: .6; cursor: wait; }
.icon-button { width: 28px; height: 28px; border: 0; color: #000000; background: transparent; font-size: 18px; }
.dashboard-footer { display: flex; justify-content: space-between; margin-top: 22px; color: #000000; font-size: 8px; letter-spacing: .6px; }
.dashboard-footer span:last-child { letter-spacing: 0; }
.order-count { color: #000000; font-size: 9px; }
.simple-panel { margin-top: 12px; padding: 19px 22px; }
.simple-panel .section-heading { margin-bottom: 11px; }
.simple-panel th { padding-top: 13px; padding-bottom: 13px; }
.simple-panel td { padding-top: 16px; padding-bottom: 16px; }
.inventory-entry { padding-bottom: 12px; }
.inventory-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 12px; }
.inventory-form label { display: grid; gap: 7px; color: #000000; font-size: 10px; font-weight: 600; }
.inventory-form input, .inventory-form select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #7a13aa; border-radius: 3px; outline: 0; color: #000000; background: #ffffff; font: inherit; font-size: 11px; }
.inventory-form input:focus, .inventory-form select:focus { border-color: #7a13aa; box-shadow: 0 0 0 3px #7a13aa1c; }
.inventory-submit { min-height: 38px; gap: 10px; white-space: nowrap; font-size: 11px; }
.inventory-feedback { min-height: 14px; margin: 8px 0 0; color: #7a13aa; font-size: 10px; }
.inventory-alert .status-dot { background: #7a13aa; }
#inventory-rows input { width: min(100%, 210px); display: block; margin: 3px 0; padding: 6px; border: 1px solid var(--line); }
#inventory-rows input[type="file"] { padding: 5px; font-size: 10px; }
#inventory-rows button { min-height: 30px; padding: 0 10px; }
#inventory-rows .inventory-product-image { width: 52px; height: 52px; margin-right: 10px; vertical-align: middle; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Readability and shared brand treatment */
.login-aside h1,
.welcome h1,
.page-heading h1,
.login-panel h2,
.section-heading h2 {
  font-family: var(--kh-heading-font);
}

.login-panel label,
.inventory-form label {
  font-size: 12px;
}

.login-panel input,
.inventory-form input,
.inventory-form select {
  min-height: 44px;
  border-radius: 8px;
}

.button,
.inventory-submit {
  min-height: 46px;
  border-radius: 8px;
}

.nav-item {
  min-height: 44px;
  border-radius: 8px;
  font-size: 13px;
}

.metric,
.orders-panel,
.simple-panel {
  border-radius: 14px;
}

.metric-label,
.metric > p,
.metric > small,
.page-subtitle,
.dashboard-topline,
.today-label {
  font-size: 12px;
}

.section-heading h2 {
  font-size: 22px;
}

th {
  font-size: 10px;
}

td {
  font-size: 12px;
}

.order-status {
  font-size: 11px;
}

.login-panel input:focus-visible,
.inventory-form input:focus-visible,
.inventory-form select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .welcome { gap: 4vw; padding-right: 7vw; padding-left: 7vw; }
  .dashboard { grid-template-columns: 195px minmax(0, 1fr); }
  .dashboard-main { padding-right: 24px; padding-left: 24px; }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .topbar { height: 66px; padding: 0 20px; }
  .workspace-label { display: none; }
  .topbar-right { gap: 0; }
  .button-dark { min-height: 38px; }
  .welcome { min-height: 100vh; grid-template-columns: 1fr; gap: 34px; padding: 52px 25px 36px; }
  .welcome h1 { font-size: 50px; }
  .welcome-visual { min-height: 330px; width: min(100%, 410px); }
  .package { top: 83px; transform: translateX(-50%) scale(.82) rotate(-4deg); }
  .sun-disc { top: 23px; right: 35px; width: 95px; }
  .leaf-one { right: 29px; bottom: 55px; transform: scale(.82) rotate(30deg); }
  .leaf-two { right: 70px; bottom: 18px; transform: scale(.8) rotate(-16deg); }
  .login { min-height: 100vh; grid-template-columns: 1fr; }
  .login-aside { min-height: 350px; padding: 78px 25px 26px; }
  .login-aside > .login-wordmark { top: 21px; left: 25px; }
  .login-aside .eyebrow { margin-top: 0; margin-bottom: 14px; }
  .login-aside h1 { margin-bottom: 12px; font-size: 39px; }
  .login-aside > p:not(.eyebrow) { max-width: 420px; margin-bottom: 0; font-size: 12px; }
  .login-aside .text-button { margin-top: 15px; }
  .login-panel { width: 100%; padding: 32px 25px 42px; }
  .dashboard { min-height: 100vh; grid-template-columns: 1fr; }
  .sidebar { min-height: auto; padding: 12px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-heading { display: none; }
  .sidebar-bottom { display: flex; justify-content: flex-end; margin-top: 0; }
  .profile { display: none; }
  .logout-button { width: auto; padding: 9px; }
  .side-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0; overflow: visible; }
  .nav-item { width: auto; flex: 1 0 auto; justify-content: center; padding: 0 12px; }
  .nav-count { margin-left: -5px; }
  .dashboard-main { padding: 0 17px 20px; }
  .dashboard-topline { height: 45px; }
  .dashboard-view { padding-top: 23px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 26px; }
  .page-subtitle { max-width: 290px; line-height: 1.5; }
  .live-pill { margin-top: 20px; font-size: 7px; }
  .inventory-form { grid-template-columns: 1fr 1fr; }
  .inventory-name-field { grid-column: 1 / -1; }
  .inventory-submit { align-self: end; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric { min-height: 138px; padding: 14px; }
  .metric:last-child { grid-column: 1 / -1; min-height: 125px; }
  .metric:last-child .sparkline { right: 22px; bottom: 19px; }
  .sparkline { right: 11px; bottom: 12px; width: 62px; gap: 3px; }
  .sparkline i { width: 5px; }
  .content-grid { margin-top: 10px; gap: 10px; }
  th { padding-right: 10px; padding-left: 8px; }
  td { padding-right: 10px; padding-left: 8px; }
  .dashboard-footer { gap: 12px; font-size: 7px; }
  .dashboard-footer span:last-child { text-align: right; }
  .simple-panel { padding-right: 13px; padding-left: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* Clear, compact admin controls with the existing deep-purple brand color. */
.login-aside { color: #ffffff; background: var(--accent); }
.login-aside .status-dot { background: #ffffff; }
.login-aside h1, .login-aside h1 em, .login-aside h1 span, .login-aside > p:not(.eyebrow), .login-aside .eyebrow { color: #ffffff !important; }
.login-aside h1 span { font-family: "Playfair Display", serif; font-style: italic; }
.login-panel { margin: 32px; padding: 38px 34px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; box-shadow: 0 14px 40px rgba(34, 13, 44, .10); }
.login-panel input { border-radius: 7px; }
.submit-button { min-height: 46px; border-radius: 7px; }
.nav-item { min-height: 42px; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.nav-item:hover { color: #ffffff; background: var(--lavender); }
.nav-item.is-active { color: #ffffff; background: var(--accent); }
.nav-icon { display: none; }
.nav-count { color: inherit; }
@media (max-width: 640px) {
  .login-panel { margin: 0 18px 24px; padding: 30px 24px; }
  .side-nav { scrollbar-width: thin; }
  .nav-item { min-width: 0; padding: 0 4px; font-size: 10px; white-space: normal; }
}

.orders-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.orders-heading-actions small { color: var(--muted); text-align: right; }
.orders-heading-actions .orders-feedback { color: var(--accent); }
.orders-panel { padding: 0; border: 0; background: transparent; }
.orders-list { display: grid; gap: 8px; }
.orders-bucket { display: grid; gap: 8px; margin-top: 16px; }
.orders-bucket-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.orders-bucket-heading h2 { margin: 0; color: var(--charcoal); font: 700 13px "Montserrat", sans-serif; }
.orders-toggle-all { min-height: 34px; padding: 0 13px; white-space: nowrap; font: 600 10px "Montserrat", sans-serif; }
.orders-toggle-all:disabled { opacity: .55; cursor: not-allowed; }
.admin-customer-card { min-width: 0; overflow: hidden; border: 1px solid #e8e1ee; border-radius: 13px; background: #ffffff; box-shadow: 0 5px 18px rgba(34, 20, 48, .045); font-family: "Montserrat", sans-serif; }
.customer-group-header { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(110px, .9fr) minmax(150px, 1.4fr) minmax(100px, .8fr); gap: 9px 16px; padding: 12px 14px; border-bottom: 1px solid #eee8f3; background: #fcfaff; }
.customer-group-header > div, .customer-order-header > div, .customer-order-footer .order-card-meta > div { display: grid; gap: 4px; min-width: 0; }
.customer-group-header span, .customer-order-footer .order-card-meta span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.customer-group-header strong, .customer-order-footer .order-card-meta strong { color: var(--charcoal); font: 600 11px/1.45 "Montserrat", sans-serif; overflow-wrap: anywhere; }
.customer-order-entry { padding: 10px 14px; border-bottom: 1px solid #eee8f3; }
.customer-order-entry:last-child { border-bottom: 0; }
.customer-order-header { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 13px; min-width: 0; margin-bottom: 3px; }
.customer-order-header > strong { color: var(--accent); font: 700 12px "Montserrat", sans-serif; }
.customer-order-header time { color: var(--muted); font-size: 10px; }
.customer-order-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 8px; border-top: 1px solid #f1edf4; }
.customer-order-footer .order-card-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.customer-order-footer .order-card-meta .order-summary-total strong { color: var(--accent); font-size: 12px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.order-actions .button { min-height: 31px; padding: 0 11px; border-radius: 7px; font: 600 10px "Montserrat", sans-serif; }
.order-actions .button-secondary { border: 1px solid #d8c9e1; color: #5c376f; background: #fff; }
.order-actions .button-secondary:hover { background: #f7f1fa; }
.order-actions button:disabled { opacity: .55; cursor: wait; }
.admin-order-row { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.order-row-overview { display: grid; grid-template-columns: minmax(140px, .85fr) minmax(240px, 2.6fr) minmax(100px, .7fr) minmax(95px, .65fr); align-items: center; gap: 12px; }
.order-identity { display: grid; gap: 3px; min-width: 0; }
.order-number { color: var(--accent); font-size: 11px; font-weight: 700; }
.order-customer { overflow-wrap: anywhere; font-size: 12px; font-weight: 700; }
.order-item-list { display: flex; flex-wrap: wrap; gap: 3px 14px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.order-item-list li { max-width: 100%; color: var(--charcoal); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.order-total { white-space: nowrap; font-size: 12px; }
.order-status { justify-self: start; }
.order-details { margin-top: 9px; padding-top: 7px; border-top: 1px solid var(--line); }
.order-details summary { width: fit-content; color: var(--accent); cursor: pointer; font-size: 10px; font-weight: 700; }
.order-details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.order-details-content { display: grid; gap: 10px; padding: 10px 0 1px; }
.order-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; margin: 0; }
.order-detail { min-width: 0; }
.order-detail dt { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.order-detail dd { margin: 0; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.orders-empty { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 12px; }
.payment-state { white-space: nowrap; text-transform: capitalize; }
#refresh-orders:focus-visible { outline: 2px solid var(--lavender); outline-offset: 2px; }

@media (max-width: 900px) {
  .order-row-overview { grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px 11px; }
  .order-identity { grid-column: 1; }
  .order-item-list, .order-items-empty { grid-column: 1 / -1; }
  .order-total { grid-column: 2; }
  .order-status { grid-column: 3; }
}
@media (max-width: 520px) {
  .orders-heading-actions { justify-content: flex-start; }
  .orders-heading-actions small { flex-basis: 100%; text-align: left; }
  .admin-order-row { padding: 10px; }
  .order-row-overview { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; }
  .order-identity { grid-column: 1 / -1; }
  .order-item-list, .order-items-empty { grid-column: 1 / -1; }
  .order-total { grid-column: 1; }
  .order-status { grid-column: 2; justify-self: end; }
  .order-details-grid { grid-template-columns: 1fr; }
}

.inventory-search { display: grid; gap: 7px; width: min(100%, 360px); margin: 8px 0 18px; color: #27282a; font-size: 12px; font-weight: 600; }
.inventory-search input { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; color: #27282a; background: #fff; font: inherit; font-size: 13px; }
.inventory-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Keep the login content safely inside both balanced panels. */
.login { min-height: 100svh; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-aside { min-width: 0; padding: 82px clamp(30px, 7vw, 100px) 42px; }
.login-aside > .login-wordmark { left: clamp(30px, 7vw, 100px); }
.login-aside .kh-brand { --kh-brand-kays-color: #ffffff; --kh-brand-haven-color: #d9bced; }
.login-wordmark .kh-brand__kays { color: #ffffff; font-family: "Montserrat", sans-serif; font-style: normal; font-weight: 700; }
.login-wordmark .kh-brand__haven { color: #d9bced; font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; }
.login-aside > p:not(.eyebrow) { max-width: 38ch; overflow-wrap: anywhere; }
.login-panel { width: min(calc(100% - 36px), 430px); min-width: 0; margin: 18px; padding: clamp(24px, 3vw, 38px); overflow-wrap: anywhere; }
.login-panel form, .login-panel label, .login-panel .password-wrap { min-width: 0; }
.login-panel input { min-width: 0; max-width: 100%; }
footer .kh-brand, .dashboard-footer .kh-brand { --kh-brand-kays-color: #000000; --kh-brand-haven-color: #9760c3; }

/* The orders list has one summary row per stable customer identity. */
.orders-search { display: grid; gap: 7px; width: min(100%, 430px); margin: 3px 0 12px; color: var(--charcoal); font-size: 11px; font-weight: 700; }
.orders-search input { width: 100%; min-width: 0; min-height: 39px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--charcoal); background: #ffffff; font: inherit; font-size: 12px; }
.orders-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.customer-group { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: #ffffff; }
.customer-group > summary { list-style: none; }
.customer-group > summary::-webkit-details-marker { display: none; }
.customer-group-summary { min-width: 0; min-height: 54px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(76px, auto) minmax(100px, auto) minmax(94px, auto); align-items: center; gap: 8px 18px; padding: 10px 14px; cursor: pointer; }
.customer-group-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.customer-group-name { min-width: 0; color: #17131b; font-size: 12px; overflow-wrap: anywhere; }
.customer-group-count { color: var(--muted); font-size: 10px; }
.customer-group-total { color: var(--charcoal); font-size: 11px; white-space: nowrap; }
.customer-group-action { color: var(--accent); font-size: 10px; font-weight: 700; text-align: right; }
.customer-group[open] > .customer-group-summary { border-bottom: 1px solid var(--line); }
.customer-group[open] > .customer-group-summary .customer-group-action::after { content: " · Hide"; color: var(--muted); font-weight: 500; }
.customer-order-list { display: grid; gap: 7px; padding: 9px; }
.customer-order-list .admin-order-row { min-width: 0; padding: 9px 11px; }
.order-row-overview { grid-template-columns: minmax(70px, .36fr) minmax(0, 2.2fr) auto auto; align-items: center; gap: 8px 13px; }
.order-number { white-space: nowrap; }
.order-item-list { min-width: 0; }
.order-item-list li { overflow-wrap: anywhere; }
.order-total { text-align: right; }
.order-details { margin-top: 8px; }

/* Separate, complete order cards with the actual order and line-item data. */
.login { position: relative; isolation: isolate; min-height: 100vh; background: transparent; }
.login > .login-photo { position: fixed; z-index: -1; inset: 0; width: 100vw; height: 100vh; height: 100dvh; object-fit: cover; object-position: 76% center; }
.login-aside { background: transparent; }
.login-aside::before { background: linear-gradient(90deg, rgba(46,8,68,.48), rgba(86,11,121,.34)); }
.login-panel { background: rgba(255,255,255,.93); border: 1px solid rgba(122,19,170,.18); border-radius: 18px; box-shadow: 0 18px 50px rgba(30,12,43,.18); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.login-intro-card { width: min(100%, 540px); min-width: 0; margin-top: 20px; padding: clamp(22px, 3.2vw, 36px); border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(74, 9, 105, .86); box-shadow: 0 18px 44px rgba(27, 5, 39, .2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.login-intro-card .eyebrow { margin-bottom: 14px; }
.login-intro-card h1 { max-width: 14ch; margin: 0 0 15px; font-size: clamp(34px, 3.7vw, 53px); line-height: 1.08; overflow-wrap: anywhere; }
.login-intro-card > p:not(.eyebrow) { max-width: 42ch; margin: 0; color: #ffffff; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }

.admin-order-row { display: grid; gap: 14px; padding: 16px; border-color: #e6e0eb; border-radius: 14px; box-shadow: 0 5px 18px rgba(34, 20, 48, .045); }
.order-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.order-card-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 14px; min-width: 0; }
.order-card-identity .order-number { margin: 0; font-size: 15px; }
.order-card-date { color: var(--muted); font-size: 11px; }
.order-customer-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; min-width: 0; }
.order-customer-fields > div { display: grid; align-content: start; gap: 4px; min-width: 0; }
.order-customer-fields span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.order-customer-fields strong { min-width: 0; color: var(--charcoal); font-size: 11px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.order-customer-fields .order-customer-address { grid-column: 1 / -1; }
.order-items-heading { margin: 0; color: var(--charcoal); font-size: 11px; font-weight: 700; }
.order-products-list { display: grid; gap: 7px; min-width: 0; }
.order-product-row { display: grid; grid-template-columns: 58px minmax(120px, 1fr) auto; align-items: center; gap: 10px 13px; min-width: 0; padding: 8px; border: 1px solid #eee9f1; border-radius: 10px; background: #fff; }
.order-product-image { width: 58px; height: 58px; display: block; object-fit: contain; border: 1px solid #eee9f1; border-radius: 8px; background: #fff; }
.order-product-image-missing { display: grid; place-items: center; padding: 4px; color: var(--muted); font-size: 8px; text-align: center; }
.order-product-info { display: grid; gap: 5px; min-width: 0; }
.order-product-info strong { color: var(--charcoal); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.order-product-info span { color: var(--muted); font-size: 10px; }
.order-product-numbers { display: grid; grid-template-columns: repeat(3, minmax(74px, auto)); gap: 8px; }
.order-product-numbers > span { display: grid; gap: 3px; text-align: right; }
.order-product-numbers small { color: var(--muted); font-size: 8px; }
.order-product-numbers strong { color: var(--charcoal); font-size: 10px; white-space: nowrap; }
.order-items-empty { margin: 0; color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
  .order-product-row { grid-template-columns: 54px minmax(0, 1fr); }
  .order-product-image { width: 54px; height: 54px; }
  .order-product-numbers { grid-column: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-product-numbers > span { text-align: left; }
}
@media (max-width: 640px) {
  .login > .login-photo { object-position: 78% center; }
  .login-intro-card { width: 100%; margin-top: 12px; padding: 18px; border-radius: 15px; }
  .login-intro-card .eyebrow { margin-bottom: 9px; }
  .login-intro-card h1 { margin-bottom: 10px; font-size: clamp(30px, 9vw, 38px); }
  .login-intro-card > p:not(.eyebrow) { font-size: 12px; line-height: 1.6; }
  .admin-order-row { gap: 11px; padding: 12px; }
  .order-card-header { align-items: flex-start; }
  .order-card-identity { display: grid; gap: 4px; }
  .order-card-identity .order-number { font-size: 13px; }
  .order-card-date { font-size: 10px; }
  .order-customer-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
  .order-customer-fields .order-customer-address { grid-column: 1 / -1; }
  .order-product-row { grid-template-columns: 48px minmax(0, 1fr); gap: 8px 10px; padding: 7px; }
  .order-product-image { width: 48px; height: 48px; }
  .order-product-numbers { gap: 5px; }
  .order-product-numbers small { font-size: 7px; }
  .order-product-numbers strong { font-size: 9px; }
}

/* Compact, readable per-order rows with labels retained on narrow screens. */
.order-customer-fields {
  grid-template-columns: minmax(130px, 1fr) minmax(120px, .9fr) minmax(180px, 1.35fr) minmax(130px, .9fr);
}
.order-customer-fields .order-customer-address { grid-column: auto; }
.order-products-list { gap: 0; border: 1px solid #eee8f3; border-radius: 10px; overflow: hidden; }
.order-product-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(70px, .42fr) minmax(76px, .45fr) minmax(100px, .58fr) minmax(100px, .58fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
}
.order-product-row { border: 0; border-top: 1px solid #f0ebf3; border-radius: 0; background: #fff; font-size: 10px; }
.order-product-name, .order-product-value { min-width: 0; overflow-wrap: anywhere; }
.order-product-name { color: var(--charcoal); font-weight: 600; }
.order-product-value { color: var(--charcoal); }
.order-product-row [data-label="Total"] { color: var(--accent); font-weight: 700; }
.order-card-meta { grid-template-columns: minmax(150px, 1fr) minmax(120px, .8fr) minmax(160px, 1fr); }

@media (max-width: 760px) {
  .order-product-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5px 10px; padding: 8px 10px; }
  .order-product-name { grid-column: 1 / -1; padding-bottom: 2px; }
  .order-product-value { display: flex; justify-content: space-between; gap: 10px; }
  .order-product-value::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 600; }
}
@media (max-width: 520px) {
  .order-customer-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .order-card-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .login-aside { padding-right: clamp(25px, 5vw, 55px); padding-left: clamp(25px, 5vw, 55px); }
  .login-aside > .login-wordmark { left: clamp(25px, 5vw, 55px); }
  .login-panel { width: min(calc(100% - 28px), 430px); margin: 14px; padding: 28px; }
  .customer-group-summary { grid-template-columns: minmax(0, 1fr) auto auto; }
  .customer-group-action { grid-column: 3; }
  .customer-group-total { grid-column: 2; }
  .order-row-overview { grid-template-columns: minmax(70px, auto) minmax(0, 1fr) auto; }
  .order-item-list { grid-column: 1 / -1; grid-row: 2; }
  .order-total { grid-column: 2; grid-row: 1; }
  .order-status { grid-column: 3; grid-row: 1; }
}
@media (max-width: 640px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-aside { min-height: 330px; padding: 78px 24px 25px; }
  .login-aside > .login-wordmark { top: 21px; left: 24px; }
  .login-aside h1 { max-width: 100%; font-size: clamp(34px, 10vw, 40px); }
  .login-aside > p:not(.eyebrow) { max-width: 42ch; }
  .login-panel { width: calc(100% - 36px); margin: 0 18px 24px; padding: 27px clamp(20px, 6vw, 30px); }
  .customer-group-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; padding: 10px 11px; }
  .customer-group-name { grid-column: 1; }
  .customer-group-count { grid-column: 2; text-align: right; }
  .customer-group-total { grid-column: 1; grid-row: 2; }
  .customer-group-action { grid-column: 2; grid-row: 2; }
  .customer-order-list { padding: 7px; }
  .customer-order-list .admin-order-row { padding: 8px; }
  .order-row-overview { grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px 9px; }
  .order-number { grid-column: 1; }
  .order-total { grid-column: 2; grid-row: 1; }
  .order-status { grid-column: 3; grid-row: 1; justify-self: end; }
  .order-item-list { grid-column: 1 / -1; grid-row: 2; display: grid; gap: 4px; }
  .order-item-list li { font-size: 10px; }
  .order-details-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Compact single-card orders with a customer header, product rows, and summary. */
.admin-order-row {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #e8e1ee;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(34, 20, 48, .045);
  font-family: "Montserrat", sans-serif;
}
.order-customer-fields {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(110px, .9fr) minmax(150px, 1.3fr) minmax(95px, .8fr);
  gap: 8px 16px;
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee8f3;
}
.order-customer-fields > div,
.order-card-meta > div,
.order-summary-date { display: grid; align-content: start; gap: 4px; min-width: 0; }
.order-customer-fields span,
.order-card-meta span,
.order-summary-date > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.order-customer-fields strong,
.order-card-meta strong,
.order-summary-date time { min-width: 0; color: var(--charcoal); font-family: "Montserrat", sans-serif; font-size: 11px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.order-products-list { display: grid; gap: 0; min-width: 0; }
.order-product-row {
  display: grid;
  grid-template-columns: 48px minmax(120px, 1fr) minmax(250px, auto);
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid #f0ebf3;
}
.order-product-row:last-child { border-bottom: 0; }
.order-product-thumbnail { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: #f8f5fa; }
.order-product-image { width: 100%; height: 100%; display: block; object-fit: contain; }
.order-product-image-missing { color: var(--muted); font-size: 8px; text-align: center; }
.order-product-info { display: grid; gap: 4px; min-width: 0; }
.order-product-info strong { color: var(--charcoal); font-family: "Montserrat", sans-serif; font-size: 11px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.order-product-info span { color: var(--muted); font-size: 10px; }
.order-product-numbers { display: grid; grid-template-columns: repeat(3, minmax(70px, auto)); gap: 8px; min-width: 0; }
.order-product-numbers > span { display: grid; gap: 3px; min-width: 0; text-align: right; }
.order-product-numbers small { color: var(--muted); font-size: 8px; }
.order-product-numbers strong { color: var(--charcoal); font-size: 10px; font-weight: 600; white-space: nowrap; }
.order-product-numbers > span:last-child strong { color: var(--accent); }
.order-items-empty { margin: 0; color: var(--muted); font-size: 11px; }
.order-card-summary { padding-top: 10px; border-top: 1px solid #eee8f3; }
.order-card-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
.order-card-meta .order-summary-total strong { color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }

.inventory-upload-preview { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #eee8f3; border-radius: 10px; color: var(--muted); font-size: 11px; }
.inventory-upload-preview[hidden] { display: none; }
.inventory-upload-preview img { width: 58px; height: 58px; object-fit: contain; border-radius: 7px; background: #fff; }
.inventory-product-cell { min-width: 220px; }
.inventory-product-cell input, #inventory-rows select { width: 100%; min-width: 84px; border: 1px solid #e5ddea; border-radius: 8px; padding: 8px; background: #fff; color: var(--charcoal); font: 11px "Montserrat", sans-serif; }
#inventory-rows td:last-child { min-width: 210px; }
#inventory-rows td:last-child input[type="file"] { display: block; max-width: 220px; margin: 8px 0; font-size: 10px; }
#inventory-rows .button { padding: 8px 13px; font-size: 10px; }

.bulk-file-label { display: grid; gap: 7px; width: min(100%, 460px); color: var(--charcoal); font: 600 11px "Montserrat", sans-serif; }
.bulk-file-label input { width: 100%; min-height: 42px; padding: 7px 9px; border: 1px solid #e5ddea; border-radius: 8px; background: #fff; font: 11px "Montserrat", sans-serif; }
.bulk-product-list { display: grid; gap: 9px; margin-top: 12px; }
.bulk-product-entry { display: grid; grid-template-columns: 78px minmax(0, 1fr) minmax(160px, auto); align-items: center; gap: 10px 14px; min-width: 0; padding: 10px; border: 1px solid #e8e1ee; border-radius: 10px; background: #fff; }
.bulk-product-entry.is-saved { border-color: #c8e4d3; }
.bulk-product-preview { width: 78px; height: 78px; object-fit: contain; border: 1px solid #eee8f3; border-radius: 8px; background: #faf9fb; }
.bulk-product-fields { display: grid; grid-template-columns: minmax(150px, 1.5fr) minmax(130px, 1fr) minmax(90px, .7fr); align-items: end; gap: 9px; min-width: 0; }
.bulk-product-fields label { display: grid; gap: 5px; min-width: 0; color: var(--charcoal); font: 600 9px "Montserrat", sans-serif; }
.bulk-product-fields input, .bulk-product-fields select { width: 100%; min-width: 0; min-height: 37px; padding: 0 8px; border: 1px solid #e5ddea; border-radius: 7px; background: #fff; color: var(--charcoal); font: 11px "Montserrat", sans-serif; }
.bulk-product-fields input:focus-visible, .bulk-product-fields select:focus-visible, .bulk-file-label input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bulk-product-entry-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 0; }
.bulk-entry-status { max-width: 200px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.bulk-entry-status.has-error { color: #8e2444; }
.bulk-entry-status.is-success { color: #286741; font-weight: 700; }
.bulk-remove-button { min-height: 32px; padding: 0 10px; border: 1px solid #e5ddea; color: var(--charcoal); background: #fff; font: 600 9px "Montserrat", sans-serif; }
.bulk-products-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.bulk-products-actions .inventory-feedback { margin: 0; }
#save-bulk-products:disabled { opacity: .56; cursor: not-allowed; }

@media (max-width: 900px) {
  .customer-group-header { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-customer-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-product-row { grid-template-columns: 48px minmax(0, 1fr); }
  .order-product-numbers { grid-column: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-product-numbers > span { text-align: left; }
  .bulk-product-entry { grid-template-columns: 68px minmax(0, 1fr); }
  .bulk-product-preview { width: 68px; height: 68px; }
  .bulk-product-entry-actions { grid-column: 2; justify-content: space-between; }
  .bulk-entry-status { max-width: none; }
}
@media (max-width: 640px) {
  .customer-group-header { gap: 8px 11px; padding: 10px 11px; }
  .customer-order-entry { padding: 9px 11px; }
  .customer-order-footer { align-items: flex-start; }
  .customer-order-footer .order-card-meta { gap: 8px 12px; }
  .order-actions { width: 100%; }
  .order-actions .button { flex: 1 1 125px; }
  .admin-order-row { gap: 10px; padding: 11px; }
  .order-customer-fields { gap: 8px 11px; }
  .order-product-row { grid-template-columns: 44px minmax(0, 1fr); gap: 7px 9px; padding: 8px 0; }
  .order-product-thumbnail { width: 44px; height: 44px; }
  .order-product-numbers { gap: 5px; }
  .order-product-numbers small { font-size: 8px; }
  .order-product-numbers strong { font-size: 9px; white-space: normal; overflow-wrap: anywhere; }
  .order-card-meta { gap: 8px 10px; }
  .bulk-product-entry { gap: 8px 10px; padding: 8px; }
  .bulk-product-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-product-fields label:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .login { min-height: 100svh; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 14px; padding: 18px; }
  .login-aside { min-height: 0; align-items: center; padding: 76px 18px 18px; }
  .login-aside > .login-wordmark { top: 20px; left: 18px; }
  .login-intro-card { width: min(100%, 540px); margin: 0; }
  .login-panel { width: min(100%, 540px); margin: 0 auto; padding: clamp(22px, 4vw, 34px); }
}

@media (max-width: 480px) {
  .login { padding: 12px; gap: 10px; }
  .login-aside { padding: 67px 12px 12px; }
  .login-aside > .login-wordmark { top: 16px; left: 12px; }
  .login-panel { padding: 22px 16px; }
}

.order-product-numbers > div { display: grid; gap: 3px; min-width: 0; text-align: right; }
.order-product-numbers > div span { color: var(--muted); font-size: 8px; }
.order-product-numbers > div strong { color: var(--charcoal); font-size: 10px; font-weight: 600; white-space: nowrap; }

/* Individual A5-inspired order cards; each card retains its own order totals. */
.orders-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); align-items: start; gap: 16px; }
.admin-order-card { display: flex; flex-direction: column; gap: 0; width: 100%; max-width: 470px; min-width: 0; min-height: 470px; aspect-ratio: 148 / 210; border: 1px solid #e7deef; border-radius: 16px; background: #fff; box-shadow: 0 7px 22px rgba(43, 22, 59, .08); font-family: "Montserrat", sans-serif; }
.admin-order-card[data-long-order="true"] { aspect-ratio: auto; }
.admin-order-card-header { display: flex; align-items: flex-start; min-height: 124px; padding: 20px 20px 17px; border-radius: 15px 15px 0 0; background: #7a13aa; color: #fff; }
.admin-order-card .order-customer-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; gap: 12px 18px; width: 100%; min-width: 0; }
.admin-order-card .order-customer-fields > div, .admin-order-card .order-card-meta > div { display: grid; gap: 4px; min-width: 0; }
.admin-order-card .order-customer-fields span { color: #f0dafa; font-size: 8px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.admin-order-card .order-customer-fields strong { color: #fff; font: 600 11px/1.45 "Montserrat", sans-serif; overflow-wrap: anywhere; }
.admin-order-card-body { flex: 1 0 auto; min-width: 0; padding: 17px 20px 12px; }
.order-items-heading { margin: 0 0 7px; color: #34203f; font: 700 12px/1.4 "Montserrat", sans-serif; }
.admin-order-card .order-products-list { display: grid; gap: 0; min-width: 0; }
.admin-order-card .order-product-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 7px 10px; min-width: 0; padding: 9px 0; border-bottom: 1px solid #f0eaf4; }
.admin-order-card .order-product-row:last-child { border-bottom: 0; }
.admin-order-card .order-product-thumbnail { width: 46px; height: 46px; border-radius: 8px; background: #faf7fc; }
.admin-order-card .order-product-info { display: grid; gap: 4px; min-width: 0; }
.admin-order-card .order-product-info strong { color: #28212d; font: 600 10px/1.4 "Montserrat", sans-serif; overflow-wrap: anywhere; }
.admin-order-card .order-product-info span { color: #766d7d; font-size: 9px; }
.admin-order-card .order-product-numbers { grid-column: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 9px; min-width: 0; }
.admin-order-card .order-product-numbers > div { display: grid; gap: 3px; min-width: 0; text-align: left; }
.admin-order-card .order-product-numbers span { color: #766d7d; font-size: 8px; font-weight: 600; }
.admin-order-card .order-product-numbers strong { color: #352940; font-size: 9px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.admin-order-card .order-product-numbers > div:last-child strong { color: #7a13aa; }
.admin-order-card .order-items-empty { color: #766d7d; font-size: 10px; }
.admin-order-card-footer { display: grid; gap: 12px; padding: 13px 20px 17px; border-top: 1px solid #eee7f2; }
.admin-order-card .order-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; }
.admin-order-card .order-card-meta span { color: #766d7d; font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.admin-order-card .order-card-meta strong { color: #352940; font: 600 10px/1.45 "Montserrat", sans-serif; overflow-wrap: anywhere; }
.admin-order-card .order-card-meta .order-summary-total strong { color: #7a13aa; font-size: 14px; font-weight: 700; white-space: nowrap; }
.admin-order-card .order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-order-card .order-actions .button { min-height: 34px; padding: 8px 12px; font: 600 9px "Montserrat", sans-serif; }
.inventory-availability-button, .inventory-delete-button { width: 100%; margin-top: 7px; padding: 8px 10px !important; font: 600 9px "Montserrat", sans-serif !important; }
.inventory-delete-button { border: 1px solid #efd9e1; color: #8a2844; background: #fff; }
.inventory-delete-button:hover { border-color: #dcaabb; background: #fff8fa; }
#inventory-rows td:last-child { min-width: 220px; }
@media (max-width: 640px) {
  .orders-bucket-heading { align-items: flex-start; }
  .orders-toggle-all { min-height: 32px; padding: 0 11px; }
  .orders-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .admin-order-card { max-width: none; min-height: 0; aspect-ratio: auto; }
  .admin-order-card-header { min-height: 116px; padding: 16px; }
  .admin-order-card-body { padding: 15px 16px 10px; }
  .admin-order-card-footer { padding: 12px 16px 15px; }
  .admin-order-card .order-customer-fields { gap: 9px 12px; }
  .admin-order-card .order-card-meta { gap: 8px 12px; }
}

/* Compact cards start collapsed; each order expands independently on demand. */
.admin-order-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
  border: 1px solid #e5d8ee;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(59, 27, 77, .08);
  font-family: "Montserrat", sans-serif;
}
.admin-order-card-header {
  min-height: 0;
  padding: 15px 18px 13px;
  border-radius: 15px 15px 0 0;
  background: #8a4aaf;
}
.admin-order-card .order-customer-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 15px;
}
.admin-order-card .order-customer-fields span { color: #f5eafa; font-size: 8px; }
.admin-order-card .order-customer-fields strong { color: #fff; font-size: 11px; }
.order-card-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 9px 13px;
  min-width: 0;
  padding: 12px 18px;
  border-bottom: 1px solid #eee6f3;
  background: #fff;
}
.order-card-summary > div, .order-expanded-customer > div { display: grid; gap: 4px; min-width: 0; }
.order-card-summary span, .order-expanded-customer span {
  color: #766d7d;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.order-card-summary strong, .order-expanded-customer strong {
  color: #352940;
  font: 600 10px/1.45 "Montserrat", sans-serif;
  overflow-wrap: anywhere;
}
.order-card-summary .order-summary-total strong { color: #7a13aa; font-size: 12px; }
.order-view-toggle { min-height: 32px; padding: 0 14px; font-size: 10px; }
.order-details-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .28s ease, opacity .2s ease;
}
.admin-order-card[data-expanded="true"] .order-details-panel { grid-template-rows: 1fr; opacity: 1; }
.order-details-inner { min-height: 0; overflow: hidden; }
.admin-order-card[data-expanded="true"] { min-height: 360px; }
.admin-order-card-body { flex: 0 0 auto; padding: 15px 18px 8px; }
.order-expanded-customer { margin: 0 0 14px; padding: 10px 12px; border-left: 3px solid #9b68b7; background: #fbf8fd; }
.order-items-heading { margin-bottom: 8px; color: #34203f; font: 700 11px/1.4 "Montserrat", sans-serif; }
.admin-order-card .order-product-row { grid-template-columns: 48px minmax(0, 1fr); gap: 8px 11px; padding: 10px 0; }
.admin-order-card .order-product-thumbnail { width: 48px; height: 48px; }
.admin-order-card .order-product-info strong { font-size: 10px; }
.admin-order-card .order-product-info span { font-size: 9px; }
.admin-order-card .order-product-numbers strong { font-size: 9px; }
.admin-order-card-footer { gap: 11px; padding: 12px 18px 16px; border-top: 1px solid #eee7f2; }
.admin-order-card .order-card-meta { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px 12px; }
.admin-order-card .order-card-meta strong { font-size: 9px; }
.admin-order-card .order-actions .button { min-height: 34px; font-size: 9px; }

@media (max-width: 640px) {
  .admin-order-card { max-width: none; }
  .admin-order-card-header { padding: 13px 14px 12px; }
  .admin-order-card .order-customer-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .order-card-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 11px 14px; }
  .order-view-toggle { justify-self: start; }
  .admin-order-card[data-expanded="true"] { min-height: 0; }
  .admin-order-card-body { padding: 13px 14px 8px; }
  .admin-order-card-footer { padding: 11px 14px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .order-details-panel { transition: none; }
}

/* Inventory management tabs, entry forms, and Supabase product cards. */
.inventory-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 12px; padding-bottom: 10px; border-bottom: 1px solid #eee7f2; }
.inventory-tab { min-height: 39px; padding: 0 16px; border: 1px solid #e6d9ee; border-radius: 9px; color: #513563; background: #fff; font: 600 11px/1.2 "Montserrat", sans-serif; }
.inventory-tab[aria-selected="true"] { border-color: #7a13aa; color: #fff; background: #7a13aa; box-shadow: 0 4px 12px #7a13aa24; }
.inventory-tab:focus-visible { outline: 2px solid #9b68b7; outline-offset: 2px; }
.inventory-tab-panel[hidden], .inventory-product-editor[hidden], .inventory-product-image[hidden], .inventory-image-placeholder[hidden] { display: none !important; }
.inventory-tab-panel > .simple-panel { margin-top: 0; }
.inventory-single-form { display: grid; grid-template-columns: minmax(200px, .72fr) minmax(0, 1.28fr); align-items: stretch; gap: 18px 24px; }
.inventory-single-image, .inventory-single-fields { display: grid; align-content: start; gap: 14px; min-width: 0; }
.inventory-single-form .inventory-field { display: grid; gap: 7px; min-width: 0; color: #342940; font: 600 11px/1.4 "Montserrat", sans-serif; }
.inventory-single-form .inventory-field-hint { color: #796d80; font-size: 9px; font-weight: 400; }
.inventory-single-form input, .inventory-single-form select { width: 100%; min-width: 0; min-height: 42px; padding: 0 11px; border: 1px solid #ded2e7; border-radius: 8px; color: #29232e; background: #fff; font: 500 12px "Montserrat", sans-serif; }
.inventory-single-form input[type="file"] { height: auto; padding: 8px; font-size: 10px; }
.inventory-single-form input:focus-visible, .inventory-single-form select:focus-visible, .inventory-editor-fields input:focus-visible, .inventory-editor-fields select:focus-visible { outline: 2px solid #9b68b7; outline-offset: 1px; }
.inventory-upload-preview { min-height: 146px; display: grid; justify-items: center; align-content: center; gap: 8px; margin: 0; padding: 14px; border: 1px dashed #d7c7e2; border-radius: 12px; background: #fcfaff; text-align: center; }
.inventory-upload-preview img { width: min(100%, 190px); height: 132px; object-fit: contain; }
.inventory-field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 13px; }
.inventory-form-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.inventory-form-actions .button { min-height: 40px; border-radius: 8px; font: 600 11px "Montserrat", sans-serif; }
.inventory-reset, .button-secondary { border: 1px solid #d9cbe3; color: #5d3d70; background: #fff; }
.inventory-filters { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(180px, .8fr); gap: 14px; }
.inventory-filters .inventory-search { width: 100%; margin: 0; color: #493457; font-family: "Montserrat", sans-serif; }
.inventory-filters input, .inventory-filters select { min-height: 41px; border: 1px solid #ded2e7; border-radius: 8px; font: 500 11px "Montserrat", sans-serif; }
.inventory-list-feedback { min-height: 16px; margin: 12px 0 8px; color: #6d5d76; font: 500 10px/1.5 "Montserrat", sans-serif; }
.inventory-product-list { display: grid; gap: 10px; min-width: 0; }
.inventory-product-card { display: grid; grid-template-columns: 82px minmax(0, 1fr) minmax(155px, 190px); align-items: center; gap: 10px 15px; min-width: 0; padding: 12px; border: 1px solid #ece5f0; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px #2e1a3d0a; font-family: "Montserrat", sans-serif; }
.inventory-product-preview-area { width: 82px; height: 82px; display: grid; place-items: center; overflow: hidden; border: 1px solid #eee7f2; border-radius: 10px; background: #fcfbfd; }
.inventory-product-image { width: 100%; height: 100%; object-fit: contain; }
.inventory-image-placeholder { color: #887b91; font-size: 9px; text-align: center; }
.inventory-product-summary, .inventory-product-heading { display: grid; gap: 8px; min-width: 0; }
.inventory-product-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.inventory-product-heading h3 { margin: 0; color: #302438; font: 650 12px/1.45 "Montserrat", sans-serif; overflow-wrap: anywhere; }
.inventory-product-status { width: fit-content; min-height: 22px; padding: 2px 8px; font: 600 8px "Montserrat", sans-serif; white-space: nowrap; }
.inventory-product-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.inventory-product-fact { display: grid; gap: 3px; }
.inventory-product-fact > span { color: #857790; font-size: 8px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.inventory-product-fact > strong { color: #554762; font-size: 10px; font-weight: 500; }
.inventory-product-fact.inventory-product-price > strong { color: #7622a0; font-weight: 700; }
.inventory-product-actions { display: grid; gap: 7px; min-width: 0; }
.inventory-product-actions .button { width: 100%; min-height: 34px; padding: 0 9px; border-radius: 7px; font: 600 9px "Montserrat", sans-serif; }
.inventory-product-editor { grid-column: 1 / -1; display: grid; gap: 12px; padding: 12px; border-top: 1px solid #eee7f2; background: #fdfbff; }
.inventory-editor-fields { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(140px, 1fr) minmax(110px, .7fr) minmax(180px, 1.2fr); gap: 10px; min-width: 0; }
.inventory-edit-field { display: grid; gap: 6px; min-width: 0; color: #493457; font: 600 9px/1.4 "Montserrat", sans-serif; }
.inventory-edit-field input, .inventory-edit-field select { width: 100%; min-width: 0; min-height: 37px; padding: 0 8px; border: 1px solid #ded2e7; border-radius: 7px; color: #302438; background: #fff; font: 500 10px "Montserrat", sans-serif; }
.inventory-edit-field input[type="file"] { height: auto; padding: 7px; font-size: 9px; }
.inventory-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.inventory-editor-actions .button { min-height: 33px; padding: 0 12px; border-radius: 7px; font: 600 9px "Montserrat", sans-serif; }
.inventory-card-feedback { flex-basis: 100%; min-height: 14px; margin: 0; color: #68447c; font: 500 9px/1.5 "Montserrat", sans-serif; }
.inventory-delete-button { border: 1px solid #efd9e1; color: #8a2844; background: #fff; }
.inventory-delete-button:disabled { cursor: not-allowed; opacity: .7; }
.inventory-empty-state { margin: 0; padding: 22px 12px; border: 1px dashed #e2d6e9; border-radius: 10px; color: #786b80; font: 500 11px "Montserrat", sans-serif; text-align: center; }

@media (max-width: 850px) {
  .inventory-product-card { grid-template-columns: 72px minmax(0, 1fr); }
  .inventory-product-preview-area { width: 72px; height: 72px; }
  .inventory-product-actions { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-editor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .inventory-tabs { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .inventory-tab { width: 100%; text-align: left; }
  .inventory-single-form, .inventory-field-pair, .inventory-filters { grid-template-columns: minmax(0, 1fr); }
  .inventory-single-image { grid-row: 1; }
  .inventory-product-card { grid-template-columns: 58px minmax(0, 1fr); gap: 9px 11px; padding: 10px; }
  .inventory-product-preview-area { width: 58px; height: 58px; }
  .inventory-product-heading { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .inventory-product-actions { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .inventory-editor-fields { grid-template-columns: minmax(0, 1fr); }
  .inventory-editor-actions .button { flex: 1 1 120px; }
  .inventory-single-form .inventory-form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .inventory-single-form .inventory-form-actions .button { width: 100%; padding: 0 8px; }
}
