/* ========================================
   PAPiKOPI — Main Stylesheet
   Mobile-first, modern, smooth, premium
======================================== */

/* --- Font Loading --- */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/poppins/v21/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/poppins/v21/pxiByp8kv8JHgFVrLEj6Z1xlFQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/poppins/v21/pxiByp8kv8JHgFVrLCz7Z1xlFQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-page-title); }
h2 { font-size: var(--text-section-title); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p { line-height: var(--line-height-relaxed); }

/* --- Responsive Base Typography --- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Small phone adjustments */
@media (max-width: 360px) {
  html { font-size: 15px; }
}

@media (max-width: 320px) {
  html { font-size: 14px; }
}

body {
  font-family: var(--font-body);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-body);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  min-height: 100vh;
  min-height: 100dvh;
  /* Page viewport lock: the document itself never scrolls.
     Each .screen is its own scroll container (see below), so scroll
     position can never leak between pages. */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- Layout --- */
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  min-height: 0;
  overflow: hidden;
}

/* Page viewport — holds exactly one visible .screen (see below) */
#mainContent {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Screen wrapper — each page is its OWN scroll container.
   Inactive pages are display:none (never in flow); the active page gets a
   definite height from #mainContent, so overflow-y actually engages and the
   document/body never scrolls (body { overflow: hidden }). This isolates
   scroll state per page — no page can bleed into another while scrolling. */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
  animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Container --- */
.container {
  padding: var(--container-padding);
  padding-top: calc(var(--header-height) + var(--safe-top));
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--space-6));
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  padding-top: var(--safe-top);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--container-padding);
  z-index: var(--z-sticky);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  gap: var(--space-3);
}

.header__title {
  font-size: var(--text-section-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header__icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  touch-action: manipulation;
}

.header__icon-btn:active {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.header__icon-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

/* Small phone header adjustments */
@media (max-width: 360px) {
  .header__title {
    font-size: var(--font-size-lg);
  }
  
  .header__icon-btn {
    width: 36px;
    height: 36px;
  }
  
  .header__icon-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* --- Cards --- */
.card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), transform var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.card:active {
  box-shadow: var(--shadow-md);
  transform: scale(0.995);
}

.card--elevated {
  box-shadow: var(--shadow-md);
}

.card--outlined {
  border-width: 2px;
}

/* --- Stat Cards --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  width: 100%;
  box-sizing: border-box;
}

/* Responsive: single column on very narrow screens */
@media (max-width: 340px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: transform var(--transition-fast), box-shadow var(--transition-normal);
  min-width: 0;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.stat-card__value {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xl);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.stat-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-md);
}

.stat-card--primary {
  border-color: var(--color-papikopi-blue);
  background: linear-gradient(135deg, var(--color-info-bg) 0%, var(--color-bg-secondary) 100%);
}

.stat-card--orange {
  border-color: var(--color-papikopi-orange);
  background: linear-gradient(135deg, var(--color-warning-bg) 0%, var(--color-bg-secondary) 100%);
}

.stat-card--green {
  border-color: var(--color-success);
  background: linear-gradient(135deg, var(--color-success-bg) 0%, var(--color-bg-secondary) 100%);
}

.stat-card--warm {
  border-color: var(--color-papi-warm-tan);
  background: linear-gradient(135deg, var(--color-warning-bg) 0%, var(--color-bg-secondary) 100%);
}

.stat-card__label {
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card__sub {
  font-size: var(--text-meta);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

/* Small phone stat card adjustments */
@media (max-width: 360px) {
  .stat-card {
    padding: var(--space-3);
  }
  
  .stat-card__value {
    font-size: var(--font-size-lg);
  }
  
  .stat-card__label {
    font-size: var(--text-tiny);
  }
}

/* --- Section --- */
.section {
  margin-bottom: var(--space-6);
  width: 100%;
  box-sizing: border-box;
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
  width: 100%;
  box-sizing: border-box;
}

.section__title {
  font-size: var(--text-section-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.section__link {
  font-size: var(--text-meta);
  font-weight: var(--font-weight-medium);
  color: var(--color-papikopi-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.section__link:active {
  color: var(--color-papi-dark-brown);
}

/* --- Responsive Grid Classes --- */
.monthly-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  width: 100%;
  box-sizing: border-box;
}

.monthly-stats-grid > div {
  min-width: 0;
  box-sizing: border-box;
}

.progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  width: 100%;
  box-sizing: border-box;
}

.progress-grid > div {
  min-width: 0;
  box-sizing: border-box;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  width: 100%;
  box-sizing: border-box;
}

.actions-grid > .btn {
  min-width: 0;
  box-sizing: border-box;
}

/* Responsive breakpoints */
@media (max-width: 420px) {
  .monthly-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  
  .progress-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
}

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

/* --- Progress Bar --- */
.progress {
  height: 8px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-3);
  width: 100%;
  box-sizing: border-box;
}

.progress__bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-papikopi-blue), var(--color-papikopi-orange));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress__labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  padding-bottom: var(--safe-bottom);
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: var(--space-2);
  z-index: var(--z-sticky);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  touch-action: manipulation;
  min-width: 0;
}

.nav-item:active {
  color: var(--color-text-primary);
}

.nav-item.active {
  color: var(--color-papikopi-orange);
}

.nav-item__icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.5;
  flex-shrink: 0;
}

.nav-item__label {
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Small phone bottom nav adjustments */
@media (max-width: 360px) {
  .nav-item__icon {
    width: 22px;
    height: 22px;
  }
  
  .nav-item__label {
    font-size: var(--text-tiny);
  }
  
  .nav-item {
    padding: var(--space-1) var(--space-1);
    gap: 2px;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--font-weight-semibold);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  touch-action: manipulation;
  text-decoration: none;
  white-space: nowrap;
  min-height: 48px; /* Minimum touch target */
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--color-papikopi-orange);
  color: var(--color-text-on-orange);
}

