/* ----------------------------------------------------
   Apple Design System & Variables
   ---------------------------------------------------- */
:root {
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.7);
  --panel-solid: #ffffff;
  --text: #1d1d1f;
  --text-muted: #86868b;
  --border: rgba(0, 0, 0, 0.06);
  --purple: #7f3ff2;
  --purple-hover: #672ad3;
  --purple-light: rgba(127, 63, 242, 0.08);
  --green: #30d158;
  --green-light: rgba(48, 209, 88, 0.12);
  --orange: #ff9f0a;
  --orange-light: rgba(255, 159, 10, 0.12);
  --red: #ff453a;
  --red-light: rgba(255, 69, 58, 0.12);
  --blue: #0a84ff;
  --blue-light: rgba(10, 132, 255, 0.12);
  --grey-pill: #8e8e93;
  --grey-pill-light: rgba(142, 142, 147, 0.12);
  
  --success-bg: var(--green-light);
  --success-text: #248a3e;
  --hold-bg: var(--orange-light);
  --hold-text: #b25e00;
  --pending-bg: var(--blue-light);
  --pending-text: #0066cc;
  --failed-bg: var(--red-light);
  --failed-text: #b32424;
  --completed-bg: rgba(127, 63, 242, 0.12);
  --completed-text: var(--purple);
  
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.02);
  --shadow-panel: 0 20px 40px rgba(0, 0, 0, 0.04);
  --shadow-drawer: 0 -10px 45px rgba(0, 0, 0, 0.06);
  --glow-color: rgba(127, 63, 242, 0.08);
  
  color-scheme: light dark;
}

body.dark-theme {
  --bg: #0a0a0c;
  --panel: rgba(20, 20, 25, 0.7);
  --panel-solid: #16161c;
  --text: #f5f5f7;
  --text-muted: #86868b;
  --border: rgba(255, 255, 255, 0.07);
  --purple: #9b6cff;
  --purple-hover: #b28eff;
  --purple-light: rgba(155, 108, 255, 0.15);
  --green: #30d158;
  --green-light: rgba(48, 209, 88, 0.15);
  --orange: #ff9f0a;
  --orange-light: rgba(255, 159, 10, 0.15);
  --red: #ff453a;
  --red-light: rgba(255, 69, 58, 0.15);
  --blue: #0a84ff;
  --blue-light: rgba(10, 132, 255, 0.15);
  --grey-pill: #98989d;
  --grey-pill-light: rgba(152, 152, 157, 0.15);
  
  --success-bg: rgba(48, 209, 88, 0.15);
  --success-text: #30d158;
  --hold-bg: rgba(255, 159, 10, 0.15);
  --hold-text: #ff9f0a;
  --pending-bg: rgba(10, 132, 255, 0.15);
  --pending-text: #0a84ff;
  --failed-bg: rgba(255, 69, 58, 0.15);
  --failed-text: #ff453a;
  --completed-bg: rgba(155, 108, 255, 0.15);
  --completed-text: var(--purple);
  
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.2);
  --shadow-panel: 0 20px 40px rgba(0, 0, 0, 0.35);
  --shadow-drawer: 0 -10px 45px rgba(0, 0, 0, 0.4);
  --glow-color: rgba(155, 108, 255, 0.12);
}

/* ----------------------------------------------------
   Base Reset
   ---------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overflow: hidden;
  transition: background-color 300ms ease;
}

button,
input,
select {
  font-family: inherit;
  outline: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}

/* ----------------------------------------------------
   App Shell & Containers
   ---------------------------------------------------- */
.app-shell {
  width: 100%;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  background-color: var(--bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 1px var(--border), var(--shadow-panel);
  display: flex;
  flex-direction: column;
}

.dashboard {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 481px) {
  body {
    padding: 24px 0;
    background-color: #000;
  }
  
  .app-shell {
    height: calc(100dvh - 48px);
    border-radius: 38px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 100px rgba(0, 0, 0, 0.6);
  }
}

/* Glassmorphism Styles */
.glass-panel {
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}

/* ----------------------------------------------------
   Login Screen (Apple Mesh Gradient)
   ---------------------------------------------------- */
.login-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  overflow: hidden;
}

