/* ==========================================================================
   Pawon Catering - Culinary Mobile-First Design System
   Inspired by Gourmet Catering & Delivery Apps (Pinterest Reference)
   Anti-Slop Craftsmanship: Warm Palettes, Tactile Cards, Zero Generic Slop
   ========================================================================== */

:root {
  /* Warm Culinary Palette - Light */
  --bg-app: #F8F5EE;          /* Warm linen / ivory */
  --bg-card: #FFFFFF;         /* Crisp surface */
  --bg-subtle: #F1ECE1;       /* Warm oatmeal */
  --bg-input: #FFFFFF;
  
  --text-main: #1C1917;       /* Warm stone charcoal (14:1 contrast) */
  --text-muted: #57534E;      /* Medium stone (5.5:1 contrast) */
  --text-subtle: #78716C;     /* Subtle stone (4.6:1 contrast) */

  --border-subtle: #E7E2D6;   /* Natural warm border */
  --border-focus: #C2410C;

  /* Brand Accents - Appetizing Terracotta & Culinary Herb */
  --primary: #C2410C;         /* Warm terracotta / paprika */
  --primary-hover: #9A3412;
  --primary-subtle: #FFEDD5;
  --primary-text: #9A3412;

  --success: #15803D;         /* Fresh garden green */
  --success-bg: #DCFCE7;
  --success-text: #14532D;

  --warning: #B45309;         /* Warm amber */
  --warning-bg: #FEF3C7;
  --warning-text: #78350F;

  --danger: #B91C1C;
  --danger-bg: #FEE2E2;
  --danger-text: #7F1D1D;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-card: 0 2px 8px -2px rgba(28, 25, 23, 0.05), 0 1px 3px 0 rgba(28, 25, 23, 0.04);
  --shadow-float: 0 12px 28px -6px rgba(28, 25, 23, 0.12), 0 4px 10px -2px rgba(28, 25, 23, 0.05);
}

/* Dark Culinary Palette */
body.theme-dark {
  --bg-app: #12100E;
  --bg-card: #1C1917;
  --bg-subtle: #292524;
  --bg-input: #24201D;

  --text-main: #FAF8F5;
  --text-muted: #D6D3D1;
  --text-subtle: #A8A29E;

  --border-subtle: #38332E;
  --border-focus: #EA580C;

  --primary: #EA580C;
  --primary-hover: #F97316;
  --primary-subtle: #431407;
  --primary-text: #FDBA74;

  --success: #22C55E;
  --success-bg: #14532D;
  --success-text: #BBF7D0;

  --warning: #F59E0B;
  --warning-bg: #78350F;
  --warning-text: #FDE68A;

  --danger: #EF4444;
  --danger-bg: #7F1D1D;
  --danger-text: #FECACA;

  --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.35);
  --shadow-float: 0 12px 28px -6px rgba(0, 0, 0, 0.5);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: 96px; /* Spasi untuk bottom action bar */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Accessibility Focus States (R-32) */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* ROLE ACCESS CONTROL STYLES */
body.role-karyawan .owner-only {
  display: none !important;
}