.btn--primary:active {
  background: var(--color-papikopi-brown);
}

.btn--secondary {
  background: var(--color-papikopi-blue);
  color: var(--color-text-on-primary);
}

.btn--secondary:active {
  background: var(--color-dark-slate);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--color-papikopi-orange);
  color: var(--color-papikopi-orange);
}

.btn--outline:active {
  background: var(--color-papikopi-orange);
  color: var(--color-text-on-orange);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn--ghost:active {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

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

.btn--danger:active {
  background: #A92222;
}

.btn--full {
  width: 100%;
}

.btn--sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-meta);
  min-height: 40px;
}

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

/* Small phone button adjustments */
@media (max-width: 360px) {
  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-meta);
    min-height: 44px;
  }
  
  .btn--sm {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-label);
    min-height: 36px;
  }
  
  .btn svg {
    width: 18px;
    height: 18px;
  }
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--grade {
  background: linear-gradient(135deg, var(--color-papi-warm-tan), var(--color-papikopi-brown));
  color: var(--color-papi-dark-brown);
}

.badge--info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state__icon {
  width: 64px;
  height: 64px;
  stroke-width: 1.5;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state__text {
  font-size: var(--font-size-sm);
  max-width: 280px;
}

/* --- Loading --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-papikopi-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-border) 50%, var(--color-bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

.skeleton-text {
  height: 1rem;
  margin-bottom: var(--space-2);
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-4) 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ============================================================
   STOCK MODULE (prototype)
   Sub-screens, transfer center, timelines, sheets, modals
   ============================================================ */

/* --- Sub-header (inside Stock sub-screens) --- */
.subheader {
  position: sticky;
  top: calc(var(--header-height) + var(--safe-top));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: calc(var(--container-padding) * -1) calc(var(--container-padding) * -1) var(--space-4);
  padding: var(--space-3) var(--container-padding);
  background: var(--color-bg-primary);
  border-bottom: 1px solid transparent;
}

.subheader--stuck {
  border-bottom-color: var(--color-border);
}

.subheader__back {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  touch-action: manipulation;
}

.subheader__back:active {
  transform: scale(0.94);
  background: var(--color-bg-tertiary);
}

.subheader__back svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

.subheader__titles {
  min-width: 0;
  flex: 1;
}

.subheader__title {
  font-size: var(--text-section-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subheader__subtitle {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Small phone subheader adjustments */
@media (max-width: 360px) {
  .subheader {
    padding: var(--space-2) var(--container-padding);
    gap: var(--space-2);
  }
  
  .subheader__back {
    width: 34px;
    height: 34px;
  }
  
  .subheader__back svg {
    width: 18px;
    height: 18px;
  }
  
  .subheader__title {
    font-size: var(--font-size-lg);
  }
  
  .subheader__subtitle {
    font-size: var(--text-tiny);
  }
}

/* --- Session role switch (prototype only) --- */
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.session-row__label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-weight-medium);
}

.role-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  touch-action: manipulation;
}

.role-switch:active {
  background: var(--color-bg-tertiary);
}

.role-switch__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-papikopi-blue);
  flex-shrink: 0;
}

.role-switch--manager .role-switch__dot {
  background: var(--color-papikopi-orange);
}

.role-switch svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
  color: var(--color-text-muted);
}

/* --- Banners (daily status / notices) --- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.banner__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 2.5;
  margin-top: 1px;
}

.banner__text {
  flex: 1;
  min-width: 0;
}

.banner__text strong {
  font-weight: var(--font-weight-semibold);
}

.banner__action {
  flex-shrink: 0;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}

.banner--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-papi-dark-brown);
}

.banner--info {
  background: var(--color-info-bg);
  border-color: var(--color-info);
  color: var(--color-dark-slate);
}

.banner--success {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

/* --- Badge additions (status chips reuse .badge) --- */
.badge--danger {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge--neutral {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.badge--locked {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

/* --- Summary metrics (Stock Home) --- */
.stat-card--locked {
  border-color: var(--color-warning);
  background: linear-gradient(135deg, var(--color-warning-bg) 0%, var(--color-bg-secondary) 100%);
}

.stat-card--pending {
  border-color: var(--color-papi-warm-tan);
  background: linear-gradient(135deg, var(--color-warning-bg) 0%, var(--color-bg-secondary) 100%);
}

/* --- Quick actions row --- */
.action-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.action-row--2 { grid-template-columns: repeat(2, 1fr); }

.action-row > .btn {
  min-width: 0;
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-meta);
  flex-direction: column;
  gap: var(--space-1);
  white-space: normal;
  text-align: center;
}

.action-row > .btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
  flex-shrink: 0;
}

@media (max-width: 340px) {
  .action-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
  .action-row > .btn {
    padding: var(--space-2) var(--space-1);
    font-size: var(--text-label);
  }
  
  .action-row > .btn svg {
    width: 18px;
    height: 18px;
  }
}

/* --- Product list rows --- */
.product-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.product-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: left;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-normal), border-color var(--transition-fast);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  min-width: 0;
}

.product-row:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-md);
}

.product-row--static { cursor: default; }
.product-row--static:active { transform: none; box-shadow: var(--shadow-sm); }

.product-tile {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
}

.product-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.product-row__name {
  font-size: var(--text-card-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.product-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  font-size: var(--text-meta);
  color: var(--color-text-muted);
  line-height: var(--line-height-normal);
}

.product-row__meta b {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}

.product-row__meta .is-locked { color: var(--color-warning); }
.product-row__meta .is-available { color: var(--color-success); }

.product-row__chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  stroke-width: 2.5;
  margin-top: auto;
  margin-bottom: auto;
}