.login-background {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: #060608;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  mix-blend-mode: screen;
}

.glow-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #7f3ff2 0%, transparent 70%);
  top: -10%;
  right: -10%;
  animation: floatOrb1 15s infinite alternate ease-in-out;
}

.glow-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #0a84ff 0%, transparent 70%);
  bottom: -20%;
  left: -20%;
  animation: floatOrb2 18s infinite alternate ease-in-out;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-80px, 80px) scale(1.2); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(90px, -90px) scale(0.9); }
}

.login-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.brand-logo {
  display: inline-grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.brand-logo-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(52, 199, 89, 0.35));
}

.login-content h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 8px;
}

.login-content .subtitle {
  font-size: 15px;
  color: #8e8e93;
  margin-bottom: 32px;
}

.login-card {
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow-panel);
  text-align: left;
}

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

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  transition: all 200ms ease;
}

.input-wrapper input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(155, 108, 255, 0.15);
}

/* Light theme support override on login screen inputs */
body.light-theme .input-wrapper input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.apple-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-button.primary-btn {
  background: var(--purple);
  color: #fff;
}

.apple-button:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.form-error {
  min-height: 20px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  text-align: center;
}

/* ----------------------------------------------------
   App Header (Apple Glass Navigation)
   ---------------------------------------------------- */
.app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.glass-header {
  background: var(--panel);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

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

.avatar-badge {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  object-fit: cover;
}

.header-titles .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.header-titles h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
}

.circle-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: all 180ms ease;
}

.circle-btn:active {
  transform: scale(0.92);
}

.sun-icon { display: block; }
.moon-icon { display: none; }

body.dark-theme .sun-icon { display: none; }
body.dark-theme .moon-icon { display: block; }

/* ----------------------------------------------------
   Scroll Root & Views
   ---------------------------------------------------- */
.scroll-root {
  flex: 1;
  overflow: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(76px + env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-hero {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 4px;
}

.hero-label {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}

.hero-updated {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--green);
  animation: pulseLight 1.8s infinite ease-in-out;
}

@keyframes pulseLight {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

.refresh-pill-btn {
  position: absolute;
  right: 0;
  top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-light);
  color: var(--purple);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  transition: all 180ms ease;
}

.refresh-pill-btn:active {
  transform: scale(0.95);
  opacity: 0.8;
}

/* ----------------------------------------------------
   Pull To Refresh (Apple Spinner Style)
   ---------------------------------------------------- */
.pull-indicator {
  height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  transition: height 200ms ease;
}

.pull-indicator.visible {
  height: 64px;
}

.pull-ring-wrapper {
  display: grid;
  place-items: center;
}

.pull-ring {
  color: var(--purple);
}

.pull-indicator.spinning .pull-ring {
  animation: spinRing 800ms linear infinite;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ----------------------------------------------------
   Performance Cards (Summary View)
   ---------------------------------------------------- */
.stats-cards-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.stat-card {
  position: relative;
  background-color: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-panel);
}

/* Apple Rings/Primary Stat Design */
.stat-card.primary-ring-card {
  grid-column: span 1;
  display: grid;
  grid-template-columns: 1fr max-content;
  align-items: center;
  padding: 24px 20px;
  background: radial-gradient(circle at 80% 20%, var(--glow-color) 0%, var(--panel-solid) 60%);
  border: 1px solid var(--border);
}

.ring-content {
  display: flex;
  flex-direction: column;
}

.stat-card .stat-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card .stat-amount {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.stat-card.primary-ring-card .stat-amount {
  font-size: 36px;
}

.stat-card .stat-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}

.meta-orders {
  background-color: var(--purple-light);
  color: var(--purple);
}

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

.ring-visual {
  width: 90px;
  height: 90px;
  position: relative;
  display: grid;
  place-items: center;
}

.svg-ring-bg {
  color: var(--border);
}

.svg-ring-active {
  color: var(--purple);
  stroke-dasharray: 226; /* 2 * PI * r = 2 * 3.14 * 36 */
  stroke-dashoffset: 80;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-linecap: round;
  transition: stroke-dashoffset 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ring-label-source {
  font-size: 11px;
  background-color: var(--border);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

/* Skeleton Loading styles */
.stat-card.skeleton {
  min-height: 140px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
}

/* ----------------------------------------------------
   Search, Filter Box, & Segmented Control
   ---------------------------------------------------- */
.search-and-filter-card {
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar-wrapper input {
  width: 100%;
  padding: 11px 11px 11px 38px;
  background-color: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  transition: all 180ms ease;
}

.search-bar-wrapper input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(155, 108, 255, 0.15);
}

/* Apple Segmented Control Selector */
.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.04);
  padding: 3px;
  border-radius: 14px;
  gap: 2px;
}

body.dark-theme .segmented-control {
  background: rgba(255, 255, 255, 0.05);
}

.segment-tab {
  flex: 1;
  position: relative;
  cursor: pointer;
  text-align: center;
}

.segment-tab input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segment-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 4px;
  border-radius: 11px;
  transition: all 180ms ease;
  white-space: nowrap;
}