body.role-owner .karyawan-only {
  display: none !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 18px;
  min-height: 44px; /* R-03 min 44px */
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

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

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

.btn-outline {
  background-color: transparent;
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
}

.btn-outline-danger {
  background-color: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background-color: var(--danger-bg);
}

.btn-ghost {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
}

/* Header */
.app-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-role-subtitle {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

body.role-owner .brand-role-subtitle {
  color: var(--primary);
}

body.role-karyawan .brand-role-subtitle {
  color: var(--text-muted);
}

.header-center {
  display: none;
}

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

/* Mobile App Shell */
.mobile-app-shell {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Karyawan Banner Notice */
.role-notice-banner {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notice-icon {
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.notice-text strong {
  color: var(--text-main);
}

/* Culinary Hero Card */
.culinary-hero-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-subtitle {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  display: block;
}

.hero-box-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}

.hero-qty {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.hero-unit {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-muted);
}

.hero-quick-status {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-summary-tag {
  align-self: flex-end;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.status-sub {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}

/* Session Breakdown Chips */
.session-breakdown-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.session-chip {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.session-count {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

/* Financial Bar (Owner Only) */
.owner-financial-bar {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fin-item {
  display: flex;
  flex-direction: column;
}

.fin-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.fin-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Date Scroll Navigation */
.date-scroll-nav {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.date-scroll-nav::-webkit-scrollbar {
  display: none;
}

.date-scroll-track {
  display: flex;
  gap: 8px;
  padding: 2px 0;
}

.date-pill {
  flex: 0 0 auto;
  min-width: 86px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s ease;
}

.date-pill.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.pill-day {
  font-size: 0.82rem;
  font-weight: 700;
}

.pill-sub {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.85;
}

/* Search Controls */
.search-filter-section {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

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

.search-input-wrap input {
  width: 100%;
  min-height: 44px;
  padding: 8px 34px 8px 36px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.btn-clear-input {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
}

.custom-date-wrap input {
  min-height: 44px;
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Orders Feed */
.orders-feed-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.feed-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-subtle);
  background-color: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.orders-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Date Group Header */
.feed-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  margin-top: 6px;
}

.feed-date-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.feed-date-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background-color: var(--primary-subtle);
  color: var(--primary-text);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Order Ticket Card */
.order-ticket {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.time-session-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.delivery-badge {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.session-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}

.badge-Breakfast { background-color: #FFEDD5; color: #9A3412; }
.badge-Lunch { background-color: #DCFCE7; color: #166534; }
.badge-Dinner { background-color: #FEF3C7; color: #854D0E; }
.badge-Supper { background-color: #FCE7F3; color: #9D174D; }
.badge-Snack { background-color: #E0E7FF; color: #3730A3; }

/* Giant Box Counter */
.ticket-box-pill {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.box-qty-giant {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.box-label-unit {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
}

.ticket-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-program-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.ticket-activity {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
}

/* Operational Badges Row (Kitchen, Menu/Vendor, Courier) */
.operational-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.op-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* Dapur Pengelola Badge */
.badge-kitchen {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

.badge-kitchen.subcontract {
  background-color: #FEF3C7;
  color: #92400E;
  border-color: #FDE68A;
}

/* Menu / Vendor Snack 15rb Badge */
.badge-menu-item {
  background-color: #FFF7ED;
  color: #C2410C;
  border-color: #FFEDD5;
}

/* Kurir Pengantar Badge */
.badge-courier {
  background-color: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}

.badge-courier.unassigned {
  background-color: #F3F4F6;
  color: #6B7280;
  border-style: dashed;
}

/* Lokasi Pengantaran */
.ticket-location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  font-size: 0.8rem;
  gap: 8px;
}

.loc-text-group {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loc-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.btn-copy-loc {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.btn-copy-loc:hover {
  background-color: var(--bg-card);
  color: var(--primary);
}

.ticket-notes-banner {
  background-color: var(--warning-bg);
  color: var(--warning-text);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Owner Financial Row */
.ticket-financial-row {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 4px;
}

.ticket-financial-row strong {
  color: var(--text-main);
}

/* Owner Action Bar in Ticket */
.ticket-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.btn-quick-assign {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-quick-assign:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ticket-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-tool {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

.btn-tool:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

/* Quick Suggest Chips in Forms */
.quick-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chip-suggest {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  cursor: pointer;
}

.chip-suggest:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--bg-card);
}

/* Empty State */
.culinary-empty-state {
  background-color: var(--bg-card);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-graphic {
  color: var(--text-subtle);
  margin-bottom: 4px;
}

.empty-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* Sticky Bottom Action Bar */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 16px 12px;
  z-index: 50;
  box-shadow: var(--shadow-float);
}

.bar-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
}

.bar-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  min-width: 56px;
  padding: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
}

.bar-label {
  font-size: 0.72rem;
  font-weight: 600;
}

.action-scan .btn-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background-color: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -12px;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.35);
}

.action-scan .bar-label {
  color: var(--primary);
  font-weight: 700;
}

.btn-icon-bubble.green {
  background-color: var(--success);
  color: #FFFFFF;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -8px;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35);
}

/* Modals */
.culinary-sheet {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 600px;
}

.culinary-sheet::backdrop {
  background-color: rgba(28, 25, 23, 0.65);
  backdrop-filter: blur(4px);
}

.sheet-content {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-float);
}

.sheet-small {
  max-width: 460px;
}

.sheet-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sheet-pill-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: var(--radius-pill);
  background-color: var(--border-subtle);
}

.sheet-title-group {
  margin-top: 4px;
}

.sheet-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.sheet-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sheet-close {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Dropzone */
.culinary-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.culinary-dropzone:hover,
.culinary-dropzone.drag-over {
  border-color: var(--primary);
  background-color: var(--primary-subtle);
}

.dropzone-illu {
  color: var(--primary);
}

.dropzone-main {
  font-size: 0.9rem;
  color: var(--text-main);
}

.dropzone-sec {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-sample {
  margin-top: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

/* Scan Processing State */
.scan-processing-box {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.preview-thumb {
  width: 90px;
  height: 60px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background-color: #000;
}

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

.pdf-preview-box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #DC2626;
  color: #FFFFFF;
  padding: 4px;
}

.pdf-preview-box .pdf-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.pdf-preview-box .pdf-filename {
  font-size: 0.6rem;
  font-weight: 700;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processing-info {
  flex: 1;
}

.spinner-ring {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 4px;
}

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

.proc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.proc-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Results Table */
.results-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.meta-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.meta-value {
  font-size: 0.82rem;
  color: var(--text-main);
}

.badge-tag {
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--success-bg);
  color: var(--success-text);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.results-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.culinary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.culinary-table th {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.culinary-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.culinary-table input {
  width: 100%;
  padding: 4px 6px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
}

/* Error Banner */
.error-banner {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form Stack */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-item label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.req {
  color: var(--danger);
}

.field-item input,
.field-item select,
.field-item textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.field-hint {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.recap-text-container textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  line-height: 1.45;
  resize: none;
}

/* Role Choice Grid */
.role-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.role-card-btn {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.role-card-btn:hover {
  border-color: var(--primary);
  background-color: var(--bg-card);
}

.role-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--success-bg);
  color: var(--success-text);
}

.role-card-badge.orange {
  background-color: var(--primary-subtle);
  color: var(--primary-text);
}

.role-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.role-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Toast Feed */
.toast-feed {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background-color: var(--text-main);
  color: var(--bg-card);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-float);
  text-align: center;
  pointer-events: auto;
  animation: dropIn 0.2s ease-out;
}

@keyframes dropIn {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* PWA Install Banner */
.pwa-install-banner {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-card);
  animation: dropIn 0.25s ease-out;
}

.pwa-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.pwa-mini-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.pwa-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pwa-text-group strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-text-group span {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-dismiss-banner {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  line-height: 1;
}

.btn-dismiss-banner:hover {
  color: var(--text-main);
}

/* Media Query: Small Screen Mobile Optimization (Under 480px) */
@media (max-width: 480px) {
  .header-container {
    padding: 8px 12px;
    gap: 8px;
  }
  .brand-group {
    gap: 8px;
    min-width: 0;
  }
  .brand-avatar {
    width: 34px;
    height: 34px;
  }
  .brand-title {
    font-size: 1rem;
    white-space: nowrap;
  }
  .brand-caption {
    display: none;
  }
  .btn-text-responsive {
    display: none;
  }
  .header-controls {
    gap: 4px;
  }
  .header-controls .btn {
    padding: 6px 10px;
  }
  .hero-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .hero-box-total {
    align-self: flex-start;
  }
  .stat-grid-duo {
    gap: 8px;
  }
  .stat-card-tactile {
    padding: 10px 12px;
  }
  .mobile-app-shell {
    padding: 12px 10px 24px;
  }
  .order-card-culinary {
    padding: 12px;
  }
}

/* Duplicate Alert Box & Badges */
.duplicate-alert-banner {
  background-color: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  color: var(--warning-text);
  animation: dropIn 0.2s ease-out;
}

.dup-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 3px;
}

.dup-alert-text {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--warning-text);
}

.dup-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  background-color: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-left: 4px;
  white-space: nowrap;
}

tr.dup-row-flagged {
  background-color: rgba(245, 158, 11, 0.12) !important;
}

.dup-items-list {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dup-item-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.dup-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dup-item-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.82rem;
}

.dup-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dup-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

/* Media Query: Desktop Expansion */
@media (min-width: 640px) {
  .culinary-sheet {
    margin: auto;
    border-radius: var(--radius-lg);
  }
  .sheet-content {
    border-radius: var(--radius-lg);
    border-bottom: 1px solid var(--border-subtle);
  }
  .header-center {
    display: flex;
  }
  .shift-chip {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
  }
}