/* Small phone product row adjustments */
@media (max-width: 360px) {
  .product-row {
    padding: var(--space-3);
    gap: var(--space-2);
  }
  
  .product-tile {
    width: 36px;
    height: 36px;
    font-size: var(--font-size-sm);
  }
  
  .product-row__name {
    font-size: var(--font-size-base);
  }
  
  .product-row__meta {
    font-size: var(--text-label);
    gap: var(--space-1) var(--space-2);
  }
  
  .product-row__chevron {
    width: 16px;
    height: 16px;
  }
}

/* --- Section label --- */
.list-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-5) 0 var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --- Detail hero (3 quantities) --- */
.detail-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.detail-hero__item {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  min-width: 0;
}

.detail-hero__item--available { border-color: var(--color-success); background: linear-gradient(180deg, var(--color-success-bg) 0%, var(--color-bg-secondary) 70%); }
.detail-hero__item--locked { border-color: var(--color-warning); background: linear-gradient(180deg, var(--color-warning-bg) 0%, var(--color-bg-secondary) 70%); }

.detail-hero__value {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xl);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.detail-hero__label {
  display: block;
  margin-top: 2px;
  font-size: var(--text-label);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Small phone detail hero adjustments */
@media (max-width: 360px) {
  .detail-hero {
    gap: var(--space-1);
  }
  
  .detail-hero__item {
    padding: var(--space-2) var(--space-1);
  }
  
  .detail-hero__value {
    font-size: var(--font-size-lg);
  }
  
  .detail-hero__label {
    font-size: var(--text-tiny);
  }
}

/* --- Mini info grid (daily info) --- */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.mini-grid > .mini-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.mini-grid--3 { grid-template-columns: repeat(3, 1fr); }

.mini-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  min-width: 0;
}

.mini-card__value {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xl);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.mini-card__label {
  margin-top: 2px;
  font-size: var(--text-label);
  color: var(--color-text-muted);
}

/* Small phone mini grid adjustments */
@media (max-width: 360px) {
  .mini-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  
  .mini-card {
    padding: var(--space-2);
  }
  
  .mini-card__value {
    font-size: var(--font-size-lg);
  }
  
  .mini-card__label {
    font-size: var(--text-tiny);
  }
}

.mini-card--accent .mini-card__value { color: var(--color-papikopi-orange); }
.mini-card--pending .mini-card__value { color: var(--color-warning); }

/* --- Tabs (Transfer Center) --- */
.tabs {
  display: flex;
  gap: var(--space-2);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  margin-bottom: var(--space-4);
}

.tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  touch-action: manipulation;
  min-width: 0;
}

.tab.active {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

.tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-papikopi-orange);
  color: #FFFFFF;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.tab:not(.active) .tab__count {
  background: var(--color-border-strong);
  color: var(--color-text-secondary);
}

/* --- Transfer card --- */
.transfer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.transfer-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.transfer-card--pending { border-left: 4px solid var(--color-papikopi-orange); }
.transfer-card--approved { border-left: 4px solid var(--color-success); }
.transfer-card--cancelled { border-left: 4px solid var(--color-border-strong); }

.transfer-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.transfer-card__product {
  font-size: var(--text-card-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.transfer-card__qty {
  font-size: var(--text-label);
  color: var(--color-text-muted);
}

.flow-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.flow-line__node {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.flow-line__avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
}

.flow-line__avatar--showcase { background: var(--color-info-bg); color: var(--color-dark-slate); }
.flow-line__avatar--self { background: linear-gradient(135deg, var(--color-papikopi-orange), var(--color-papikopi-brown)); color: var(--color-text-on-orange); }

.flow-line__name {
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-line__arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  stroke-width: 2.5;
}

.transfer-card__meta {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.transfer-card__actions {
  display: flex;
  gap: var(--space-2);
}

.transfer-card__actions .btn {
  flex: 1;
  min-width: 0;
}

/* Small phone transfer card adjustments */
@media (max-width: 360px) {
  .transfer-card {
    padding: var(--space-3);
  }
  
  .transfer-card__product {
    font-size: var(--font-size-base);
  }
  
  .transfer-card__qty {
    font-size: var(--text-tiny);
  }
  
  .flow-line__avatar {
    width: 24px;
    height: 24px;
    font-size: var(--text-tiny);
  }
  
  .flow-line__name {
    font-size: var(--text-label);
  }
  
  .flow-line__arrow {
    width: 14px;
    height: 14px;
  }
  
  .transfer-card__meta {
    font-size: var(--text-tiny);
  }
}

/* --- Wizard steps --- */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.wizard-step__dot {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
}

.wizard-step.active .wizard-step__dot {
  background: var(--color-papikopi-orange);
  color: #FFFFFF;
}

.wizard-step.done .wizard-step__dot {
  background: var(--color-success);
  color: #FFFFFF;
}

.wizard-step__label {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.wizard-step.active .wizard-step__label {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.wizard-step__line {
  flex: 1;
  height: 2px;
  min-width: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.wizard-step.done + .wizard-step__line,
.wizard-step.done .wizard-step__line { background: var(--color-success); }

@media (max-width: 360px) {
  .wizard-steps {
    gap: var(--space-1);
  }
  
  .wizard-step__dot {
    width: 20px;
    height: 20px;
    font-size: var(--text-tiny);
  }
  
  .wizard-step__label {
    font-size: var(--text-tiny);
  }
  
  .wizard-step__line {
    min-width: 4px;
  }
}

@media (max-width: 380px) {
  .wizard-step__label { display: none; }
  .wizard-step.active .wizard-step__label { display: inline; }
}

/* --- Option cards (destination / product select) --- */
.option-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.option-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  text-align: left;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  box-sizing: border-box;
  min-width: 0;
}

.option-card:active { transform: scale(0.99); }

.option-card.selected {
  border-color: var(--color-papikopi-orange);
  background: var(--color-warning-bg);
}

.option-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.option-card__body { flex: 1; min-width: 0; }

.option-card__title {
  font-size: var(--text-card-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.option-card__sub {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.option-card__check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
}

.option-card.selected .option-card__check {
  border-color: var(--color-papikopi-orange);
  background: var(--color-papikopi-orange);
  color: #FFFFFF;
}

.option-card__check svg { width: 12px; height: 12px; stroke-width: 3; }

/* Small phone option card adjustments */
@media (max-width: 360px) {
  .option-card {
    padding: var(--space-2);
    gap: var(--space-2);
  }
  
  .option-card__title {
    font-size: var(--font-size-base);
  }
  
  .option-card__sub {
    font-size: var(--text-tiny);
  }
  
  .option-card__check {
    width: 18px;
    height: 18px;
  }
}

/* --- Quantity control --- */
.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.qty-control__btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border-strong);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  touch-action: manipulation;
}

.qty-control__btn:active { transform: scale(0.92); }
.qty-control__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-control__btn svg { width: 20px; height: 20px; stroke-width: 2.5; }

.qty-control__input {
  width: 80px;
  height: 56px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-2xl);
  color: var(--color-text-primary);
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast);
  -moz-appearance: textfield;
}

.qty-control__input::-webkit-outer-spin-button,
.qty-control__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.qty-control__input:focus { border-color: var(--color-papikopi-orange); }

.qty-quick {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.qty-quick__btn {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  cursor: pointer;
  touch-action: manipulation;
}

.qty-quick__btn:active { background: var(--color-bg-tertiary); }

/* Small phone quantity control adjustments */
@media (max-width: 360px) {
  .qty-control {
    gap: var(--space-2);
  }
  
  .qty-control__btn {
    width: 40px;
    height: 40px;
  }
  
  .qty-control__btn svg {
    width: 18px;
    height: 18px;
  }
  
  .qty-control__input {
    width: 64px;
    height: 48px;
    font-size: var(--font-size-xl);
  }
  
  .qty-quick__btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-tiny);
  }
}

/* --- Preview (Available / Transfer / Remaining) --- */
.preview-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  margin-top: var(--space-3);
}

.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  font-size: var(--text-meta);
  color: var(--color-text-secondary);
}