.segment-tab input:checked + .segment-label {
  background-color: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* ----------------------------------------------------
   Orders List Layout
   ---------------------------------------------------- */
.orders-list-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.date-group {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
  padding-left: 4px;
}

.order-group-card {
  background-color: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.order-row {
  width: 100%;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content 18px;
  gap: 12px;
  align-items: center;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: none;
  transition: background-color 150ms ease;
}

.order-row:last-child {
  border-bottom: none;
}

.order-row:active {
  background-color: var(--border);
}

.order-main-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.order-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.order-customer-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-ring-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.status-dot-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-ring-pill.status-processing { background-color: var(--success-bg); color: var(--success-text); }
.status-ring-pill.status-on-hold { background-color: var(--hold-bg); color: var(--hold-text); }
.status-ring-pill.status-pending { background-color: var(--pending-bg); color: var(--pending-text); }
.status-ring-pill.status-completed { background-color: var(--completed-bg); color: var(--completed-text); }
.status-ring-pill.status-cancelled,
.status-ring-pill.status-refunded { background-color: var(--grey-pill-light); color: var(--grey-pill); }
.status-ring-pill.status-failed { background-color: var(--failed-bg); color: var(--failed-text); }

.order-total-price {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.order-row .chevron {
  color: var(--text-muted);
  opacity: 0.6;
}

/* Pagination Row Styles */
.pagination-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 12px 20px;
  box-shadow: var(--shadow-soft);
}

.pagination-btn-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.pagination-btn-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-btn-arrow:not(:disabled):active {
  transform: scale(0.92);
}

.page-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

/* ----------------------------------------------------
   iOS Style Bottom Tab Bar
   ---------------------------------------------------- */
.apple-tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 6px 12px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--panel);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.02);
}

@media (min-width: 481px) {
  .apple-tab-bar {
    border-radius: 0 0 38px 38px;
  }
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  transition: color 150ms ease;
}

.tab-item.active {
  color: var(--purple);
}

.tab-item:active .tab-icon-wrapper {
  transform: scale(0.88);
}

.tab-icon-wrapper {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  transition: transform 150ms ease;
}

.tab-icon-wrapper svg {
  display: block;
}

.tab-item.disabled {
  opacity: 0.45;
}

/* Tab Bar badge count */
.badge-anchor {
  position: relative;
}

.badge-anchor[data-count]::after {
  content: attr(data-count);
  position: absolute;
  right: -10px;
  top: -8px;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  background-color: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 1.5px solid var(--panel-solid);
}

