
:root {
  --canvas: #F5F6F8;
  --surface: #FFFFFF;
  --surface-soft: #F9FAFB;
  --surface-hover: #F8FAFC;

  --border: #E2E6EC;
  --border-strong: #D4D9E1;

  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --muted-2: #98A2B3;

  --brand: #635BFF;
  --brand-hover: #554DF2;
  --brand-soft: #F1EFFF;

  --green: #16A34A;
  --green-soft: #ECFDF3;
  --amber: #D97706;
  --amber-soft: #FFF7E8;
  --blue: #2563EB;
  --blue-soft: #EFF6FF;
  --cyan: #0891B2;
  --cyan-soft: #ECFEFF;
  --red: #DC2626;
  --red-soft: #FEF2F2;

  --sidebar-w: 248px;

  --shadow-card:
    0 1px 2px rgba(16,24,40,.04),
    0 8px 24px rgba(16,24,40,.04);

  --shadow-panel:
    0 1px 2px rgba(16,24,40,.04),
    0 14px 34px rgba(16,24,40,.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
}

html {
  color-scheme: light;
}

body {
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "SF Pro Display",
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    linear-gradient(180deg, #F8F9FB 0%, #F5F6F8 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* =========================================================
   Brand / shared
   ========================================================= */

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo-shell {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px;
  max-width: 52px;
  flex: 0 0 52px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
}

.brand-logo-shell.small {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px;
  max-width: 42px;
  flex-basis: 42px;
  border-radius: 12px;
}

img.brand-logo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 10px;
}

.brand-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .11em;
  white-space: nowrap;
}

.brand-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

/* =========================================================
   Authentication
   ========================================================= */

.auth-shell {
  min-height: 100vh;
  padding: 24px;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(99,91,255,.07), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(37,99,235,.04), transparent 28%),
    #F6F7F9;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(17,24,39,.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,24,39,.014) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 42%, #000, transparent 78%);
}

.auth-card {
  width: min(510px,100%);
  position: relative;
  z-index: 1;
  padding: 34px;
  border-radius: 26px;
  color: var(--text);
  background: rgba(255,255,255,.98);
  border: 1px solid var(--border);
  box-shadow: 0 28px 80px rgba(16,24,40,.10);
}

.auth-copy {
  margin-top: 34px;
}

.eyebrow,
.panel-eyebrow,
.section-heading > div > span {
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .13em;
}

.auth-copy h1 {
  margin: 10px 0 8px;
  color: var(--text);
  font-size: clamp(34px,6vw,44px);
  line-height: 1.02;
  font-weight: 780;
  letter-spacing: -.045em;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form label > span {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  color: var(--text);
  outline: none;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}

.auth-form input::placeholder {
  color: var(--muted-2);
}

.auth-form input:focus {
  border-color: #A5A0FF;
  box-shadow: 0 0 0 3px rgba(99,91,255,.08);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 80px;
}

.password-toggle {
  position: absolute;
  right: 7px;
  top: 7px;
  height: 38px;
  padding: 0 11px;
  color: var(--brand);
  border: 1px solid #DDD9FF;
  border-radius: 9px;
  background: var(--brand-soft);
  font-size: 11px;
  font-weight: 700;
}

.auth-foot {
  margin-top: 20px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.shield-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.mfa-enrollment {
  display: grid;
  gap: 15px;
}

.mfa-qr-shell {
  display: grid;
  place-items: center;
  padding: 15px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid var(--border);
}

.mfa-qr-shell img {
  width: min(230px,100%);
  height: auto;
}

.mfa-setup-copy {
  display: grid;
  gap: 5px;
}

.mfa-setup-copy strong {
  color: var(--text);
  font-size: 14px;
}

.mfa-setup-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.mfa-secret-box {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.mfa-secret-box > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mfa-secret-box span {
  color: var(--muted);
  font-size: 11px;
}

.mfa-secret-box code {
  color: var(--text-2);
  overflow-wrap: anywhere;
  font-size: 11px;
}

.mfa-code-input {
  text-align: center;
  letter-spacing: .28em;
  font-size: 21px !important;
  font-weight: 800;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 720;
  transition: .14s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #FFFFFF;
  background: var(--brand);
  border-color: var(--brand);
}

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

.btn-secondary,
.btn-ghost {
  color: var(--text-2);
  background: #FFFFFF;
  border-color: var(--border);
}

.btn-large {
  min-height: 52px;
}

.full {
  width: 100%;
}

.btn-spinner,
.big-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.big-spinner {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   Dashboard shell
   ========================================================= */

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0,1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px 16px;
  color: var(--text);
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.sidebar-brand {
  padding: 3px 5px 10px;
}

.workspace-card {
  margin: 15px 1px 0;
  min-height: 58px;
  padding: 10px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.workspace-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #FFFFFF;
  background: var(--brand);
  font-size: 11px;
}

.workspace-card > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.workspace-card > div:nth-child(2) span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .10em;
}

.workspace-card > div:nth-child(2) strong {
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-live {
  min-height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #15803D;
  background: var(--green-soft);
  border: 1px solid #CDEFD8;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
}

.workspace-live span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.sidebar-section-label {
  margin: 25px 10px 10px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 12px;
  font-weight: 680;
}

.nav-item:hover {
  color: var(--text);
  background: #F8F9FB;
}

.nav-item.active {
  color: var(--text);
  background: var(--brand-soft);
  border-color: #E0DCFF;
}

.nav-item.active::before {
  content: "";
  width: 3px;
  height: 20px;
  position: absolute;
  margin-left: -12px;
  border-radius: 999px;
  background: var(--brand);
}

.nav-item {
  position: relative;
}

.nav-icon {
  color: #667085;
  font-size: 13px;
}

.nav-item.active .nav-icon {
  color: var(--brand);
}

.nav-count {
  min-width: 23px;
  height: 21px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #F2F4F7;
  border-radius: 6px;
  font-size: 9px;
}

.nav-item.active .nav-count {
  color: var(--brand);
  background: #EAE7FF;
}

.status-dot,
.queue-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
}

.status-dot.new,
.queue-dot.new {
  background: var(--amber);
}

.status-dot.confirmed,
.queue-dot.confirmed {
  background: var(--brand);
}

.status-dot.printing,
.queue-dot.printing {
  background: var(--blue);
}

.status-dot.shipped,
.queue-dot.shipped {
  background: var(--cyan);
}

.status-dot.delivered,
.queue-dot.delivered {
  background: var(--green);
}

.status-dot.cancelled {
  background: var(--red);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 9px;
}

.admin-mini {
  padding: 9px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #FFFFFF;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  background: var(--brand);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.admin-mini-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-mini-copy strong {
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-mini-copy span {
  color: var(--muted-2);
  font-size: 9px;
}

/* =========================================================
   Main area
   ========================================================= */

.main {
  min-width: 0;
  width: 100%;
  padding: 26px 30px 34px;
}

.enterprise-header {
  min-height: 92px;
  padding-bottom: 19px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}

.enterprise-header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.page-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
}

.page-kicker i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted-2);
}

.page-kicker strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: normal;
}

.page-title h1 {
  margin: 9px 0 5px;
  color: var(--text);
  font-size: clamp(34px,2.7vw,44px);
  line-height: 1;
  font-weight: 780;
  letter-spacing: -.048em;
}

.page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.enterprise-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.security-state {
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #15803D;
  background: var(--green-soft);
  border: 1px solid #D4F0DD;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 780;
}

.security-state span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.header-profile {
  min-height: 44px;
  padding: 5px 10px 5px 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FFFFFF;
}