.preview-row + .preview-row { border-top: 1px dashed var(--color-border-strong); }

.preview-row b {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
}

.preview-row--total b { color: var(--color-papikopi-orange); }
.preview-row--remaining.bad b { color: var(--color-error); }

/* --- Validation note --- */
.validation-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  font-size: var(--text-meta);
  line-height: var(--line-height-normal);
}

.validation-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 2.5;
  margin-top: 1px;
}

.validation-note--ok {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

/* --- Review block --- */
.review-block {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.review-block__route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.review-block__product {
  text-align: center;
  font-size: var(--text-meta);
  color: var(--color-text-secondary);
}

.review-block__product b {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: var(--space-5);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.timeline__item {
  position: relative;
  padding: 0 0 var(--space-3) 0;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute;
  left: calc(var(--space-5) * -1 + 1px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  border: 2px solid var(--color-bg-primary);
  box-sizing: content-box;
}

.timeline__item--pending .timeline__dot { background: var(--color-papikopi-orange); }
.timeline__item--cancelled .timeline__dot { background: var(--color-border-strong); }
.timeline__item--gratis .timeline__dot { background: var(--color-papikopi-blue); }

.timeline__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.timeline__time {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.timeline__title {
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.timeline__amount {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-meta);
  color: var(--color-success);
  white-space: nowrap;
}

.timeline__item--pending .timeline__amount { color: var(--color-papikopi-orange); }
.timeline__item--out .timeline__amount { color: var(--color-error); }
.timeline__item--cancelled .timeline__amount { color: var(--color-text-muted); }

.timeline__sub {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 2px;
  font-size: var(--text-label);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.timeline__item--pending .timeline__card {
  background: var(--color-warning-bg);
  border: 1px dashed var(--color-papikopi-orange);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}

.timeline__card {
  border-radius: var(--radius-md);
  padding: var(--space-1) 0;
}

/* --- Transfer status timeline (detail) --- */
.status-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.status-flow__step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.status-flow__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
}

.status-flow__icon svg { width: 14px; height: 14px; stroke-width: 2.5; }

.status-flow__step--done .status-flow__icon { background: var(--color-success-bg); color: var(--color-success); }
.status-flow__step--active .status-flow__icon { background: var(--color-warning-bg); color: var(--color-warning); }
.status-flow__step--cancelled .status-flow__icon { background: var(--color-error-bg); color: var(--color-error); }

.status-flow__label {
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.status-flow__sub {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-regular);
}

.status-flow__connector {
  margin-left: 13px;
  width: 2px;
  height: 14px;
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}

/* --- Info list (detail rows) --- */
.info-list {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-meta);
  border-bottom: 1px solid var(--color-border);
}

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

.info-row__label { color: var(--color-text-muted); flex-shrink: 0; }

.info-row__value {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* --- Sticky footer action inside content (not fixed over nav) --- */
.screen-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.screen-actions--row { flex-direction: row; }
.screen-actions--row > .btn { flex: 1; min-width: 0; }

/* --- Bottom sheet --- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.overlay--modal { align-items: center; padding: var(--space-4); }

.overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 35, 24, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  animation: overlayFade var(--transition-normal) both;
}

.overlay__panel {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + var(--safe-bottom));
  box-shadow: var(--shadow-xl);
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: sheetUp var(--transition-normal) both;
}

.overlay--modal .overlay__panel {
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  max-height: 82vh;
  animation: modalIn var(--transition-normal) both;
}

.overlay__handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-border-strong);
  margin: 0 auto var(--space-3);
}

.overlay__title {
  font-size: var(--text-section-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.overlay__subtitle {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  line-height: var(--line-height-normal);
}

.overlay__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.overlay__actions > .btn { flex: 1; min-width: 0; }

@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes modalIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Small phone overlay adjustments */
@media (max-width: 360px) {
  .overlay__panel {
    padding: var(--space-2) var(--space-3) calc(var(--space-3) + var(--safe-bottom));
  }
  
  .overlay__title {
    font-size: var(--font-size-lg);
  }
  
  .overlay__subtitle {
    font-size: var(--text-meta);
  }
  
  .overlay--modal .overlay__panel {
    padding: var(--space-3);
  }
}

/* Modal icon circle */
.modal-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.modal-icon svg { width: 26px; height: 26px; stroke-width: 2.5; }
.modal-icon--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.modal-icon--danger { background: var(--color-error-bg); color: var(--color-error); }
.modal-icon--success { background: var(--color-success-bg); color: var(--color-success); }
.modal-icon--info { background: var(--color-info-bg); color: var(--color-dark-slate); }

/* --- Reason selector (GRATIS) --- */
.reason-row {
  display: flex;
  gap: var(--space-2);
}

.reason-row .option-card {
  flex: 1;
  justify-content: center;
  padding: var(--space-3);
  text-align: center;
}

.reason-row .option-card__title { font-size: var(--font-size-sm); }

/* --- Order Edit (Manager correction, HANDBOOK §13) --- */
.order-edit__label {
  display: block;
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

.order-edit__select {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.order-edit__select:focus {
  outline: none;
  border-color: var(--color-papikopi-blue);
}

/* --- Order actions row (Ubah Order | Delete Order) --- */
.order-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.order-actions > .btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Cancelled order card (Delete Order — audit stays visible) --- */
.transfer-card--cancelled {
  border-color: var(--color-error);
  background: var(--color-error-bg);
  opacity: 0.92;
}

.transfer-card--cancelled .transfer-card__product {
  color: var(--color-text-muted);
}

/* --- Bulk Selection (Transfer, Production, Return) --- */
.product-selection-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-selection-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.product-selection-item:active {
  transform: scale(0.99);
  box-shadow: var(--shadow-md);
}

.product-selection-item.selected {
  border-color: var(--color-papikopi-orange);
  background: var(--color-warning-bg);
  box-shadow: var(--shadow-md);
  /* Selected products stack VERTICALLY so quantity controls always sit
     BELOW the product info — never competing on the same line:
       product info -> quantity controls -> remaining / remove        */
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}

.product-selection__main {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.product-selection__info {
  flex: 1;
  min-width: 0;
}

.product-selection__name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: 2px;
  /* Product names must NEVER be truncated by quantity controls —
     allow natural wrapping instead of single-line ellipsis. */
  overflow-wrap: break-word;
}

.product-selection__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.product-selection__meta b {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}

.product-selection__meta .is-locked { color: var(--color-warning); }
.product-selection__meta .is-available { color: var(--color-success); }

.product-selection__qty {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Footer row: remaining quantity + remove/add toggle.
   Unselected: sits on the right of the compact row (just the toggle).
   Selected:   own row under the quantity controls (Sisa …… ✕). */
.product-selection__footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* --- Selected (stacked) layout — shared by Order/Cart/Transfer/Production/Return --- */
.product-selection-item.selected .product-selection__main {
  width: 100%;
}

.product-selection-item.selected .product-selection__qty {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: center;
  gap: var(--space-3);
}

.product-selection-item.selected .product-selection__footer {
  width: 100%;
  justify-content: space-between;
}

.product-selection-item.selected .product-selection__footer .product-selection__toggle {
  margin-left: auto;
}

.qty-control__btn--small {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border-strong);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  touch-action: manipulation;
}

.qty-control__btn--small:active { transform: scale(0.9); }
.qty-control__btn--small:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-control__btn--small svg { width: 18px; height: 18px; stroke-width: 2.5; }

.qty-control__input--small {
  width: 60px;
  height: 44px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast);
  -moz-appearance: textfield;
}

.qty-control__input--small::-webkit-outer-spin-button,
.qty-control__input--small::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.qty-control__input--small:focus { border-color: var(--color-papikopi-orange); }

.product-selection__remaining {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.product-selection__remaining b { color: var(--color-text-secondary); }

.product-selection__toggle {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border-strong);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  touch-action: manipulation;
}

.product-selection__toggle:active { transform: scale(0.9); }
.product-selection__toggle.active {
  border-color: var(--color-papikopi-orange);
  background: var(--color-papikopi-orange);
  color: #FFFFFF;
}

.product-selection__toggle svg { width: 18px; height: 18px; stroke-width: 2.5; }

.product-selection__unavailable {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Small phones (320–360px): keep the stacked component stable.
   Layout already stacks; only tighten the quantity row spacing. */
@media (max-width: 360px) {
  .product-selection-item {
    gap: var(--space-2);
  }

  .product-selection-item.selected .product-selection__qty {
    gap: var(--space-2);
  }

  .product-selection-item.selected .product-selection__main,
  .product-selection-item.selected .product-selection__qty,
  .product-selection-item.selected .product-selection__footer {
    width: 100%;
  }
}

/* --- Review lines (wizard step 3/4, confirm modals) --- */
.review-block__products {
  margin-top: var(--space-3);
}

.review-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  border-bottom: 1px dashed var(--color-border);
}

.review-line:last-child { border-bottom: none; }

.review-line__product {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.review-line__qty b {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-base);
  color: var(--color-papikopi-orange);
}

.review-line__avail {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.review-line--total {
  border-top: 1px solid var(--color-border-strong);
  border-bottom: none;
  padding-top: var(--space-3);
  margin-top: var(--space-2);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.review-line--total b { color: var(--color-text-primary); }

/* --- Focus Visible --- */
:focus-visible {
  outline: 2px solid var(--color-papikopi-orange);
  outline-offset: 2px;
}

/* ========================================
   --- Order / POS module
   ======================================== */

/* Option card icon (payment methods) */
.option-card__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.option-card__icon svg { width: 20px; height: 20px; stroke-width: 2; }

.option-card.selected .option-card__icon {
  background: var(--color-papikopi-orange);
  color: var(--color-text-on-orange);
}

/* Total due (payment screen) */
.order-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-4);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.order-summary__label {
  font-size: var(--text-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.order-summary__value {
  font-family: var(--font-heading);
  font-size: var(--text-page-title);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
  line-height: 1.1;
}

.order-summary__sub {
  font-size: var(--text-tiny);
  color: var(--color-text-muted);
}

/* Simulated QRIS code (decorative, no gateway) */
.order-qr {
  width: min(64vw, 220px);
  aspect-ratio: 1;
  margin: var(--space-3) auto var(--space-2);
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  padding: var(--space-2);
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.order-qr i {
  display: block;
  background: var(--color-papi-dark-brown);
  border-radius: 1px;
}

/* Sticky cart bar (order home) */
.order-cartbar {
  position: fixed;
  left: var(--space-3);
  right: var(--space-3);
  bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--space-2));
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.14));
  box-sizing: border-box;
}

.order-cartbar__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.order-cartbar__count {
  font-size: var(--text-label);
  color: var(--color-text-muted);
}

.order-cartbar__total {
  font-family: var(--font-heading);
  font-size: var(--text-card-title);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
}

.order-cartbar .btn { flex-shrink: 0; }

/* Scroll clearance under the fixed cart bar (Bug 1).
   --order-cartbar-space is set by order-ui syncCartBarSpace() to the ACTUAL
   measured bar height + safe margin (0px when the bar is absent), so the last
   product card can always scroll fully above "Lihat Keranjang" — empty cart,
   full cart, and every breakpoint included. */
#screenOrder .container {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--space-6) + var(--order-cartbar-space, 0px));
}

/* Success screen */
.order-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-2) var(--space-4);
}

.order-success .modal-icon { width: 72px; height: 72px; }
.order-success .modal-icon svg { width: 36px; height: 36px; stroke-width: 2.5; }

.order-success__title {
  font-family: var(--font-heading);
  font-size: var(--text-page-title);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
  margin-top: var(--space-4);
}

.order-success__id {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  letter-spacing: 0.04em;
}

/* Small phones */
@media (max-width: 360px) {
  .order-cartbar { left: var(--space-2); right: var(--space-2); }
  .order-cartbar .btn { font-size: var(--font-size-sm); padding: var(--space-2) var(--space-3); }
  .order-summary { padding: var(--space-4) var(--space-3); }
}

/* ========================================
   PEAK / RANKING (HANDBOOK §22)
   Podium + daily rank list — mobile-first,
   gold/silver/bronze as restrained accents.
   ======================================== */

.peak-period-label {
  font-size: var(--text-meta);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.peak-empty-note {
  font-size: var(--text-meta);
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.peak-note {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  margin: var(--space-2) 0;
}

.peak-note--warn { color: var(--color-warning); }

/* --- Podium --- */
.peak-podium {
  display: grid;
  gap: var(--space-2);
  align-items: end;
}
.peak-podium--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.peak-podium--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.peak-podium--1 { grid-template-columns: minmax(0, 1fr); max-width: 220px; margin-inline: auto; }

.peak-podium__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  animation: peakRise var(--transition-normal) both;
}

.peak-podium__name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-meta);
  color: var(--color-text-primary);
  max-width: 100%;
  margin-top: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peak-podium__omzet {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--text-meta);
  color: var(--color-papikopi-orange);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peak-podium__base {
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-sm);
  color: #fff;
  margin-top: var(--space-2);
}
.peak-podium__base--1 { height: 52px; background: linear-gradient(180deg, #E6B34D, var(--color-papi-warm-tan)); }
.peak-podium__base--2 { height: 40px; background: linear-gradient(180deg, #AEB6BD, #8B969E); }
.peak-podium__base--3 { height: 30px; background: linear-gradient(180deg, #C9855B, #A96A45); }

/* --- Medals (restrained gold / silver / bronze) --- */
.peak-medal {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-xs);
  color: #fff;
  margin-bottom: var(--space-2);
  flex: none;
}
.peak-medal--1 { background: #E6B34D; box-shadow: 0 0 0 3px rgba(230, 179, 77, 0.25); }
.peak-medal--2 { background: #AEB6BD; }
.peak-medal--3 { background: #C9855B; }

/* --- Neutral initials avatar (no photo assets exist — never invented portraits) --- */
.peak-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-sm);
  flex: none;
  user-select: none;
}
.peak-avatar--podium { width: 54px; height: 54px; font-size: var(--font-size-base); }
.peak-avatar--podium-1 {
  width: 64px;
  height: 64px;
  font-size: var(--font-size-lg);
  border: 3px solid #E6B34D;
}
.peak-avatar--row { width: 34px; height: 34px; font-size: var(--font-size-xs); }

/* --- Divider between the two Peak sections --- */
.peak-divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

/* --- Today's Rank rows --- */
.peak-rank-list { min-width: 0; }

.peak-rank-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-1);
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
}
.peak-rank-row:last-child { border-bottom: 0; }

.peak-rank-row--me {
  background: var(--color-info-bg);
  border-radius: var(--radius-lg);
  border-bottom: 0;
  margin: var(--space-1) 0;
}

.peak-rank-num {
  width: 28px;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  flex: none;
}

.peak-rank-row__name {
  flex: 1;
  min-width: 0;
  font-weight: var(--font-weight-medium);
  font-size: var(--text-body);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peak-rank-row__me {
  font-size: var(--text-label);
  font-weight: var(--font-weight-regular);
  color: var(--color-papikopi-blue);
}

.peak-rank-row__stats {
  text-align: right;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.peak-rank-row__omzet {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--text-meta);
  color: var(--color-text-primary);
}

.peak-rank-row__cups {
  font-size: var(--text-label);
  color: var(--color-text-muted);
}

/* --- Period cards (Manager manage / archive view) --- */
.peak-period {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  min-width: 0;
}

.peak-period__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  min-width: 0;
}

.peak-period__label {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-card-title);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peak-period__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: var(--text-meta);
  min-width: 0;
}

.peak-period__name {
  flex: 1;
  min-width: 0;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peak-period__vals {
  flex: none;
  color: var(--color-text-secondary);
}

/* --- Short one-shot rank-change animations (reduced-motion aware) --- */
@keyframes peakRise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes peakFlashUp {
  from { background: var(--color-success-bg); }
  to { background: transparent; }
}
@keyframes peakFlashDown {
  from { background: var(--color-error-bg); }
  to { background: transparent; }
}
.peak-flash--up { animation: peakFlashUp 0.6s ease-out; }
.peak-flash--down { animation: peakFlashDown 0.6s ease-out; }

/* --- Small phones (320–360px): keep podium + rows overflow-free --- */
@media (max-width: 360px) {
  .peak-avatar--podium { width: 46px; height: 46px; font-size: var(--font-size-sm); }
  .peak-avatar--podium-1 { width: 56px; height: 56px; }
  .peak-podium__base--1 { height: 44px; }
  .peak-podium__base--2 { height: 34px; }
  .peak-podium__base--3 { height: 26px; }
  .peak-medal { width: 22px; height: 22px; }
  .peak-rank-row { gap: var(--space-2); }
  .peak-rank-num { width: 22px; }
}

/* ========================================
   WASTED MODULE (prototype)
   Page header + national/individual scope cards
   + history rows + exception review cards
   ======================================== */

.wasted-header {
  margin-bottom: var(--space-5);
  min-width: 0;
}

.wasted-header__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.wasted-header__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.wasted-header__period {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.wasted-header__hint {
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted);
}

.wasted-note {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* --- Scope block (personal per-barista overview) --- */
.wasted-scope {
  padding: var(--space-4);
}

.wasted-scope .stat-grid {
  margin-bottom: 0;
}

/* Status pill (text always present — never color alone) */
.wasted-status {
  gap: var(--space-1);
  flex-shrink: 0;
  white-space: nowrap;
}

.wasted-status svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
  flex-shrink: 0;
}

/* --- History --- */
.wasted-history {
  display: flex;
  flex-direction: column;
}

.wasted-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
}

.wasted-row:last-child { border-bottom: 0; padding-bottom: 0; }
.wasted-row:first-child { padding-top: 0; }

.wasted-row--cancelled {
  opacity: 0.72;
}

.wasted-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.wasted-row__product {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  overflow-wrap: break-word;
}

.wasted-row__size {
  font-size: var(--text-label);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted);
}

.wasted-row__qty {
  flex: none;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.wasted-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin-top: var(--space-1);
}

.wasted-row__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--text-label);
  color: var(--color-text-muted);
  min-width: 0;
}

.wasted-row__by {
  overflow-wrap: anywhere;
  text-align: right;
}

.wasted-row__approval {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-success-bg);
  border: 1px solid var(--color-success);
  color: var(--color-success);
  font-size: var(--text-label);
  line-height: var(--line-height-normal);
}

.wasted-row__approval svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 2.5;
  margin-top: 1px;
}