/* ----------------------------------------------------
   iOS Bottom Sheet Drawer (Detail Panel)
   ---------------------------------------------------- */
.bottom-sheet-drawer {
  position: absolute;
  inset: 0;
  z-index: 50;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 280ms ease;
}

.bottom-sheet-drawer.open {
  visibility: visible;
  pointer-events: auto;
}

.drawer-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 280ms ease;
}

.bottom-sheet-drawer.open .drawer-overlay {
  opacity: 1;
}

.drawer-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 85%;
  background-color: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet-drawer.open .drawer-content {
  transform: translateY(0);
}

.drawer-header-bar {
  display: grid;
  place-items: center;
  padding: 10px 0 4px;
  cursor: grab;
}

.drawer-grab-handle {
  width: 36px;
  height: 5px;
  border-radius: 99px;
  background-color: var(--border);
}

.drawer-header {
  padding: 6px 20px 14px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 60px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-close-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--border);
  color: var(--text-muted);
}

.drawer-close-btn:active {
  transform: scale(0.9);
}

.drawer-save-btn {
  font-size: 15px;
  font-weight: 700;
  color: var(--purple);
  text-align: right;
  padding: 8px 4px;
}

.drawer-save-btn:disabled {
  opacity: 0.4;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Drawer Detail Elements */
.detail-card {
  background-color: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.detail-hero-card {
  text-align: center;
  background: radial-gradient(circle at 50% 120%, var(--glow-color) 0%, var(--panel-solid) 80%);
}

.detail-hero-card h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 4px;
  margin-bottom: 8px;
}

.detail-hero-card .detail-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.detail-hero-card .detail-channel {
  display: inline-flex;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  background-color: var(--border);
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.drawer-body .section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* Status selection dropdown container */
.status-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-select-control {
  width: 100%;
  appearance: none;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--purple);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237f3ff2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}

body.dark-theme .status-select-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239b6cff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Product rows in details */
.product-item-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.product-item-row:last-child {
  border-bottom: none;
}

.product-img-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background-color: var(--bg);
  border: 1px solid var(--border);
}

.product-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.product-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-item-qty {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.product-item-total {
  font-size: 15px;
  font-weight: 700;
}

/* Shipping details card */
.shipping-info-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shipping-method-name {
  font-size: 15px;
  font-weight: 700;
}

.shipping-method-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Totals styling */
.totals-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.totals-row-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.totals-row-item.grand-total {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
  font-size: 18px;
  color: var(--text);
  font-weight: 800;
}

/* Customer card details */
.customer-grid-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customer-row-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.customer-row-item strong {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.customer-row-item span,
.address-paragraph {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

/* ----------------------------------------------------
   Center Dialog Confirmation Modal (Apple Style)
   ---------------------------------------------------- */
.apple-modal-container {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
}

.apple-modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 200ms ease-out;
}

.apple-modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 320px;
  background-color: var(--panel-solid);
  border-radius: 28px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: scaleUpModal 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-icon-header {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-color: var(--purple-light);
  color: var(--purple);
  margin-bottom: 16px;
}

.apple-modal-content h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.apple-modal-content p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 24px;
}

.apple-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-btn {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transition: all 150ms ease;
}

.modal-btn.action-btn {
  background-color: var(--purple);
  color: #fff;
}

.modal-btn.cancel-btn {
  background-color: var(--border);
  color: var(--text);
}

.modal-btn:active {
  transform: scale(0.97);
}

@keyframes scaleUpModal {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ----------------------------------------------------
   Apple Toast Alerts
   ---------------------------------------------------- */
.apple-toast {
  position: fixed;
  left: 50%;
  top: calc(24px + env(safe-area-inset-top));
  transform: translate(-50%, -150%);
  z-index: 120;
  background-color: rgba(20, 20, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 99px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  white-space: nowrap;
}

body.light-theme .apple-toast {
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.apple-toast.visible {
  transform: translate(-50%, 0);
}

/* ----------------------------------------------------
   Animations
   ---------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