.header-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  background: var(--brand);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.header-profile-copy {
  max-width: 165px;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.header-profile-copy strong {
  color: var(--text);
  font-size: 11px;
}

.header-profile-copy span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.refresh-button {
  min-height: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 720;
}

.refresh-button:hover {
  color: var(--text);
  background: #F8F9FB;
  border-color: var(--border-strong);
}

.refresh-button span {
  font-size: 14px;
}

.mobile-only {
  display: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #FFFFFF;
}

/* =========================================================
   KPI row
   ========================================================= */

.section-heading {
  margin-top: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.section-heading h2 {
  margin: 5px 0 0;
  color: var(--text-2);
  font-size: 17px;
  font-weight: 730;
  letter-spacing: -.025em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.stat-card {
  min-height: 118px;
  padding: 17px;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr);
  gap: 13px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

.stat-icon.purple {
  color: var(--brand);
  background: var(--brand-soft);
}

.stat-icon.orange {
  color: var(--amber);
  background: var(--amber-soft);
}

.stat-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.stat-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

.metric-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.metric-copy > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.metric-copy > strong {
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  font-weight: 770;
  letter-spacing: -.045em;
}

.metric-copy > small {
  color: var(--muted-2);
  font-size: 10px;
}

/* =========================================================
   Order workspace
   ========================================================= */

.orders-panel {
  margin-top: 17px;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-panel);
}

.orders-panel-heading {
  min-height: 82px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.orders-panel-heading h2 {
  margin: 5px 0 3px;
  color: var(--text);
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -.025em;
}

.orders-panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-security {
  min-width: 210px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #F6FBF8;
  border: 1px solid #DDEFE4;
  border-radius: 10px;
}

.panel-security-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
}

.panel-security > div {
  display: grid;
  gap: 1px;
}

.panel-security strong {
  color: #166534;
  font-size: 10px;
}

.panel-security span {
  color: #6C8B75;
  font-size: 8px;
}

.queue-filter-bar {
  min-height: 55px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.queue-filter-scroll {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.queue-filter-scroll::-webkit-scrollbar {
  display: none;
}

.queue-filter {
  min-height: 34px;
  padding: 0 10px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

.queue-filter:hover {
  color: var(--text);
  background: #F2F4F7;
}

.queue-filter.active {
  color: var(--text);
  background: #FFFFFF;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.queue-filter > span:last-child {
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #F2F4F7;
  border-radius: 5px;
  font-size: 8px;
}

.queue-filter.active > span:last-child {
  color: var(--text-2);
  background: #EAECF0;
}

.queue-live-label {
  min-height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: #FFFFFF;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 680;
}

.queue-live-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.orders-toolbar {
  min-height: 66px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.search-wrap {
  width: min(620px,60%);
  height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.search-wrap:focus-within {
  border-color: #A5A0FF;
  box-shadow: 0 0 0 3px rgba(99,91,255,.07);
}

.search-wrap input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 12px;
}

.search-wrap input::placeholder {
  color: var(--muted-2);
}

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

.select {
  height: 44px;
  padding: 0 11px;
  color: var(--text-2);
  outline: none;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 650;
}

.results-count {
  min-width: 65px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th {
  padding: 13px 14px;
  color: var(--muted);
  text-align: left;
  background: #FAFBFC;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .07em;
  text-transform: uppercase;
}

td {
  padding: 15px 14px;
  color: var(--text-2);
  vertical-align: middle;
  border-bottom: 1px solid #EEF1F4;
  font-size: 12px;
}

tbody tr:hover {
  background: var(--surface-hover);
}

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

.order-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.order-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #F2F4F7;
}

.order-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .32;
  background:
    linear-gradient(
      118deg,
      transparent 26%,
      rgba(255,255,255,.72) 48%,
      transparent 63%
    );
}

.order-thumb span {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  background: #475467;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
}

.thumb-emergency-one {
  background: linear-gradient(145deg,#FFF3C4,#F3E6A6);
}

.thumb-emergency-two {
  background: linear-gradient(145deg,#DBEAFE,#BFDBFE);
}

.thumb-round {
  background: linear-gradient(145deg,#EEEAFE,#DCD5FF);
}

.thumb-bike {
  background: linear-gradient(145deg,#DDF7EF,#C6EBDD);
}

.thumb-default {
  background: #EAECF0;
}

.order-number,
.customer-cell,
.vehicle-cell {
  display: grid;
  gap: 4px;
}

.order-number strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.customer-cell strong,
.vehicle-cell strong {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.order-number span,
.cell-sub {
  color: var(--muted);
  font-size: 10px;
}

.vehicle-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.vehicle-meta i {
  width: 3px;
  height: 3px;
  flex: 0 0 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.material-tag {
  color: var(--muted);
  font-size: 10px;
}

.qty-value {
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: #F2F4F7;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 760;
}

.progress-cell {
  width: 150px;
  display: grid;
  gap: 6px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.progress-copy strong {
  color: var(--text-2);
  font-size: 11px;
}

.progress-copy span {
  color: var(--muted);
  font-size: 9px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #EAECF0;
}

.progress-track > span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

.status-badge,
.payment-badge {
  min-height: 27px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.status-badge.new {
  color: #B45309;
  background: var(--amber-soft);
  border-color: #FAD7A0;
}

.status-badge.confirmed {
  color: #594ED6;
  background: var(--brand-soft);
  border-color: #DAD5FF;
}

.status-badge.printing {
  color: #1D4ED8;
  background: var(--blue-soft);
  border-color: #CFE0FF;
}

.status-badge.shipped {
  color: #0E7490;
  background: var(--cyan-soft);
  border-color: #BCECF4;
}

.status-badge.delivered {
  color: #15803D;
  background: var(--green-soft);
  border-color: #CDEFD8;
}

.status-badge.cancelled {
  color: #B42318;
  background: var(--red-soft);
  border-color: #FFD5D2;
}

.payment-badge {
  color: #594ED6;
  background: var(--brand-soft);
  border-color: #DDD9FF;
}

.row-action {
  min-width: 72px;
  min-height: 33px;
  padding: 0 10px;
  color: var(--text-2);
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 720;
}

.row-action:hover {
  color: var(--text);
  background: #F8F9FB;
  border-color: #C6CAD2;
}

.empty-state,
.loading-state {
  min-height: 250px;
  padding: 34px 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.empty-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #DED9FF;
  border-radius: 11px;
}

.empty-state h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 16px;
}

.empty-state p,
.loading-state p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.empty-reset {
  margin-top: 5px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #DDD9FF;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

/* =========================================================
   Alerts
   ========================================================= */

.alert {
  margin: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
}

.alert.error {
  color: #B42318;
  background: var(--red-soft);
  border: 1px solid #FFD7D5;
}

.alert.success {
  color: #15803D;
  background: var(--green-soft);
  border: 1px solid #CDEFD8;
}

/* =========================================================
   Modal
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(15,23,42,.28);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(820px,100%);
  max-height: min(92vh,920px);
  overflow: auto;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: 0 28px 90px rgba(16,24,40,.18);
}

.modal-header {
  padding: 18px 19px 15px;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 8px 0 3px;
  color: var(--text);
  font-size: 24px;
  font-weight: 740;
  letter-spacing: -.03em;
}

.modal-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.modal-content {
  padding: 16px 18px 20px;
  display: grid;
  gap: 12px;
}

.detail-section {
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.detail-section h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

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

.detail-item {
  padding: 11px;
  display: grid;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.detail-item.wide {
  grid-column: 1 / -1;
}

.detail-item span {
  color: var(--muted);
  font-size: 10px;
}

.detail-item strong {
  color: var(--text-2);
  overflow-wrap: anywhere;
  font-size: 12px;
}

.payment-box,
.print-box,
.status-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payment-box > div,
.print-box > div {
  display: grid;
  gap: 3px;
}

.payment-box span,
.print-box span {
  color: var(--muted);
  font-size: 10px;
}

.payment-box strong,
.print-box strong {
  color: var(--text-2);
  font-size: 12px;
}

.status-controls .select {
  flex: 1;
}

.select.large {
  height: 44px;
}

/* =========================================================
   Footer
   ========================================================= */

.minimal-footer {
  margin-top: 12px;
  padding: 10px 1px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
  font-size: 9px;
}

.minimal-footer-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.minimal-footer-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* =========================================================
   Mobile
   ========================================================= */

.mobile-cards {
  display: none;
}

.orders-cards {
  padding: 10px;
  gap: 9px;
}

.order-card-mobile,
.order-card {
  padding: 12px;
  display: grid;
  gap: 10px;
  color: var(--text-2);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.order-card-mobile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

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

.order-card-mobile-grid > div,
.order-card-item {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.order-card-mobile-grid strong,
.order-card-item strong {
  color: var(--text-2);
  font-size: 12px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1280px) {
  :root {
    --sidebar-w: 224px;
  }

  .stats-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .header-profile-copy {
    display: none;
  }

  .header-profile {
    padding-right: 5px;
  }
}

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

  .sidebar {
    position: fixed;
    left: -260px;
    width: 248px;
    box-shadow: 24px 0 55px rgba(16,24,40,.14);
    transition: left .2s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-only {
    display: grid;
  }

  .main {
    padding: 16px 12px 24px;
  }

  .security-state {
    display: none;
  }

  .enterprise-header {
    align-items: center;
  }

  .panel-security {
    display: none;
  }

  .desktop-table {
    display: none;
  }

  .mobile-cards {
    display: grid;
  }

  .orders-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-wrap {
    width: 100%;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .select {
    flex: 1;
  }

  .queue-live-label {
    display: none;
  }
}

@media (max-width: 600px) {
  .auth-shell {
    padding: 12px;
  }

  .auth-card {
    padding: 22px;
    border-radius: 20px;
  }

  .enterprise-header {
    min-height: auto;
    padding-bottom: 14px;
    align-items: flex-start;
  }

  .page-title h1 {
    font-size: 30px;
  }

  .enterprise-header-actions .header-profile {
    display: none;
  }

  .refresh-button {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .refresh-button:not(:hover) {
    font-size: 0;
  }

  .refresh-button span {
    font-size: 14px;
  }

  .section-heading p {
    display: none;
  }

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

  .stat-card {
    min-height: 92px;
    padding: 13px;
    grid-template-columns: 40px minmax(0,1fr);
  }

  .stat-icon {
    width: 40px;
    height: 40px;
  }

  .metric-copy > strong {
    font-size: 28px;
  }

  .orders-panel-heading {
    padding: 14px;
  }

  .queue-filter-bar {
    padding-right: 8px;
  }

  .queue-filter {
    min-height: 32px;
    padding: 0 9px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-item.wide {
    grid-column: auto;
  }

  .payment-box,
  .print-box,
  .status-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .minimal-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* =========================================================
   V22 — Premium Order Details Drawer
   ========================================================= */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, .20);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .18s ease;
}

.drawer-backdrop.open {
  opacity: 1;
}

.order-drawer {
  width: min(610px, 94vw);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #FFFFFF;
  border-left: 1px solid var(--border);
  box-shadow:
    -18px 0 60px rgba(16,24,40,.12),
    -2px 0 8px rgba(16,24,40,.04);
  transform: translateX(34px);
  transition: transform .20s ease;
}

.drawer-backdrop.open .order-drawer {
  transform: translateX(0);
}

.drawer-header {
  min-height: 124px;
  padding: 24px 25px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg,#FFFFFF 0%,#FDFDFE 100%);
}

.drawer-heading {
  min-width: 0;
}

.drawer-heading-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-created {
  color: var(--muted);
  font-size: 11px;
}

.drawer-created strong {
  color: var(--text-2);
  font-weight: 650;
}

.drawer-heading h2 {
  margin: 12px 0 6px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -.045em;
}

.drawer-heading p {
  max-width: 455px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.drawer-close {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
}

.drawer-close:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.drawer-scroll {
  min-height: 0;
  padding: 20px 22px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #FBFCFD;
}

.drawer-preview-section {
  padding: 16px;
  display: grid;
  grid-template-columns: 88px minmax(0,1fr) 92px;
  gap: 15px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.drawer-sticker-preview {
  width: 88px;
  height: 88px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  background: #F2F4F7;
}

.drawer-sticker-preview img {
  width: 50px;
  height: 50px;
  position: relative;
  z-index: 2;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(16,24,40,.14);
}

.drawer-preview-shine {
  position: absolute;
  inset: -30% -80%;
  z-index: 1;
  transform: rotate(23deg);
  background:
    linear-gradient(
      100deg,
      transparent 38%,
      rgba(255,255,255,.68) 48%,
      rgba(255,255,255,.14) 55%,
      transparent 66%
    );
}

.drawer-sticker-preview.thumb-emergency-one {
  background:
    linear-gradient(145deg,#FFF4CE,#F7E29A);
}

.drawer-sticker-preview.thumb-emergency-two {
  background:
    linear-gradient(145deg,#E5F0FF,#BFD7FF);
}

.drawer-sticker-preview.thumb-round {
  background:
    linear-gradient(145deg,#F0ECFF,#DCD4FF);
}

.drawer-sticker-preview.thumb-bike {
  background:
    linear-gradient(145deg,#E3F8F1,#C6EBDD);
}

.drawer-sticker-preview.thumb-default {
  background: #EEF1F4;
}

.drawer-preview-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.drawer-preview-copy > span,
.drawer-quantity-card > span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
}

.drawer-preview-copy > strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 740;
}

.drawer-preview-copy > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.drawer-quantity-card {
  min-height: 76px;
  padding: 11px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  text-align: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.drawer-quantity-card > strong {
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  font-weight: 780;
}

.drawer-quantity-card > small {
  color: var(--muted);
  font-size: 10px;
}

.drawer-section {
  margin-top: 14px;
  padding: 16px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.drawer-section-heading {
  margin-bottom: 13px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.drawer-section-heading > div {
  display: grid;
  gap: 3px;
}

.drawer-section-heading span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
}

.drawer-section-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 730;
}

.drawer-section-heading > small {
  color: var(--muted);
  font-size: 10px;
}

.drawer-timeline {
  display: grid;
  grid-template-columns:
    minmax(66px,1fr) 18px
    minmax(66px,1fr) 18px
    minmax(66px,1fr) 18px
    minmax(66px,1fr) 18px
    minmax(66px,1fr);
  align-items: start;
}

.timeline-step {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.timeline-step > div:last-child {
  display: grid;
  gap: 2px;
}

.timeline-marker {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #F2F4F7;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.timeline-step strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.timeline-step span {
  color: var(--muted-2);
  font-size: 8px;
}

.timeline-connector {
  height: 2px;
  margin-top: 14px;
  border-radius: 999px;
  background: #E6E9EE;
}

.timeline-step.complete .timeline-marker {
  color: #FFFFFF;
  background: var(--green);
  border-color: var(--green);
}

.timeline-step.complete strong {
  color: var(--text-2);
}

.timeline-step.current .timeline-marker {
  color: #FFFFFF;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(99,91,255,.08);
}

.timeline-step.current strong {
  color: var(--brand);
}

.timeline-connector.complete {
  background: var(--green);
}

.timeline-step.cancelled {
  opacity: .45;
}

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

.drawer-detail-card {
  min-height: 88px;
  padding: 12px;
  position: relative;
  display: grid;
  align-content: start;
  gap: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.drawer-detail-card.wide {
  grid-column: 1 / -1;
}

.drawer-detail-card > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.drawer-detail-card > strong {
  max-width: calc(100% - 58px);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.address-card > strong {
  max-width: calc(100% - 96px);
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
}

.copy-button:hover {
  color: var(--brand);
  border-color: #CFC9FF;
  background: var(--brand-soft);
}

.copy-button.copied {
  color: #15803D;
  border-color: #CDEFD8;
  background: var(--green-soft);
}

.drawer-payment-card {
  min-height: 72px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.drawer-payment-card > div {
  display: grid;
  gap: 4px;
}

.drawer-payment-card > div > span {
  color: var(--muted);
  font-size: 10px;
}

.drawer-payment-card > div > strong {
  color: var(--text-2);
  font-size: 13px;
}

.drawer-file-card {
  min-height: 72px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 11px;
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.drawer-file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #B42318;
  background: #FFF1F0;
  border: 1px solid #FFD9D5;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 850;
}

.drawer-file-card > div:nth-child(2) {
  display: grid;
  gap: 3px;
}

.drawer-file-card > div:nth-child(2) strong {
  color: var(--text-2);
  font-size: 12px;
}

.drawer-file-card > div:nth-child(2) span {
  color: var(--muted);
  font-size: 9px;
}

.drawer-file-state {
  min-height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #15803D;
  background: var(--green-soft);
  border: 1px solid #CDEFD8;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 750;
}

.drawer-file-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.drawer-actions {
  position: relative;
  padding: 13px 16px 16px;
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 28px rgba(16,24,40,.05);
  backdrop-filter: blur(16px);
}

.drawer-status-row {
  display: grid;
  grid-template-columns: minmax(150px,1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.drawer-status-select {
  display: grid;
  gap: 5px;
}

.drawer-status-select > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}

.drawer-status-select .select {
  width: 100%;
}

.drawer-pdf-button,
.drawer-update-button {
  min-height: 44px;
  white-space: nowrap;
}

.btn-danger {
  min-height: 40px;
  padding: 0 12px;
  color: #FFFFFF;
  background: #D92D20;
  border: 1px solid #D92D20;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 720;
}

.btn-danger:hover {
  background: #B42318;
}

.drawer-confirm {
  margin-bottom: 11px;
  padding: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #FFF9EE;
  border: 1px solid #F6D89A;
  border-radius: 10px;
}

.drawer-confirm-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.drawer-confirm-copy strong {
  color: #92400E;
  font-size: 11px;
}

.drawer-confirm-copy span {
  max-width: 330px;
  color: #A15C13;
  font-size: 9px;
  line-height: 1.4;
}

.drawer-confirm-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 7px;
}

.drawer-confirm-actions .btn {
  min-height: 40px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .order-drawer {
    width: 100vw;
  }

  .drawer-header {
    padding: 20px 18px 17px;
  }

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

  .drawer-scroll {
    padding: 15px 14px 22px;
  }

  .drawer-preview-section {
    grid-template-columns: 72px minmax(0,1fr);
  }

  .drawer-sticker-preview {
    width: 72px;
    height: 72px;
  }

  .drawer-sticker-preview img {
    width: 42px;
    height: 42px;
  }

  .drawer-quantity-card {
    grid-column: 1 / -1;
    min-height: 62px;
    grid-template-columns: auto auto auto;
    justify-content: start;
    align-items: center;
    gap: 7px;
    text-align: left;
  }

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

  .timeline-step {
    grid-template-columns: 32px minmax(0,1fr);
    justify-items: start;
    align-items: center;
    text-align: left;
  }

  .timeline-step > div:last-child {
    text-align: left;
  }

  .timeline-connector {
    width: 2px;
    height: 17px;
    margin: -2px 0 -2px 14px;
  }

  .drawer-detail-grid {
    grid-template-columns: 1fr;
  }

  .drawer-detail-card.wide {
    grid-column: auto;
  }

  .drawer-status-row {
    grid-template-columns: 1fr 1fr;
  }

  .drawer-status-select {
    grid-column: 1 / -1;
  }

  .drawer-confirm {
    align-items: stretch;
    flex-direction: column;
  }

  .drawer-confirm-copy span {
    max-width: none;
  }

  .drawer-confirm-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .drawer-status-row {
    grid-template-columns: 1fr;
  }

  .drawer-status-select,
  .drawer-pdf-button,
  .drawer-update-button {
    grid-column: auto;
    width: 100%;
  }

  .drawer-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}


/* =========================================================
   V23 — Order Sorting
   ========================================================= */

.sort-control {
  min-width: 150px;
  height: 44px;
  padding: 5px 9px 4px;
  display: grid;
  align-content: center;
  gap: 1px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.sort-control > span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
}

.sort-control .select {
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  box-shadow: none;
  font-size: 10px;
}

.sort-control:focus-within {
  border-color: #A5A0FF;
  box-shadow: 0 0 0 3px rgba(99,91,255,.07);
}

@media (max-width: 820px) {
  .toolbar-right {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: stretch;
  }

  .sort-control {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .toolbar-right {
    grid-template-columns: 1fr;
  }

  .results-count {
    min-width: 0;
    text-align: left;
  }
}


/* =========================================================
   V24 — New Order Alerts
   ========================================================= */

.enterprise-header-actions {
  position: relative;
}

.notification-center {
  position: relative;
}

.notification-button {
  width: 44px;
  height: 44px;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: .14s ease;
}

.notification-button:hover,
.notification-button[aria-expanded="true"] {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #D8D2FF;
}

.notification-bell {
  font-size: 19px;
  line-height: 1;
  transform: rotate(45deg);
}

.notification-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  background: #E5484D;
  border: 2px solid #F5F6F8;
  border-radius: 999px;
  font-size: 8px;
  line-height: 1;
  font-weight: 850;
}

.notification-menu {
  width: 390px;
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 80;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 18px 50px rgba(16,24,40,.13),
    0 2px 8px rgba(16,24,40,.05);
}

.notification-menu-header {
  min-height: 72px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.notification-menu-header > div {
  display: grid;
  gap: 2px;
}

.notification-menu-header > div > span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .10em;
}

.notification-menu-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 740;
}

.notification-count {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  color: #B45309;
  background: var(--amber-soft);
  border: 1px solid #F5D59D;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.notification-list {
  max-height: 360px;
  overflow-y: auto;
}

.notification-order {
  width: 100%;
  min-height: 70px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: 8px minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  color: inherit;
  background: #FFFFFF;
  border: 0;
  border-bottom: 1px solid #EEF1F4;
}

.notification-order:hover {
  background: #F9FAFB;
}

.notification-order:last-child {
  border-bottom: 0;
}

.notification-order-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(217,119,6,.08);
}

.notification-order-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.notification-order-copy strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 760;
}

.notification-order-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notification-order-time {
  max-width: 105px;
  color: var(--muted-2);
  font-size: 8px;
  text-align: right;
}

.notification-empty {
  min-height: 145px;
  padding: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  text-align: center;
}

.notification-empty > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #15803D;
  background: var(--green-soft);
  border: 1px solid #CDEFD8;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

.notification-empty strong {
  color: var(--text);
  font-size: 12px;
}

.notification-empty small {
  color: var(--muted);
  font-size: 9px;
}

.notification-view-all {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--brand);
  background: #FBFAFF;
  border: 0;
  border-top: 1px solid var(--border);
  font-size: 10px;
  font-weight: 750;
}

.notification-view-all:hover {
  background: var(--brand-soft);
}

.attention-row {
  position: relative;
  background: #FFFCF6;
}

.attention-row:hover {
  background: #FFF9ED;
}

.attention-row td:first-child {
  position: relative;
}

.attention-row td:first-child::before {
  content: "";
  width: 3px;
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  border-radius: 999px;
  background: var(--amber);
}

.order-number-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.attention-label {
  min-height: 19px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  color: #B45309 !important;
  background: var(--amber-soft);
  border: 1px solid #F5D59D;
  border-radius: 999px;
  font-size: 7px !important;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.attention-card {
  border-color: #F1D49D;
  background: #FFFCF6;
}

@media (max-width: 900px) {
  .notification-menu {
    position: fixed;
    top: 78px;
    right: 14px;
    width: min(390px, calc(100vw - 28px));
  }
}

@media (max-width: 600px) {
  .notification-button {
    width: 42px;
    height: 42px;
  }

  .notification-menu {
    top: 70px;
  }

  .notification-order-time {
    display: none;
  }

  .notification-order {
    grid-template-columns: 8px minmax(0,1fr);
  }
}


/* =========================================================
   V25 — Automatic Background Refresh
   ========================================================= */

.auto-sync-status {
  min-height: 44px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: .15s ease;
}

.auto-sync-status > div {
  display: grid;
  gap: 1px;
  white-space: nowrap;
}

.auto-sync-status strong {
  color: var(--text-2);
  font-size: 9px;
  font-weight: 750;
}

.auto-sync-status span:last-child {
  color: var(--muted);
  font-size: 8px;
}

.auto-sync-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22,163,74,.07);
}

.auto-sync-status.syncing .auto-sync-dot {
  background: var(--blue);
  animation: autoSyncPulse 1s ease-in-out infinite;
}

.auto-sync-status.sync-error {
  background: #FFF8F7;
  border-color: #F4D5D1;
}

.auto-sync-status.sync-error .auto-sync-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(220,38,38,.06);
}

.auto-sync-status.sync-paused .auto-sync-dot {
  background: var(--muted-2);
  box-shadow: none;
}

@keyframes autoSyncPulse {
  0% {
    transform: scale(.86);
    opacity: .65;
  }

  50% {
    transform: scale(1.14);
    opacity: 1;
  }

  100% {
    transform: scale(.86);
    opacity: .65;
  }
}

.notification-button.new-order-arrived {
  animation: newOrderArrival 1.1s ease-in-out 2;
}

@keyframes newOrderArrival {
  0%,
  100% {
    transform: scale(1);
    box-shadow: none;
  }

  50% {
    transform: scale(1.06);
    border-color: #F2BF63;
    box-shadow:
      0 0 0 5px rgba(217,119,6,.08),
      0 8px 18px rgba(217,119,6,.09);
  }
}

@media (max-width: 1040px) {
  .auto-sync-status {
    display: none;
  }
}


/* =========================================================
   V27 — Steadfast Courier Fulfilment
   ========================================================= */

.courier-heading {
  align-items: center;
}

.courier-provider-badge {
  min-height: 27px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  color: #0E7490;
  background: #ECFEFF;
  border: 1px solid #BCECF4;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .06em;
}

.courier-notice {
  margin-bottom: 12px;
  padding: 10px 11px;
  color: #92400E;
  background: #FFF9EE;
  border: 1px solid #F4D79E;
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.45;
}

.courier-notice.ready {
  color: #166534;
  background: #F4FBF6;
  border-color: #CFE8D7;
}

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

.courier-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.courier-field.wide {
  grid-column: 1 / -1;
}

.courier-field > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}

.courier-money-input,
.courier-static-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--text-2);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.courier-money-input:focus-within {
  border-color: #A5A0FF;
  box-shadow: 0 0 0 3px rgba(99,91,255,.06);
}

.courier-money-input > span {
  padding-left: 12px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 750;
}

.courier-money-input input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 12px 0 6px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
  font-weight: 700;
}

.courier-static-field {
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 650;
}

.courier-field textarea {
  width: 100%;
  min-height: 78px;
  max-height: 150px;
  padding: 11px 12px;
  resize: vertical;
  color: var(--text-2);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
}

.courier-field textarea:focus {
  border-color: #A5A0FF;
  box-shadow: 0 0 0 3px rgba(99,91,255,.06);
}

.courier-booking-summary {
  margin-top: 10px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.courier-booking-summary > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.courier-booking-summary span {
  color: var(--muted);
  font-size: 9px;
}

.courier-booking-summary strong {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.courier-book-button {
  width: 100%;
  margin-top: 10px;
  min-height: 46px;
}

.courier-book-button:disabled {
  cursor: not-allowed;
  opacity: .48;
  transform: none;
}

.courier-booked-card {
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.courier-booked-top {
  min-height: 84px;
  padding: 13px;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
}

.courier-booked-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #15803D;
  background: var(--green-soft);
  border: 1px solid #CDEFD8;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
}

.courier-booked-top > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.courier-booked-top > div:nth-child(2) > span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
}

.courier-booked-top h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.courier-booked-top p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.courier-status-pill {
  min-height: 27px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  color: #594ED6;
  background: var(--brand-soft);
  border: 1px solid #DDD9FF;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.courier-status-pill.delivered {
  color: #15803D;
  background: var(--green-soft);
  border-color: #CDEFD8;
}

.courier-status-pill.cancelled {
  color: #B42318;
  background: var(--red-soft);
  border-color: #FFD5D2;
}

.courier-status-pill.pending {
  color: #B45309;
  background: var(--amber-soft);
  border-color: #F4D79E;
}

.courier-status-pill.hold {
  color: #475467;
  background: #F2F4F7;
  border-color: #E0E4E9;
}

.courier-status-pill.review {
  color: #594ED6;
  background: var(--brand-soft);
  border-color: #DDD9FF;
}

.courier-details-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}

.courier-details-grid > div {
  min-height: 68px;
  padding: 10px;
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.courier-details-grid span {
  color: var(--muted);
  font-size: 9px;
}

.courier-details-grid strong {
  color: var(--text-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.courier-copy-button {
  top: 8px;
  right: 8px;
}

.courier-booked-actions {
  padding: 0 12px 12px;
}

.courier-booked-actions .btn {
  width: 100%;
}

.courier-section .alert {
  margin: 10px 0 0;
}

@media (max-width: 540px) {
  .courier-booking-grid,
  .courier-booking-summary,
  .courier-details-grid {
    grid-template-columns: 1fr;
  }

  .courier-field.wide {
    grid-column: auto;
  }

  .courier-booked-top {
    grid-template-columns: 36px minmax(0,1fr);
  }

  .courier-status-pill {
    grid-column: 1 / -1;
    width: fit-content;
  }
}


/* =========================================================
   V28 — Courier Readiness & Recipient Safety
   ========================================================= */

.courier-readiness-card,
.courier-recipient-editor {
  margin-bottom: 12px;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.courier-readiness-heading,
.courier-editor-heading {
  min-height: 56px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.courier-readiness-heading > div,
.courier-editor-heading > div {
  display: grid;
  gap: 2px;
}

.courier-readiness-heading > div > span,
.courier-editor-heading > div > span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .09em;
}

.courier-readiness-heading > div > strong,
.courier-editor-heading > div > strong {
  color: var(--text-2);
  font-size: 11px;
}

.courier-editor-heading > small {
  max-width: 210px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
  text-align: right;
}

.courier-readiness-score {
  min-width: 46px;
  height: 28px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  color: #B45309;
  background: var(--amber-soft);
  border: 1px solid #F4D79E;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
}

.courier-readiness-score.ready {
  color: #15803D;
  background: var(--green-soft);
  border-color: #CDEFD8;
}

.courier-readiness-list {
  padding: 6px 12px;
  display: grid;
}

.courier-check {
  min-height: 46px;
  display: grid;
  grid-template-columns: 26px minmax(0,1fr);
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid #EEF1F4;
}

.courier-check:last-child {
  border-bottom: 0;
}

.courier-check-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #98A2B3;
  background: #F2F4F7;
  border: 1px solid #E2E6EC;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 850;
}

.courier-check > div {
  display: grid;
  gap: 1px;
}

.courier-check strong {
  color: var(--text-2);
  font-size: 10px;
}

.courier-check small {
  color: var(--muted);
  font-size: 8px;
}

.courier-check.passed .courier-check-icon {
  color: #15803D;
  background: var(--green-soft);
  border-color: #CDEFD8;
}

.courier-check.passed strong {
  color: #166534;
}

.courier-recipient-editor .courier-booking-grid {
  padding: 12px;
}

.courier-field > input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  font: inherit;
  font-size: 11px;
}

.courier-field > input:focus {
  border-color: #A5A0FF;
  box-shadow: 0 0 0 3px rgba(99,91,255,.06);
}

.courier-field-hint {
  margin-top: -1px;
  color: #B45309;
  font-size: 8px;
  line-height: 1.4;
}

.courier-field-hint.valid {
  color: #15803D;
}

@media (max-width: 540px) {
  .courier-readiness-heading,
  .courier-editor-heading {
    align-items: flex-start;
  }

  .courier-editor-heading {
    flex-direction: column;
  }

  .courier-editor-heading > small {
    max-width: none;
    text-align: left;
  }
}

/* =========================================================
   V29 — Safe Courier Operations & Workflow Intelligence
   ========================================================= */

.ops-stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card-button {
  width: 100%;
  appearance: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.stat-card-button:hover {
  transform: translateY(-1px);
  border-color: #D6D3FF;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .07);
}

.stat-card-button.active {
  border-color: #C9C4FF;
  box-shadow: 0 0 0 3px rgba(99, 91, 255, .055), var(--shadow-card);
}

.stat-icon.teal {
  color: #0E7490;
  background: #ECFEFF;
}

.stat-icon.amber {
  color: #B45309;
  background: var(--amber-soft);
}

/* Seven-stage operational progress. "Ready" and "Courier" are derived
   from existing order/courier data; no database status migration required. */
.drawer-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 2px 1px 6px;
  scrollbar-width: thin;
}

.drawer-timeline .timeline-step {
  flex: 0 0 66px;
}

.drawer-timeline .timeline-connector {
  flex: 1 1 18px;
  min-width: 12px;
}

/* Courier safety mode */
.courier-safety-bar {
  margin-bottom: 12px;
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #FFFDF8;
  border: 1px solid #F3DFB4;
  border-radius: 11px;
}

.courier-safety-bar.test {
  background: #F3FBFF;
  border-color: #BDE7F5;
}

.courier-safety-bar.locked {
  background: #F8FAFC;
  border-color: var(--border);
}

.courier-safety-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.courier-safety-copy > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.courier-safety-copy strong {
  color: var(--text-2);
  font-size: 10px;
  font-weight: 760;
}

.courier-safety-copy small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.courier-mode-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(180, 83, 9, .08);
  background: #D97706;
}

.courier-mode-dot.test {
  background: #0891B2;
  box-shadow: 0 0 0 4px rgba(8, 145, 178, .09);
}

.courier-mode-dot.locked {
  background: #667085;
  box-shadow: 0 0 0 4px rgba(102, 112, 133, .08);
}

.courier-test-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.courier-test-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.courier-test-track {
  width: 36px;
  height: 21px;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  background: #D0D5DD;
  border-radius: 999px;
  transition: background .16s ease;
}

.courier-test-track i {
  width: 17px;
  height: 17px;
  display: block;
  background: #FFFFFF;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .18);
  transition: transform .16s ease;
}

.courier-test-switch input:checked + .courier-test-track {
  background: #0891B2;
}

.courier-test-switch input:checked + .courier-test-track i {
  transform: translateX(15px);
}

.courier-test-switch input:disabled + .courier-test-track {
  opacity: .55;
}

.courier-test-label {
  color: var(--text-2);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

/* Locked live booking result */
.courier-booking-lock {
  margin: 0 12px 12px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #475467;
  background: #F8FAFC;
  border: 1px solid #E4E7EC;
  border-radius: 9px;
}

.courier-booking-lock > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: #FFFFFF;
  border: 1px solid #E4E7EC;
  border-radius: 7px;
  font-size: 10px;
}

.courier-booking-lock > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.courier-booking-lock strong {
  color: var(--text-2);
  font-size: 9px;
}

.courier-booking-lock small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

/* Recorded activity timeline */
.order-activity-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.order-activity-item {
  min-height: 68px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border-bottom: 1px solid #EEF1F4;
}

.order-activity-item:last-child {
  border-bottom: 0;
}

.order-activity-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border: 2px solid #FFFFFF;
  border-radius: 999px;
  background: #98A2B3;
  box-shadow: 0 0 0 1px #D0D5DD;
}

.order-activity-item.success .order-activity-dot {
  background: #16A34A;
  box-shadow: 0 0 0 1px #86D7A4;
}

.order-activity-item.sync .order-activity-dot {
  background: #6366F1;
  box-shadow: 0 0 0 1px #B7B9FF;
}

.order-activity-item.warning .order-activity-dot {
  background: #D97706;
  box-shadow: 0 0 0 1px #F4C47A;
}

.order-activity-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.order-activity-item strong {
  color: var(--text-2);
  font-size: 10px;
}

.order-activity-item p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.order-activity-item time {
  color: var(--muted-2);
  font-size: 8px;
}

.order-activity-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 9px;
}

/* Premium real-booking confirmation */
.courier-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  padding: 22px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.courier-confirm-card {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  background: #FFFFFF;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}

.courier-confirm-head {
  padding: 18px 18px 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.courier-confirm-head > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.courier-confirm-mode {
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .07em;
}

.courier-confirm-mode.live {
  color: #92400E;
  background: #FFF7E8;
  border: 1px solid #F3D49A;
}

.courier-confirm-mode.test {
  color: #0E7490;
  background: #ECFEFF;
  border: 1px solid #BCECF4;
}

.courier-confirm-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 780;
  letter-spacing: -.03em;
}

.courier-confirm-head p {
  margin: 0;
  max-width: 480px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.courier-confirm-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  color: #667085;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.courier-confirm-grid {
  padding: 15px 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.courier-confirm-grid > div {
  min-height: 66px;
  padding: 10px 11px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.courier-confirm-grid > div.wide {
  grid-column: 1 / -1;
}

.courier-confirm-grid span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.courier-confirm-grid strong {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.courier-confirm-warning {
  margin: 0 18px;
  padding: 11px 12px;
  display: grid;
  gap: 2px;
  border-radius: 10px;
}

.courier-confirm-warning.live {
  color: #92400E;
  background: #FFF8EB;
  border: 1px solid #F2D39B;
}

.courier-confirm-warning.test {
  color: #0E7490;
  background: #F0FCFF;
  border: 1px solid #BDE7F5;
}

.courier-confirm-warning strong {
  font-size: 10px;
}

.courier-confirm-warning span {
  font-size: 9px;
  line-height: 1.4;
}

.courier-confirm-actions {
  padding: 15px 18px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.courier-confirm-actions .btn {
  min-height: 44px;
}

.courier-confirm-submit {
  min-width: 220px;
}

@media (max-width: 1500px) {
  .ops-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .ops-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .drawer-timeline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  .drawer-timeline .timeline-step {
    flex: none;
  }

  .drawer-timeline .timeline-connector {
    min-width: 0;
    flex: none;
  }

  .courier-safety-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .courier-test-switch {
    width: 100%;
    justify-content: space-between;
    padding-top: 3px;
  }

  .courier-confirm-overlay {
    padding: 10px;
    place-items: end center;
  }

  .courier-confirm-card {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 18px 18px 12px 12px;
  }

  .courier-confirm-grid {
    grid-template-columns: 1fr;
  }

  .courier-confirm-grid > div.wide {
    grid-column: auto;
  }

  .courier-confirm-actions {
    flex-direction: column-reverse;
  }

  .courier-confirm-actions .btn,
  .courier-confirm-submit {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .ops-stats-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   V30 — Active Courier Watch & Delivery Exception Management
   ========================================================= */

.ops-stats-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.stat-icon.danger {
  color: #B42318;
  background: #FFF1F0;
}

.courier-watch-strip {
  margin-top: 14px;
  min-height: 72px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-card);
  transition: border-color .16s ease, background .16s ease;
}

.courier-watch-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.courier-watch-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22,163,74,.07);
}

.courier-watch-main > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.courier-watch-main > div > span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .09em;
}

.courier-watch-main strong {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 780;
}

.courier-watch-main small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.courier-watch-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.courier-watch-counter {
  min-width: 64px;
  min-height: 44px;
  padding: 6px 10px;
  display: grid;
  align-content: center;
  gap: 1px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.courier-watch-counter span {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .07em;
}

.courier-watch-counter strong {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1;
}

.courier-watch-counter.attention strong {
  color: #B42318;
}

.courier-watch-sync {
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text-2);
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 780;
}

.courier-watch-sync:hover {
  background: #F8FAFC;
}

.courier-watch-strip.syncing .courier-watch-dot {
  background: var(--blue);
  animation: autoSyncPulse 1s ease-in-out infinite;
}

.courier-watch-strip.attention {
  background: #FFFCFA;
  border-color: #F0D5C8;
}

.courier-watch-strip.attention .courier-watch-dot,
.courier-watch-strip.error .courier-watch-dot {
  background: #DC2626;
  box-shadow: 0 0 0 5px rgba(220,38,38,.06);
}

.courier-watch-strip.error {
  background: #FFF8F7;
  border-color: #F4D5D1;
}

.courier-watch-strip.paused .courier-watch-dot {
  background: var(--muted-2);
  box-shadow: none;
}

.courier-exception-card {
  margin: 12px 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: #FFF8F7;
  border: 1px solid #F2D5D1;
  border-radius: 11px;
}

.courier-exception-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #B42318;
  background: #FEE4E2;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 900;
}

.courier-exception-card > div:last-child {
  display: grid;
  gap: 3px;
}

.courier-exception-card span {
  color: #B42318;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
}

.courier-exception-card strong {
  color: #7A271A;
  font-size: 11px;
}

.courier-exception-card p {
  margin: 0;
  color: #9C4437;
  font-size: 9px;
  line-height: 1.5;
}

.courier-attention-row {
  background: #FFFCFB;
}

.courier-attention-row td:first-child {
  position: relative;
}

.courier-attention-row td:first-child::before {
  content: "";
  width: 3px;
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  border-radius: 999px;
  background: #DC2626;
}

.attention-label.courier-issue-label {
  color: #B42318 !important;
  background: #FFF1F0;
  border-color: #F3C8C4;
}

.courier-attention-card {
  border-color: #F1D2CE;
  background: #FFFCFB;
}

.mobile-status-stack {
  display: grid;
  justify-items: end;
  gap: 5px;
}

@media (max-width: 1700px) {
  .ops-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1240px) {
  .courier-watch-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .courier-watch-side {
    width: 100%;
  }

  .courier-watch-sync {
    margin-left: auto;
  }
}

@media (max-width: 980px) {
  .ops-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .courier-watch-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .courier-watch-sync {
    width: 100%;
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .ops-stats-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   V31 — Print & Fulfilment Workflow
   ========================================================= */

.ops-stats-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.stat-icon.settlement {
  color: #7C3AED;
  background: #F5F3FF;
}

.status-dot.ready,
.queue-dot.ready {
  background: var(--blue);
}

.status-dot.courier,
.queue-dot.courier {
  background: var(--cyan);
}

.queue-dot.print {
  background: var(--brand);
}

.nav-derived .nav-icon {
  color: var(--muted-2);
}

.bulk-action-bar {
  min-height: 62px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #F8F7FF;
  border-bottom: 1px solid #DED9FF;
}

.bulk-action-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bulk-selection-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: #FFFFFF;
  border: 1px solid #D8D2FF;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 850;
}

.bulk-action-summary > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.bulk-action-summary strong {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
}

.bulk-action-summary small {
  color: var(--muted);
  font-size: 9px;
}

.bulk-action-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
}

.bulk-btn {
  min-height: 36px;
  padding: 0 11px;
  color: var(--text-2);
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 760;
}

.bulk-btn:hover:not(:disabled) {
  border-color: #C5C0FF;
  background: #FBFAFF;
}

.bulk-btn.primary {
  color: #FFFFFF;
  background: var(--brand);
  border-color: var(--brand);
}

.bulk-btn.ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.bulk-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.select-column {
  width: 42px;
  min-width: 42px;
  padding-right: 4px !important;
  text-align: center;
}

.table-select-control,
.mobile-select-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.table-select-control input,
.mobile-select-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.table-select-control > span,
.mobile-select-control > span {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  transition: .12s ease;
}

.table-select-control input:checked + span,
.mobile-select-control input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
}

.table-select-control input:checked + span::after,
.mobile-select-control input:checked + span::after {
  content: "✓";
  color: #FFFFFF;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
}

.table-select-control input:indeterminate + span {
  background: var(--brand);
  border-color: var(--brand);
}

.table-select-control input:indeterminate + span::after {
  content: "−";
  color: #FFFFFF;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
}

.bulk-selected-row {
  box-shadow: inset 3px 0 0 var(--brand);
  background: #FBFAFF !important;
}

.mobile-select-control {
  width: max-content;
  padding: 5px 7px;
  background: #F8F7FF;
  border: 1px solid #E5E1FF;
  border-radius: 7px;
}

.bulk-selected-card {
  border-color: #CFC9FF !important;
  box-shadow: 0 0 0 2px rgba(99,91,255,.06);
}

.btn-next-step {
  min-width: 142px;
  color: #FFFFFF;
  background: #111827;
  border: 1px solid #111827;
}

.btn-next-step:hover:not(:disabled) {
  background: #0B1220;
}

.btn-next-step.courier-next {
  background: var(--brand);
  border-color: var(--brand);
}

.btn-next-step:disabled {
  cursor: not-allowed;
  opacity: .48;
}

@media (max-width: 1500px) {
  .ops-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .bulk-action-buttons {
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .bulk-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 700px) {
  .ops-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .desktop-table .select-column {
    display: none;
  }

  .drawer-status-row {
    grid-template-columns: 1fr;
  }

  .btn-next-step,
  .drawer-pdf-button,
  .drawer-update-button {
    width: 100%;
  }
}


/* =========================================================
   V32 — Production & Packing Control
   ========================================================= */

.stat-icon.packing {
  color: #7C3AED;
  background: #F3E8FF;
}

.queue-dot.packing,
.status-dot.packing {
  background: #8B5CF6;
}

.production-control-section {
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFBFF 100%);
}

.production-control-heading {
  align-items: center;
}

.production-stage-badge {
  min-width: 74px;
  height: 26px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #E4E7EC;
  background: #F8FAFC;
  color: #667085;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
}

.production-stage-badge.printing { color:#1D4ED8; background:#EFF6FF; border-color:#BFDBFE; }
.production-stage-badge.printed { color:#6D28D9; background:#F5F3FF; border-color:#DDD6FE; }
.production-stage-badge.packed,
.production-stage-badge.ready { color:#047857; background:#ECFDF3; border-color:#ABEFC6; }
.production-stage-badge.courier_booked,
.production-stage-badge.shipped { color:#0E7490; background:#ECFEFF; border-color:#A5F3FC; }
.production-stage-badge.delivered { color:#067647; background:#ECFDF3; border-color:#ABEFC6; }
.production-stage-badge.cancelled { color:#B42318; background:#FEF3F2; border-color:#FECDCA; }

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

.production-state-card {
  min-height: 100px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label action" "value action";
  align-items: center;
  column-gap: 12px;
  border: 1px solid #E4E7EC;
  border-radius: 12px;
  background: #FFFFFF;
}

.production-state-card > span {
  grid-area: label;
  color: #98A2B3;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.production-state-card > strong {
  grid-area: value;
  margin-top: 4px;
  color: #344054;
  font-size: 11px;
  line-height: 1.35;
}

.production-action-button {
  grid-area: action;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #D0D5DD;
  border-radius: 9px;
  background: #FFFFFF;
  color: #344054;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.production-action-button.primary {
  color: #FFFFFF;
  border-color: #635BFF;
  background: #635BFF;
}

.production-action-button:disabled {
  opacity: .46;
  cursor: not-allowed;
}

.production-qc-card {
  overflow: hidden;
  border: 1px solid #E4E7EC;
  border-radius: 12px;
  background: #FFFFFF;
}

.production-qc-heading {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #EAECF0;
  background: #FCFCFD;
}

.production-qc-heading > div {
  display: grid;
  gap: 3px;
}

.production-qc-heading span:first-child {
  color: #98A2B3;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
}

.production-qc-heading strong {
  color: #344054;
  font-size: 11px;
  font-weight: 750;
}

.production-qc-score {
  min-width: 48px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #F2F4F7;
  color: #667085;
  font-size: 9px;
  font-weight: 850;
}

.production-qc-score.ready {
  color: #067647;
  background: #ECFDF3;
}

.production-qc-item {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #F2F4F7;
  cursor: pointer;
}

.production-qc-item:last-child { border-bottom: 0; }
.production-qc-item input { position:absolute; opacity:0; pointer-events:none; }

.production-qc-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid #D0D5DD;
  background: #FFFFFF;
}

.production-qc-item input:checked + .production-qc-check {
  border-color: #ABEFC6;
  background: #ECFDF3;
}

.production-qc-item input:checked + .production-qc-check::after {
  content: "✓";
  color: #067647;
  font-size: 11px;
  font-weight: 900;
}

.production-qc-item input:disabled ~ div,
.production-qc-item input:disabled + .production-qc-check {
  opacity: .5;
}

.production-qc-item div { display:grid; gap:2px; }
.production-qc-item strong { color:#344054; font-size:10px; }
.production-qc-item small { color:#98A2B3; font-size:9px; line-height:1.35; }

.production-local-note {
  margin-top: 10px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  border: 1px solid #D1FADF;
  border-radius: 10px;
  background: #F6FEF9;
}

.production-local-note > span { color:#067647; font-weight:900; }
.production-local-note div { display:grid; gap:2px; }
.production-local-note strong { color:#067647; font-size:10px; }
.production-local-note small { color:#667085; font-size:9px; line-height:1.4; }

.production-row-badge {
  width: fit-content;
  margin-top: 5px;
  padding: 2px 6px;
  display: inline-flex;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .07em;
  border: 1px solid transparent;
}

.production-row-badge.printing { color:#1D4ED8; background:#EFF6FF; border-color:#DBEAFE; }
.production-row-badge.printed { color:#6D28D9; background:#F5F3FF; border-color:#EDE9FE; }
.production-row-badge.packed { color:#047857; background:#ECFDF3; border-color:#D1FADF; }
.production-row-badge.ready { color:#067647; background:#ECFDF3; border-color:#ABEFC6; }
.production-row-badge.courier { color:#0E7490; background:#ECFEFF; border-color:#CFFAFE; }

.customer-message-card {
  background: linear-gradient(180deg,#FFFFFF,#FAFAFF);
}

.order-activity-item.production .order-activity-dot {
  background: #8B5CF6;
}

@media (max-width: 640px) {
  .production-state-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   V33 — Cloud Production Sync, Audit & Final Operations Polish
   ========================================================= */

/* Keep the KPI area balanced instead of leaving one orphan card. */
.ops-stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.production-heading-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cloud-sync-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #067647;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .03em;
  white-space: nowrap;
}

.cloud-sync-label i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #12B76A;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, .10);
}

.export-button {
  min-width: 104px;
}

.order-activity-item.status_changed .order-activity-dot { background: #6172F3; }
.order-activity-item.production_printed .order-activity-dot,
.order-activity-item.production_qc_passed .order-activity-dot,
.order-activity-item.production_packed .order-activity-dot,
.order-activity-item.production_migrated .order-activity-dot { background: #8B5CF6; }
.order-activity-item.courier_booked .order-activity-dot,
.order-activity-item.courier_status_changed .order-activity-dot { background: #06B6D4; }
.order-activity-item.courier_attention .order-activity-dot { background: #F04438; }
.order-activity-item.pdf_downloaded .order-activity-dot { background: #667085; }

.order-activity-actor {
  display: inline-block;
  margin-top: 3px;
  color: #98A2B3;
  font-size: 8px;
}

@media (max-width: 1550px) {
  .ops-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .ops-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .ops-stats-grid { grid-template-columns: 1fr; }
  .production-heading-side { justify-content: flex-start; }
  .export-button { min-width: 0; }
}

.production-local-note {
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
}

.production-reset-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #E4E7EC;
  border-radius: 8px;
  background: #FFFFFF;
  color: #667085;
  font: inherit;
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.production-reset-button:hover:not(:disabled) {
  border-color: #FDA29B;
  color: #B42318;
  background: #FFFBFA;
}

.production-reset-button[data-armed="1"] {
  border-color: #FDA29B;
  color: #B42318;
  background: #FEF3F2;
}

.production-reset-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.order-activity-item.production_reset .order-activity-dot { background: #F79009; }

@media (max-width: 640px) {
  .production-local-note { grid-template-columns: 22px minmax(0, 1fr); }
  .production-reset-button { grid-column: 2; width: fit-content; }
}

/* =========================================================
   V34 — Centered Order Workspace (UI/UX only)
   Keeps all V33.1 IDs, events and backend flows unchanged.
   ========================================================= */

@media (min-width: 901px) {
  .drawer-backdrop {
    justify-content: center;
    align-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, .28);
    backdrop-filter: blur(7px) saturate(112%);
  }

  .order-drawer {
    width: min(1180px, calc(100vw - 64px));
    height: min(920px, calc(100vh - 44px));
    max-height: calc(100vh - 44px);
    overflow: hidden;
    border: 1px solid rgba(208, 213, 221, .92);
    border-radius: 20px;
    box-shadow:
      0 32px 90px rgba(16, 24, 40, .22),
      0 8px 24px rgba(16, 24, 40, .08);
    transform: translateY(18px) scale(.985);
    transform-origin: 50% 50%;
  }

  .drawer-backdrop.open .order-drawer {
    transform: translateY(0) scale(1);
  }

  .drawer-header {
    min-height: 104px;
    padding: 20px 24px 17px;
    position: relative;
    z-index: 4;
    align-items: center;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(18px);
  }

  .drawer-heading h2 {
    margin: 9px 0 4px;
    font-size: 27px;
  }

  .drawer-heading p {
    max-width: 660px;
  }

  .drawer-close {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 11px;
    box-shadow: 0 1px 2px rgba(16,24,40,.03);
  }

  .drawer-scroll {
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    grid-template-areas:
      "preview preview"
      "progress progress"
      "vehicle customer"
      "payment file"
      "production production"
      "courier courier"
      "activity activity"
      "alert alert";
    gap: 14px;
    align-content: start;
    scroll-padding: 18px;
    background:
      radial-gradient(circle at 8% 0%, rgba(99,91,255,.035), transparent 28%),
      #F8FAFC;
  }

  .drawer-scroll > .drawer-preview-section { grid-area: preview; }
  .drawer-scroll > .fulfilment-section { grid-area: progress; }
  .drawer-scroll > .order-vehicle-section { grid-area: vehicle; }
  .drawer-scroll > .order-customer-section { grid-area: customer; }
  .drawer-scroll > .order-payment-section { grid-area: payment; }
  .drawer-scroll > .print-file-section { grid-area: file; }
  .drawer-scroll > .production-control-section { grid-area: production; }
  .drawer-scroll > .courier-section { grid-area: courier; }
  .drawer-scroll > .activity-section { grid-area: activity; }
  .drawer-scroll > #modalAlert { grid-area: alert; }

  .drawer-scroll > .drawer-section,
  .drawer-scroll > .drawer-preview-section {
    margin-top: 0;
  }

  .drawer-preview-section {
    min-height: 112px;
    padding: 14px 16px;
    grid-template-columns: 78px minmax(0,1fr) 104px;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(16,24,40,.02), 0 8px 22px rgba(16,24,40,.035);
  }

  .drawer-sticker-preview {
    width: 78px;
    height: 78px;
    border-radius: 16px;
  }

  .drawer-sticker-preview img {
    width: 46px;
    height: 46px;
  }

  .drawer-section {
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(16,24,40,.018);
  }

  .drawer-section-heading {
    margin-bottom: 11px;
  }

  .drawer-detail-card {
    min-height: 82px;
  }

  .order-customer-section .drawer-detail-card {
    min-height: 76px;
  }

  .order-payment-section,
  .print-file-section {
    min-height: 132px;
  }

  .order-payment-section .drawer-payment-card,
  .print-file-section .drawer-file-card {
    min-height: 70px;
    height: calc(100% - 38px);
  }

  .fulfilment-section {
    overflow: hidden;
  }

  .drawer-timeline {
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .drawer-actions {
    z-index: 5;
    padding: 12px 16px 14px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 -10px 30px rgba(16,24,40,.07);
    backdrop-filter: blur(18px) saturate(120%);
  }

  .drawer-status-row {
    grid-template-columns: minmax(190px, 1fr) auto auto auto;
    gap: 9px;
    align-items: end;
  }

  .drawer-status-select .select,
  .btn-next-step,
  .drawer-pdf-button,
  .drawer-update-button {
    min-height: 46px;
  }

  .btn-next-step,
  .drawer-pdf-button,
  .drawer-update-button {
    min-width: 136px;
  }

  .drawer-update-button {
    min-width: 148px;
  }

  .drawer-confirm {
    margin-bottom: 10px;
  }
}

@media (min-width: 901px) and (max-width: 1120px) {
  .order-drawer {
    width: calc(100vw - 38px);
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
  }

  .drawer-scroll {
    grid-template-columns: 1fr;
    grid-template-areas:
      "preview"
      "progress"
      "vehicle"
      "customer"
      "payment"
      "file"
      "production"
      "courier"
      "activity"
      "alert";
  }

  .drawer-status-row {
    grid-template-columns: minmax(180px, 1fr) repeat(3, auto);
  }
}

@media (max-width: 900px) {
  .drawer-backdrop {
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
  }

  .order-drawer {
    width: min(680px, 100vw);
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .drawer-scroll {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .order-drawer,
  .drawer-backdrop {
    transition: none !important;
  }
}

/* =========================================================
   V34.1 — Centered Workspace stability hotfix
   UI-only: fixes test-mode reflow/blank-space issue.
   ========================================================= */
@media (min-width: 901px) {
  .order-drawer {
    display: flex;
    flex-direction: column;
    height: min(920px, calc(100vh - 44px));
    max-height: calc(100vh - 44px);
    min-height: 0;
  }

  .drawer-header,
  .drawer-actions {
    flex: 0 0 auto;
  }

  .drawer-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .drawer-actions {
    margin-top: 0;
  }
}

/* =========================================================
   V34.2 — Centered workspace definitive stability fix
   - shrink-to-content when the visible tail of an order is short
   - keep the content area internally scrollable when long
   - prevent Chromium scroll anchoring from moving the workspace
   ========================================================= */
@media (min-width: 901px) {
  .order-drawer {
    display: flex !important;
    flex-direction: column !important;
    width: min(1180px, calc(100vw - 64px));
    height: auto !important;
    max-height: calc(100dvh - 44px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .drawer-header,
  .drawer-actions {
    flex: 0 0 auto !important;
  }

  .drawer-scroll {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 44px - 104px - 76px) !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    overscroll-behavior: contain;
    overflow-anchor: none;
    scrollbar-gutter: stable;
  }

  .drawer-actions {
    position: relative !important;
    inset: auto !important;
    margin: 0 !important;
    align-self: stretch;
  }
}

@media (min-width: 901px) and (max-height: 720px) {
  .order-drawer {
    max-height: calc(100dvh - 24px) !important;
  }

  .drawer-scroll {
    max-height: calc(100dvh - 24px - 92px - 70px) !important;
  }

  .drawer-header {
    min-height: 92px;
    padding-top: 15px;
    padding-bottom: 14px;
  }
}


/* =========================================================
   V34.3 — Persistent close control
   UI-only. Keeps the order close action visible at every
   internal scroll position without touching any backend flow.
   ========================================================= */
.order-drawer {
  position: relative !important;
}

.drawer-close-floating {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  z-index: 80 !important;
  width: 42px !important;
  height: 42px !important;
  display: grid !important;
  place-items: center !important;
  flex: none !important;
  color: #475467 !important;
  background: rgba(255, 255, 255, .96) !important;
  border: 1px solid rgba(208, 213, 221, .96) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .12), 0 1px 3px rgba(16, 24, 40, .06) !important;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  font-size: 25px !important;
  line-height: 1 !important;
}

.drawer-close-floating:hover {
  color: #101828 !important;
  background: #FFFFFF !important;
  border-color: #98A2B3 !important;
  transform: translateY(-1px);
}

.drawer-close-floating:focus-visible {
  outline: 3px solid rgba(99, 91, 255, .24);
  outline-offset: 2px;
}

/* Keep header copy from sitting beneath the floating close button. */
.drawer-header {
  padding-right: 76px !important;
}

@media (max-width: 900px) {
  .drawer-close-floating {
    position: fixed !important;
    top: max(12px, env(safe-area-inset-top)) !important;
    right: 12px !important;
    z-index: 120 !important;
  }

  .drawer-header {
    padding-right: 72px !important;
  }
}

/* =========================================================
   V34.4 — Fulfilment visibility + content polish
   UI-only. Restores a deliberate, compact progress tracker in
   the centered workspace and lets customer update copy wrap.
   ========================================================= */
@media (min-width: 901px) {
  .fulfilment-section {
    display: block !important;
    min-height: 138px !important;
    height: auto !important;
    padding: 14px 16px 15px !important;
    overflow: hidden !important;
  }

  .fulfilment-section .drawer-section-heading {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 16px !important;
    min-height: 36px !important;
    margin: 0 0 12px !important;
  }

  .fulfilment-section .drawer-section-heading > div {
    display: grid !important;
    gap: 3px !important;
  }

  .fulfilment-section .drawer-section-heading > div > span,
  .fulfilment-section .drawer-section-heading > div > h3,
  .fulfilment-section .drawer-section-heading > small {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .fulfilment-section .drawer-section-heading > div > h3 {
    margin: 0 !important;
  }

  .fulfilment-section .drawer-section-heading > small {
    padding-top: 3px !important;
    white-space: nowrap;
  }

  .fulfilment-section .drawer-timeline {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 66px !important;
    height: auto !important;
    align-items: flex-start !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 2px 2px 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .fulfilment-section .timeline-step {
    display: grid !important;
    flex: 0 0 72px !important;
    min-width: 72px !important;
    justify-items: center !important;
    gap: 6px !important;
    text-align: center !important;
  }

  .fulfilment-section .timeline-connector {
    display: block !important;
    flex: 1 1 18px !important;
    min-width: 12px !important;
    height: 2px !important;
    margin-top: 14px !important;
  }

  .fulfilment-section .timeline-marker {
    width: 30px !important;
    height: 30px !important;
  }

  .fulfilment-section .timeline-step strong,
  .fulfilment-section .timeline-step span {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .customer-message-card {
    align-content: start !important;
    min-height: 88px !important;
  }

  .customer-message-card #customerStatusMessagePreview {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.45 !important;
    padding-right: 76px !important;
  }
}

@media (min-width: 901px) and (max-width: 1120px) {
  .fulfilment-section .timeline-step {
    flex-basis: 66px !important;
    min-width: 66px !important;
  }
}