.wasted-row__approval--muted {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

/* --- Note --- */
.wasted-note {
  font-size: var(--text-meta);
  color: var(--color-text-secondary);
  margin: var(--space-2) 0;
  line-height: var(--line-height-normal);
}

/* --- Impact preview (record form) --- */
.wasted-impact {
  margin-top: var(--space-3);
  padding: var(--space-3);
}

.wasted-impact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.wasted-impact__grid > div {
  min-width: 0;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-start;
}

.wasted-impact__label {
  font-size: var(--text-label);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wasted-impact__val {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

/* --- Exception review cards (Manager manage view) --- */
.wasted-exc {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  min-width: 0;
  background: var(--color-bg-secondary);
}

.wasted-exc--pending {
  border-left: 4px solid var(--color-papikopi-orange);
}

.wasted-exc--approved {
  border-left: 4px solid var(--color-success);
}

.wasted-exc--rejected {
  border-left: 4px solid var(--color-error);
}

.wasted-exc:last-child { margin-bottom: 0; }

.wasted-exc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  min-width: 0;
}

.wasted-exc__id {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-meta);
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wasted-exc__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-label);
  min-width: 0;
}

.wasted-exc__body > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.wasted-exc__label {
  color: var(--color-text-muted);
  font-size: var(--text-tiny);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wasted-exc__body > div span:last-child {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.wasted-exc__decide {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border);
}

.wasted-exc__approval {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--text-label);
  line-height: var(--line-height-normal);
}

.wasted-exc__approval svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 2.5;
  margin-top: 1px;
  color: var(--color-text-muted);
}

/* --- Barista inspection buttons (Manager manage view) --- */
.wasted-inspect {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-meta);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  touch-action: manipulation;
  margin-bottom: var(--space-2);
  min-width: 0;
}

.wasted-inspect:last-of-type { margin-bottom: var(--space-3); }

.wasted-inspect:active { background: var(--color-bg-tertiary); }

.wasted-inspect.active {
  border-color: var(--color-papikopi-orange);
  background: var(--color-warning-bg);
}

.wasted-inspect__name {
  flex: 1;
  min-width: 0;
  font-weight: var(--font-weight-semibold);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wasted-inspect__vals {
  flex: none;
  color: var(--color-text-muted);
  font-size: var(--text-label);
  white-space: nowrap;
}

.wasted-inspect .wasted-status { padding: var(--space-1) var(--space-2); }

/* --- Small phones (320–360px): keep impact grid + exception body readable --- */
@media (max-width: 360px) {
  .wasted-header__title { font-size: var(--font-size-xl); }
  .wasted-exc__body { grid-template-columns: 1fr; }
  .wasted-inspect { flex-wrap: wrap; }
  .wasted-inspect__vals { width: 100%; order: 3; }
}

/* ========================================
   NOTIFICATIONS (header bell page)
   ======================================== */

/* Unread badge on the header bell */
.header__icon-btn { position: relative; }

.header__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--color-error);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: var(--font-weight-extrabold);
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}

.header__badge[hidden] { display: none; }

/* Page header */
.notif-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0 var(--space-3);
}

.notif-header__back { flex: none; }

.notif-header__titles { flex: 1; min-width: 0; }

.notif-header__title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-2xl);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  margin: 0;
  overflow-wrap: anywhere;
}

.notif-header__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: var(--space-1) 0 0;
  overflow-wrap: anywhere;
}

.notif-header__mark { flex: none; white-space: nowrap; }

/* List */
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.notif-item {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.notif-item--unread {
  border-color: var(--color-papikopi-blue);
  background: var(--color-info-bg);
}

.notif-item__btn {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  cursor: pointer;
  touch-action: manipulation;
}

.notif-item__btn:active { background: var(--color-bg-tertiary); }

.notif-item__icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background: var(--color-bg-tertiary);
  color: var(--color-dark-slate);
}

.notif-item--unread .notif-item__icon {
  background: var(--color-papikopi-blue);
  color: #fff;
}

.notif-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.notif-item__top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.notif-item__title {
  flex: 1;
  min-width: 0;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  line-height: var(--line-height-normal);
  overflow-wrap: anywhere;
}

.notif-item--unread .notif-item__title { font-weight: var(--font-weight-extrabold); }

.notif-item__dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: var(--radius-full);
  background: var(--color-papikopi-orange);
}

.notif-item__msg {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.notif-item__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-label);
  color: var(--color-text-muted);
}

.notif-item__status { white-space: nowrap; }

.notif-item--unread .notif-item__status {
  color: var(--color-papikopi-blue);
  font-weight: var(--font-weight-semibold);
}

.notif-footnote {
  margin: var(--space-4) 0 0;
  font-size: var(--text-label);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
  overflow-wrap: anywhere;
}

/* ========================================
   BARISTA PROFILE
   ======================================== */

.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0 var(--space-3);
}

.profile-header__back { flex: none; }

.profile-header__titles { flex: 1; min-width: 0; }

.profile-header__title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-2xl);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-header__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: var(--space-1) 0 0;
  overflow-wrap: anywhere;
}

/* Avatar (photo or neutral initials — never the mascot/logo) */
.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-sm);
  user-select: none;
  background: linear-gradient(135deg, var(--color-papikopi-orange), var(--color-papikopi-brown));
}

.profile-avatar--hero { width: 84px; height: 84px; font-size: var(--font-size-2xl); }
.profile-avatar--preview { width: 72px; height: 72px; font-size: var(--font-size-xl); }

.profile-avatar--photo { background: var(--color-bg-tertiary); }

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

/* Identity card */
.profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
}

.profile-identity__name {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-xl);
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

.profile-identity__email {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-identity__role { margin-top: var(--space-1); }

/* Read-only field rows */
.profile-fields { padding: var(--space-2) var(--space-4) var(--space-4); }

.profile-field {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.profile-field:last-of-type { border-bottom: none; }

.profile-field__label {
  flex: none;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.profile-field__value {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-fields__note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-label);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
}

.profile-fields__note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }

/* Avatar picker */
.profile-avatar__hint {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.profile-preview__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.profile-preview__label {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.profile-preview__name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-file-input { display: none; }

/* Inline field error (never color alone — icon + text) */
.profile-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-error);
  line-height: var(--line-height-normal);
  overflow-wrap: anywhere;
}

.profile-error svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }

/* Password fields */
.profile-pw-field { margin-bottom: var(--space-3); }

.profile-pw-field__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.profile-pw-field__input { flex: 1; min-width: 0; }

.profile-pw-field--error .profile-pw-field__input { border-color: var(--color-error); }

.profile-pw-field__eye {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  cursor: pointer;
  touch-action: manipulation;
}

.profile-pw-field__eye:active { background: var(--color-bg-tertiary); }

.profile-pw__policy {
  margin: var(--space-2) 0 0;
  font-size: var(--text-label);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
}

/* --- Small phones (320–360px) --- */
@media (max-width: 360px) {
  .notif-header__mark { padding-inline: var(--space-2); font-size: var(--font-size-xs); }
  .notif-item__btn { padding: var(--space-3); }
  .notif-item__icon { width: 32px; height: 32px; }
  .profile-identity { padding: var(--space-5) var(--space-3); }
  .profile-avatar--hero { width: 72px; height: 72px; font-size: var(--font-size-xl); }
  .profile-field { flex-direction: column; gap: var(--space-1); }
  .profile-field__value { text-align: left; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Print --- */
@media print {
  .header, .bottom-nav, .btn { display: none !important; }
  .screen { display: block !important; }
  /* print needs the document to flow (screen scroll containers are for viewport) */
  html, body, #app, #mainContent, .screen {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }
  body { background: white; }
}