/* =========================================================================
   備品管理システム — Liquid Glass Dark UI
   Deep gradient background + frosted glass panels
   Inspired by Apple Liquid Glass / iOS 26
   ========================================================================= */

:root {
  /* Dark theme base */
  --color-bg-start: #0f0c29;
  --color-bg-mid: #1a1440;
  --color-bg-end: #24243e;

  /* Accent */
  --color-blue: #5ac8fa;
  --color-blue-solid: #007aff;
  --color-success: #30d158;
  --color-warning: #ffd60a;
  --color-danger: #ff453a;

  /* Text on dark */
  --color-text: rgba(255, 255, 255, 0.92);
  --color-text-secondary: rgba(255, 255, 255, 0.60);
  --color-text-tertiary: rgba(255, 255, 255, 0.38);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Sizing */
  --top-bar-height: 56px;
  --bottom-nav-height: 76px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-pill: 100px;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 15px;
  --fs-sm: 17px;
  --fs-base: 19px;
  --fs-md: 20px;
  --fs-lg: 24px;
  --fs-xl: 30px;
  --fs-2xl: 36px;
  --fs-3xl: 42px;

  /* ── Glass tokens ── */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-medium: rgba(255, 255, 255, 0.12);
  --glass-bg-heavy: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-light: rgba(255, 255, 255, 0.10);
  --glass-blur: blur(24px) saturate(180%);
  --glass-blur-heavy: blur(40px) saturate(200%);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --glass-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.25);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.12);

  /* ── Gradient glass card ── */
  --card-gradient: linear-gradient(
    135deg,
    rgba(100, 60, 200, 0.25) 0%,
    rgba(60, 80, 200, 0.18) 40%,
    rgba(40, 140, 220, 0.12) 100%
  );
  --card-border-gradient: linear-gradient(
    135deg,
    rgba(140, 100, 255, 0.30) 0%,
    rgba(80, 120, 255, 0.15) 50%,
    rgba(60, 180, 255, 0.20) 100%
  );
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { width: 100%; height: 100%; }

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* =========================================================================
   Animated Background — from liquid-glass.html reference
   ========================================================================= */

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(135deg, #08080f 0%, #0e0e1a 25%, #141425 50%, #0e1520 75%, #080c14 100%);
}

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: float 20s ease-in-out infinite;
}

.blob:nth-child(1) {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #3a2a6e, #1a1040);
  top: -10%; left: -5%;
  animation-delay: 0s;
}

.blob:nth-child(2) {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #1a3a5e, #0e1e35);
  top: 50%; right: -8%;
  animation-delay: -5s;
  animation-duration: 25s;
}

.blob:nth-child(3) {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #2a1a4a, #150e28);
  bottom: -5%; left: 30%;
  animation-delay: -10s;
  animation-duration: 22s;
}

.blob:nth-child(4) {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #1a3040, #0c1a28);
  top: 30%; left: 50%;
  animation-delay: -15s;
  animation-duration: 28s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(80px, -60px) scale(1.1); }
  50% { transform: translate(-40px, 80px) scale(0.95); }
  75% { transform: translate(60px, 40px) scale(1.05); }
}

/* =========================================================================
   Core Glass — 毛玻璃基底
   ========================================================================= */

/* Glass base — with subtle purple-blue tint */
.glass {
  position: relative;
  background: linear-gradient(135deg, rgba(60, 40, 120, 0.12), rgba(30, 60, 100, 0.08)), rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(120, 100, 200, 0.15);
  border-radius: 24px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.02) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.glass:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.glass > * { position: relative; z-index: 1; }

/* =========================================================================
   Login Screen
   ========================================================================= */

.login-screen {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  z-index: 1;
  padding: var(--space-md);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-xl) var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.login-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.login-card__icon {
  color: var(--color-blue);
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 0 12px rgba(90, 200, 250, 0.40));
}

.login-card__title {
  font-size: var(--fs-xl);
  font-weight: 700;
  text-align: center;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.login-error {
  color: var(--color-danger);
  font-size: var(--fs-sm);
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 69, 58, 0.15);
  border-radius: var(--radius-sm);
  display: none;
}
.login-error:not(:empty) { display: block; }

/* =========================================================================
   App Layout
   ========================================================================= */

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  z-index: 1;
}

/* =========================================================================
   Top Bar — Frosted glass
   ========================================================================= */

.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--top-bar-height) + env(safe-area-inset-top));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 var(--space-lg) 8px;
  padding-top: env(safe-area-inset-top);
  z-index: 100;
  background: transparent;
  border: none;
  box-shadow: none;
}

.top-bar::before { display: none; }

.top-bar__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
  letter-spacing: -0.02em;
}

.top-bar__actions { display: flex; align-items: center; gap: var(--space-md); }

.top-bar__user {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

/* =========================================================================
   Alert Banner
   ========================================================================= */

.alert-banner {
  position: fixed;
  top: var(--top-bar-height);
  left: 0; right: 0;
  background: rgba(255, 214, 10, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--color-warning);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 99;
  font-size: var(--fs-sm);
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 214, 10, 0.15);
}

.alert-banner svg { flex-shrink: 0; }

/* =========================================================================
   Ticker Bar (home page)
   ========================================================================= */

.ticker-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-md);
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg,
    rgba(120, 80, 255, 0.18) 0%,
    rgba(0, 180, 255, 0.14) 40%,
    rgba(255, 80, 160, 0.12) 100%);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 4px 20px rgba(100, 80, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
  position: relative;
}

.ticker-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.10) 0%,
    rgba(255,255,255,0.02) 50%,
    rgba(255,255,255,0.06) 100%);
  pointer-events: none;
}

.ticker-bar__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(160, 120, 255, 0.25);
  border-radius: 50%;
  color: rgba(200, 170, 255, 0.9);
  z-index: 1;
}

.ticker-bar__track {
  flex: 1;
  overflow: hidden;
  min-width: 0;
  z-index: 1;
}

.ticker-bar__content {
  display: inline-flex;
  white-space: nowrap;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: #FFD60A;
  -webkit-text-fill-color: #FFD60A;
  animation: ticker-scroll 20s linear infinite;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}


/* =========================================================================
   Content
   ========================================================================= */

.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--top-bar-height) + env(safe-area-inset-top) + var(--space-md)) var(--space-lg) calc(var(--bottom-nav-height) + var(--space-md));
}

.page-view {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  animation: fadeSlideIn 0.3s ease-out;
}

.page-view.is-active { display: block; }

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

.page-title {
  font-size: var(--fs-3xl);
  font-weight: 700;
  margin: var(--space-lg) 0 var(--space-md);
  color: var(--color-text);
  letter-spacing: -0.03em;
}

/* Hero message — like liquid-glass.html hero section */
.hero-message {
  text-align: center;
  padding: 60px 20px 48px;
}

.hero-message__title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, rgba(180, 160, 255, 0.7) 50%, rgba(120, 180, 255, 0.5) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-message__text {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.50);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* =========================================================================
   Search — Glass search bar
   ========================================================================= */

.toolbar { display: flex; gap: var(--space-md); margin-bottom: var(--space-md); flex-wrap: wrap; }

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding-left: var(--space-md);
  height: 44px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.search-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.25);
}

.search-icon { flex-shrink: 0; color: var(--color-text-tertiary); margin-right: var(--space-sm); }

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--fs-base);
  color: var(--color-text);
  padding: 0 var(--space-md);
  outline: none;
}

.search-input::placeholder { color: var(--color-text-tertiary); }

/* =========================================================================
   Chips — Glass filter pills
   ========================================================================= */

.chip-group { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: var(--space-md); }

.chip {
  padding: 8px 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chip:hover {
  background: rgba(90, 200, 250, 0.10);
  border-color: rgba(90, 200, 250, 0.30);
  color: var(--color-blue);
}

.chip.is-active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(240, 165, 0, 0.20));
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.40);
  font-weight: 600;
}

/* =========================================================================
   Tables — Glass card
   ========================================================================= */

.table-wrap {
  background: linear-gradient(135deg, rgba(60, 40, 120, 0.10), rgba(30, 60, 100, 0.06)), rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(120, 100, 200, 0.15);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
}

.table-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.06) 100%);
  pointer-events: none;
  z-index: 0;
}

.table-wrap > * { position: relative; z-index: 1; }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }

.table thead {
  background: linear-gradient(135deg, rgba(80, 60, 140, 0.10), rgba(40, 80, 120, 0.08));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table th,
.table td {
  padding: 20px var(--space-md);
  text-align: center;
}

.table th {
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  font-size: var(--fs-md);
  font-weight: 600;
}

/* 品名欄靠左 */
.table th:first-child,
.table td:first-child {
  text-align: left;
}

.cell--icon {
  width: 48px;
  text-align: center;
  color: var(--color-text-secondary);
}
.cell--icon svg { vertical-align: middle; }

.table tbody tr {
  transition: all 0.25s ease;
  cursor: pointer;
}

.table tbody tr:hover {
  background: linear-gradient(135deg, rgba(80, 60, 140, 0.14), rgba(40, 80, 120, 0.10));
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(80, 50, 180, 0.15);
  border-radius: 8px;
}
.table tbody tr:last-child td { border-bottom: none; }

/* Low stock danger row — strong red glow + left border */
.table tbody tr.row--danger {
  background: linear-gradient(90deg, rgba(255, 59, 48, 0.20) 0%, rgba(255, 59, 48, 0.06) 100%);
  border-left: 4px solid #ff453a;
  box-shadow:
    inset 0 0 30px rgba(255, 59, 48, 0.15),
    0 0 20px rgba(255, 59, 48, 0.12);
  animation: dangerPulse 2s ease-in-out infinite;
}

.table tbody tr.row--danger td {
  border-bottom-color: rgba(255, 59, 48, 0.20);
  color: #ff8a80;
}

.table tbody tr.row--danger td:first-child {
  color: #ff453a;
}

.table tbody tr.row--danger:hover {
  background: linear-gradient(90deg, rgba(255, 59, 48, 0.30) 0%, rgba(255, 59, 48, 0.10) 100%);
  box-shadow:
    inset 0 0 40px rgba(255, 59, 48, 0.20),
    0 0 30px rgba(255, 59, 48, 0.18);
}

/* ── 安全在庫以下（ティール警告）── */
.table tbody tr.row--warning {
  background: linear-gradient(90deg, rgba(234,179,8,0.25) 0%, rgba(234,179,8,0.05) 100%);
  border-left: 5px solid #eab308;
  box-shadow: inset 3px 0 16px rgba(234,179,8,0.14);
}
.table tbody tr.row--warning td {
  border-bottom-color: rgba(234,179,8,0.20);
}
.table tbody tr.row--warning:hover {
  background: linear-gradient(90deg, rgba(234,179,8,0.35) 0%, rgba(234,179,8,0.10) 100%);
}

/* ── 在庫状態バッジ ── */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 16px;
  border-radius: 24px;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.stock-badge--empty {
  background: rgba(255,59,48,0.18);
  color: #ff3b30;
  border: 1px solid rgba(255,59,48,0.45);
}
.stock-badge--low {
  background: rgba(234,179,8,0.18);
  color: #fde047;
  border: 1px solid rgba(234,179,8,0.40);
}
.stock-badge--ok {
  background: rgba(48,209,88,0.10);
  color: #30d158;
  border: 1px solid rgba(48,209,88,0.28);
}

@keyframes dangerPulse {
  0%, 100% {
    box-shadow:
      inset 0 0 30px rgba(255, 59, 48, 0.12),
      0 0 15px rgba(255, 59, 48, 0.08);
  }
  50% {
    box-shadow:
      inset 0 0 50px rgba(255, 59, 48, 0.25),
      0 0 35px rgba(255, 59, 48, 0.20);
  }
}
.cell--center { text-align: center; }
.table th[data-col] { cursor: pointer; }
.table th[data-col]:hover { color: var(--color-blue); }

@media (max-width: 768px) {
  .hide-mobile { display: none; }
  .table th, .table td { padding: 10px var(--space-sm); }
}

/* =========================================================================
   Empty State
   ========================================================================= */

.empty-state { text-align: center; padding: var(--space-xl); color: var(--color-text-tertiary); }
.empty-state__text { font-size: var(--fs-base); }

/* =========================================================================
   Forms — Glass form card
   ========================================================================= */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background: linear-gradient(135deg, rgba(60, 40, 120, 0.10), rgba(30, 60, 100, 0.06)), rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(120, 100, 200, 0.15);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
}

.form::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.06) 100%);
  pointer-events: none;
  z-index: 0;
}

.form > * { position: relative; z-index: 1; }

.form__field { display: flex; flex-direction: column; gap: var(--space-xs); }

.form__field label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

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

.form__actions { display: flex; gap: var(--space-md); margin-top: var(--space-sm); }

.input, .select, .textarea {
  padding: 12px var(--space-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.10);
}

.input::placeholder, .textarea::placeholder { color: var(--color-text-tertiary); }
.select { color: var(--color-text); }
.select option { background: #1a1440; color: white; }
.textarea { resize: vertical; font-family: inherit; }
.required { color: var(--color-danger); }

.section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-tertiary);
  margin: var(--space-md) 0 var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

/* =========================================================================
   Order Page — 2-column layout (form left, favorites right)
   ========================================================================= */

.order-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.order-layout__form {
  min-width: 0;
}

.order-layout__fav {
  min-width: 0;
}

.fav-hint {
  font-size: var(--fs-xs);
  color: var(--color-text-tertiary);
  text-align: center;
  margin-top: var(--space-md);
}

@media (max-width: 768px) {
  .order-layout {
    grid-template-columns: 1fr;
  }
}

/* Favorites section */
.fav-section {
  margin-bottom: var(--space-lg);
}

.fav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.fav-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.fav-empty {
  font-size: var(--fs-sm);
  color: var(--color-text-tertiary);
  padding: var(--space-md);
  text-align: center;
}

.fav-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px dashed rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.10);
  color: #a78bfa;
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.fav-add-btn:hover {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.70);
}

.fav-add-btn:active { transform: scale(0.90); }

/* Favorite card — horizontal glass bar */
.fav-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg, rgba(100, 60, 200, 0.30), rgba(60, 100, 220, 0.22), rgba(40, 160, 200, 0.18));
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 4px 20px rgba(80, 50, 180, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.10);
  overflow: hidden;
}

/* Gradient border via ::after */
.fav-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, rgba(180, 120, 255, 0.60), rgba(100, 160, 255, 0.45), rgba(60, 220, 200, 0.40));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}

/* Specular highlight */
.fav-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.03) 40%, rgba(255,255,255,0.06) 100%);
  pointer-events: none;
  z-index: 1;
}

.fav-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(80, 50, 180, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.fav-card:hover::after {
  background: linear-gradient(135deg, rgba(180, 120, 255, 0.80), rgba(100, 160, 255, 0.65), rgba(60, 220, 200, 0.55));
}

.fav-card:active { transform: scale(0.96); }

.fav-card__info {
  flex: 1;
  min-width: 0;
  position: relative;
}

.fav-card__name {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  letter-spacing: -0.02em;
}

.fav-card__detail {
  font-size: var(--fs-xs);
  color: var(--color-text-tertiary);
  position: relative;
  margin-top: 2px;
}

.fav-card__remove {
  flex-shrink: 0;
  margin-left: var(--space-md);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-tertiary);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.fav-card__remove:hover {
  background: rgba(255, 59, 48, 0.20);
  color: var(--color-danger);
}

/* Reason section — outside form card */
.reason-section {
  margin-top: var(--space-md);
}

.reason-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.reason-header__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-tertiary);
}

.fav-add-btn--sm {
  width: 40px;
  height: 40px;
  font-size: 24px;
}

.reason-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
}

/* Reason card — green glass tile */
.reason-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(240, 165, 0, 0.08));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #ffd700;
}

.reason-chip:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(240, 165, 0, 0.16));
  border-color: rgba(255, 215, 0, 0.45);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.reason-chip:active { transform: scale(0.94); }

.reason-chip__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 11px;
  opacity: 0.3;
  cursor: pointer;
}

.reason-chip__remove:hover { opacity: 1; color: var(--color-danger); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: var(--fs-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}

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

.btn--primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.6), rgba(168, 85, 247, 0.6));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.btn--primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.75), rgba(168, 85, 247, 0.75));
  transform: translateY(-1px);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 69, 58, 0.30);
}
.btn--danger:hover { background: #e5342a; }
.btn--danger-ghost { background: rgba(255,69,58,0.12); color: #ff453a; border: 1px solid rgba(255,69,58,0.3); }
.btn--danger-ghost:hover { background: rgba(255,69,58,0.22); }

.btn--accent {
  background: var(--color-success);
  color: #fff;
  box-shadow: 0 4px 16px rgba(48, 209, 88, 0.30);
}
.btn--accent:hover { background: #2abe4a; }

.btn--sm { padding: 8px 14px; font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.btn--full { width: 100%; }
.btn--icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.btn-row { display: flex; gap: var(--space-md); flex-wrap: wrap; }

/* =========================================================================
   Tabs — Glass segmented control
   ========================================================================= */

.tab-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  margin-bottom: var(--space-md);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px var(--space-md);
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border-radius: var(--radius-sm);
}
.tab-btn:hover { color: var(--color-text-secondary); }

.tab-btn.is-active {
  background: linear-gradient(135deg, rgba(80, 60, 160, 0.22), rgba(40, 90, 140, 0.18));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* =========================================================================
   Accordion — Glass sections
   ========================================================================= */

.accordion {
  border: 1px solid rgba(120, 100, 200, 0.15);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(60, 40, 120, 0.10), rgba(30, 60, 100, 0.06)), rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.accordion-item { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.accordion-item:last-child { border-bottom: none; }

.accordion-trigger {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: none;
  background: transparent;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  font-family: inherit;
}
.accordion-trigger:hover { background: rgba(255, 255, 255, 0.04); }

.accordion-icon {
  font-size: 12px;
  transition: transform 0.25s ease;
  display: inline-block;
  margin-left: var(--space-md);
  color: var(--color-text-tertiary);
}

.accordion-item.is-open .accordion-icon { transform: rotate(180deg); }

.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.accordion-item.is-open .accordion-body { max-height: 2000px; }

.accordion-content { padding: 0 var(--space-lg) var(--space-lg); }

/* =========================================================================
   Gooey Gravity Nav — liquid-glass.html approach
   SVG filter: feGaussianBlur + feColorMatrix for organic blob merging
   ========================================================================= */

.gnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 8px) + 12px);
  pointer-events: none;
}

/* Inner wrapper — positioning parent for both ul and blob-container */
.gnav__inner {
  position: relative;
  pointer-events: all;
}

.gnav__list {
  display: flex;
  list-style: none;
  gap: 0;
  padding: 6px;
  margin: 0;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 10;
  pointer-events: all;
}

.gnav__li {
  padding: 0;
  position: relative;
  cursor: pointer;
}

.gnav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 36px;
  border-radius: 50px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.50);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.4s ease;
  position: relative;
  z-index: 20;
  -webkit-tap-highlight-color: transparent;
}

.gnav__link:hover { color: rgba(255, 255, 255, 0.80); }
.gnav__link svg { display: block; }

.gnav__li.is-active .gnav__link {
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Gooey blob container — SVG filter applied here for organic merging */
.gnav__blob-container {
  position: absolute;
  inset: -20px -10px -10px -10px;
  pointer-events: none;
  filter: url(#gooey-filter);
  z-index: 5;
}

/* The gooey blob — purple #9b6cfc, moves with active item */
.gnav__blob {
  position: absolute;
  height: 44px;
  width: 0;
  border-radius: 50px;
  background: linear-gradient(135deg, #ffd700, #f0a500, #d4880f);
  transition: left 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              width 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              top 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* =========================================================================
   Modals — Heavy frosted glass
   ========================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.modal-backdrop.is-open {
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  transform: scale(0.90) translateY(16px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-backdrop.is-open .modal { transform: scale(1) translateY(0); }

.modal--wide { max-width: 800px; }

.modal__close {
  position: absolute;
  top: var(--space-md); right: var(--space-md);
  width: 32px; height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-tertiary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 10;
}
.modal__close:hover { background: rgba(255, 255, 255, 0.15); color: var(--color-text); }

.modal__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin: 0 0 var(--space-md);
  color: var(--color-text);
  padding-right: 40px;
  letter-spacing: -0.02em;
}

.modal__footer { display: flex; gap: var(--space-md); margin-top: var(--space-lg); flex-wrap: wrap; }

/* Modal forms — no double glass */
.modal .form {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  padding: 0;
  box-shadow: none;
}
.modal .form::before { display: none; }

/* =========================================================================
   Takeout Modal — 取り出し counter
   ========================================================================= */

.takeout-info {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.takeout-icon {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
}

.takeout-icon svg { width: 48px; height: 48px; }

.takeout-name {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.takeout-stock {
  font-size: var(--fs-sm);
  color: var(--color-text-tertiary);
}

.takeout-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin: var(--space-lg) 0 var(--space-sm);
}

.takeout-btn-round {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.takeout-btn-round:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.30);
}

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

.takeout-qty {
  font-size: 48px;
  font-weight: 700;
  color: var(--color-text);
  min-width: 80px;
  text-align: center;
  letter-spacing: -2px;
}

.takeout-label {
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-md);
}

/* =========================================================================
   Receiving Page
   ========================================================================= */

.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--color-text-tertiary);
  margin: calc(var(--space-sm) * -1) 0 var(--space-lg);
}

.receiving-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Pending receiving card */
.recv-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: 80px;
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.recv-card--pending {
}

.recv-card--done {
  opacity: 0.5;
}

.recv-card__info {
  flex: 1;
  min-width: 0;
}

.recv-card__name {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--color-text);
}

.recv-card__detail {
  font-size: var(--fs-xs);
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.recv-card__qty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.recv-card__qty-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.05em;
}

.recv-card__qty-input {
  width: 64px;
  text-align: center;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: var(--color-text);
  font-size: var(--fs-md);
  font-weight: 700;
  padding: 6px 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}

.recv-card__qty-input::-webkit-inner-spin-button,
.recv-card__qty-input::-webkit-outer-spin-button { opacity: 1; }

.recv-card__qty-input:focus {
  border-color: rgba(48, 209, 88, 0.5);
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.12);
}

.recv-card__qty {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-text);
  min-width: 50px;
  text-align: center;
}

.recv-card__action {
  flex-shrink: 0;
}

.btn--receive {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,
    rgba(48, 209, 88, 0.22) 0%,
    rgba(52, 199, 89, 0.14) 50%,
    rgba(100, 220, 120, 0.18) 100%);
  backdrop-filter: blur(20px) saturate(200%) brightness(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(200%) brightness(1.1);
  color: rgba(160, 255, 180, 0.95);
  border: 1px solid rgba(48, 209, 88, 0.35);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 4px 16px rgba(48, 209, 88, 0.15),
    inset 0 1px 0 rgba(180, 255, 200, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  text-shadow: 0 0 12px rgba(48, 209, 88, 0.6);
}

.btn--receive::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.03) 50%,
    rgba(255, 255, 255, 0.07) 100%);
  border-radius: inherit;
  pointer-events: none;
}

.btn--receive:hover {
  background: linear-gradient(135deg,
    rgba(48, 209, 88, 0.32) 0%,
    rgba(52, 199, 89, 0.22) 50%,
    rgba(100, 220, 120, 0.28) 100%);
  border-color: rgba(48, 209, 88, 0.55);
  transform: translateY(-1px);
  box-shadow:
    0 8px 28px rgba(48, 209, 88, 0.28),
    inset 0 1px 0 rgba(180, 255, 200, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  color: rgba(200, 255, 210, 1);
}

.btn--receive:active { transform: scale(0.96); }

/* =========================================================================
   Settings
   ========================================================================= */

.settings-list { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-md); }

.settings-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
}

.settings-add-row { display: flex; gap: var(--space-md); align-items: flex-end; }
.settings-add-row .input, .settings-add-row .select { flex: 1; }

/* =========================================================================
   Link Cards — Glass
   ========================================================================= */

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.link-card {
  padding: var(--space-lg) var(--space-md);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.link-card__name { font-size: var(--fs-base); font-weight: 600; color: var(--color-text); margin-bottom: var(--space-xs); position: relative; }
.link-card__url { font-size: var(--fs-sm); color: var(--color-text-tertiary); position: relative; }

/* =========================================================================
   Quick Action Cards — Settings Page
   ========================================================================= */

.quick-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.quick-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  font-family: inherit;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.quick-card:active { transform: translateY(0); }

.quick-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(90, 200, 250, 0.12);
  border: 1px solid rgba(90, 200, 250, 0.2);
  flex-shrink: 0;
  color: var(--color-blue);
}

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

.quick-card__title {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-card__desc {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.quick-card__arrow { color: var(--color-text-tertiary); flex-shrink: 0; }

.quick-card__badge {
  position: absolute;
  top: 8px;
  right: 32px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

@media (max-width: 480px) {
  .quick-cards-grid { grid-template-columns: 1fr; }
  .quick-card__title { font-size: var(--fs-sm); }
}

/* =========================================================================
   Sub-page Header (back button + title)
   ========================================================================= */

.sub-page-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sub-page-back {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sub-page-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0;
}

/* =========================================================================
   Orders Management List
   ========================================================================= */

.orders-mgmt-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 640px) {
  .orders-mgmt-list {
    grid-template-columns: 1fr;
  }
}

/* --- Glass card base (Liquid Glass / Apple iOS 26 style) --- */
.order-mgmt-card {
  padding: var(--space-lg);
  border-radius: 20px;
  /* 極透明玻璃底：背景色彩可穿透 */
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
  -webkit-backdrop-filter: blur(28px) saturate(200%) brightness(1.05);
  /* 細緻白色邊框 — 玻璃邊緣高光 */
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.22),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Glass sheen — 光澤折射偽元素 */
.order-mgmt-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.01) 45%,
    rgba(255, 255, 255, 0.04) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* State — 只用透明度和飽和度區分，不加底色以保持穿透感 */
.order-mgmt-card--pending  { /* default — no extra style needed */ }
.order-mgmt-card--approved { opacity: 0.82; }
.order-mgmt-card--rejected { opacity: 0.38; filter: saturate(0.4) brightness(0.85); }

/* Make sure content sits above ::before */
.order-mgmt-card__header,
.order-mgmt-card__meta,
.order-mgmt-card__reason,
.order-mgmt-card__actions {
  position: relative;
  z-index: 1;
}

.order-mgmt-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.order-mgmt-card__name {
  font-size: var(--fs-md);
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-mgmt-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.order-mgmt-card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-mgmt-card__reason {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.order-mgmt-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* Print icon button on each card */
.order-mgmt-print-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.order-mgmt-print-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Print preview modal: doc renders on white bg */
.print-doc-preview {
  background: #fff;
  color: #000;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
  font-size: 13px;
}

/* 却下 / 許可 buttons — solid glass pill style */
/* 発注ボタン */
.order-mgmt-order-btn.btn {
  background: rgba(94, 60, 220, 0.82);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(94, 60, 220, 0.4), inset 0 1px 0 rgba(255,255,255,0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-mgmt-order-btn.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(94, 60, 220, 0.55), inset 0 1px 0 rgba(255,255,255,0.28);
}

.order-mgmt-order-btn.btn:active { transform: scale(0.96); }

.order-mgmt-reject.btn {
  background: rgba(255, 69, 58, 0.82);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(255, 69, 58, 0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-mgmt-reject.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 69, 58, 0.5), inset 0 1px 0 rgba(255,255,255,0.22);
}

.order-mgmt-reject.btn:active { transform: scale(0.96); }

.order-mgmt-approve.btn {
  background: rgba(94, 60, 220, 0.82);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(94, 60, 220, 0.4), inset 0 1px 0 rgba(255,255,255,0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-mgmt-approve.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(94, 60, 220, 0.55), inset 0 1px 0 rgba(255,255,255,0.28);
}

.order-mgmt-approve.btn:active { transform: scale(0.96); }

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

.prefs-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: var(--space-md);
}

.prefs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: var(--space-md);
}

.prefs-item:last-child { border-bottom: none; }
.prefs-item--col { flex-direction: column; align-items: stretch; gap: 10px; }

.pref-email-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pref-email-input { flex: 1; }

.emailjs-config {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(120, 80, 255, 0.06);
  border: 1px solid rgba(120, 80, 255, 0.15);
}
.emailjs-config__label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2px;
}
.emailjs-config__hint {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  line-height: 1.5;
}
.emailjs-config__hint code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  color: rgba(180,150,255,0.9);
}
.input--sm { padding: 7px 10px; font-size: 12px; }

.prefs-item__label { font-size: var(--fs-base); font-weight: 500; margin-bottom: 2px; }
.prefs-item__desc { font-size: var(--fs-sm); color: var(--color-text-secondary); }

.pref-toggle {
  position: relative;
  width: 46px;
  height: 26px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.pref-toggle::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.pref-toggle:checked { background: var(--color-blue-solid); border-color: var(--color-blue-solid); }
.pref-toggle:checked::before { transform: translateX(20px); }

/* =========================================================================
   Notify Modal Items
   ========================================================================= */

.notify-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.notify-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.notify-item__dot--danger { background: var(--color-danger); box-shadow: 0 0 6px var(--color-danger); }
.notify-item__dot--warning { background: var(--color-warning); box-shadow: 0 0 6px var(--color-warning); }

.notify-item__name { flex: 1; font-size: var(--fs-base); font-weight: 500; }
.notify-item__stock { font-size: var(--fs-sm); color: var(--color-text-secondary); }

/* 安全在庫数設定 */
.safety-stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
.safety-stock-row:last-child { border-bottom: none; }
.safety-stock-row__name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 120px;
  font-size: var(--fs-base);
  font-weight: 500;
}
.safety-stock-row__icon { font-size: 18px; }
.safety-stock-row__unit { font-size: 12px; color: rgba(255,255,255,0.4); margin-left: 4px; }
.safety-stock-row__control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* 通知センター */
.notify-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 8px;
  margin-top: 4px;
}

.custom-notify-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.custom-notify-item__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.custom-notify-item__title { font-size: var(--fs-base); font-weight: 600; }
.custom-notify-item__text { font-size: var(--fs-sm); color: var(--color-text-secondary); }
.custom-notify-item__date { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 4px; }
.custom-notify-item__actions { display: flex; gap: 4px; flex-shrink: 0; }

.btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-icon-sm:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); }
.btn-delete-notice:hover { background: rgba(255,60,60,0.2); color: #ff6b6b; border-color: rgba(255,60,60,0.3); }

.custom-notify-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  margin-top: 4px;
}
.custom-notify-textarea {
  resize: vertical;
  min-height: 56px;
  font-family: inherit;
}

/* =========================================================================
   Checkboxes
   ========================================================================= */

.checkbox-group { display: flex; flex-direction: column; gap: var(--space-sm); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-base);
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: var(--color-blue);
}

/* =========================================================================
   Toast — Glass toast
   ========================================================================= */

.toast-region {
  position: fixed;
  top: calc(var(--top-bar-height) + var(--space-md));
  right: var(--space-md);
  max-width: 380px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--color-text);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  margin-bottom: var(--space-sm);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), var(--glass-inset);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
  font-weight: 500;
}

.toast.is-visible { opacity: 1; transform: translateX(0); }

/* =========================================================================
   Badges
   ========================================================================= */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.badge--ok, .badge--success { background: rgba(48, 209, 88, 0.18); color: var(--color-success); }
.badge--warning { background: rgba(255, 214, 10, 0.18); color: var(--color-warning); }
.badge--danger { background: rgba(255, 69, 58, 0.18); color: var(--color-danger); }
.badge--info { background: rgba(10, 132, 255, 0.18); color: #0a84ff; }

/* =========================================================================
   Print Preview
   ========================================================================= */

.print-content {
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  padding: var(--space-lg);
  border-radius: var(--radius-sm);
  min-height: 400px;
}

/* =========================================================================
   Admin Only
   ========================================================================= */

.admin-only { display: none; }
.admin-only.visible { display: block; }
.modal__footer .admin-only.visible { display: inline-flex; }
td .admin-only.visible { display: inline-flex; }

/* =========================================================================
   Text Utils
   ========================================================================= */

.text-muted { color: var(--color-text-tertiary); font-size: var(--fs-sm); }

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

@media (max-width: 1024px) {
  .content { padding-left: var(--space-md); padding-right: var(--space-md); }
}

@media (max-width: 768px) {
  :root {
    --fs-base: 14px;
    --fs-lg: 17px;
    --fs-xl: 20px;
    --fs-2xl: 24px;
    --fs-3xl: 28px;
    --radius: 14px;
    --radius-lg: 20px;
  }

  .top-bar { padding: 0 var(--space-md); }
  .top-bar__title { font-size: var(--fs-md); }
  .top-bar__user { display: none; }
  .content { padding-left: var(--space-md); padding-right: var(--space-md); }
  .page-title { font-size: var(--fs-xl); margin: var(--space-md) 0 var(--space-sm); }
  .modal { max-width: calc(100% - var(--space-md) * 2); padding: var(--space-md); }
  .link-cards { grid-template-columns: 1fr; }

  .blob--1 { width: 300px; height: 300px; }
  .blob--2 { width: 250px; height: 250px; }
  .blob--3 { width: 200px; height: 200px; }
  .blob--4 { width: 180px; height: 180px; }
}

@media (max-width: 480px) {
  .search-wrap { height: 40px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 10px 6px; }
  .btn { padding: 10px 16px; font-size: var(--fs-sm); }
  .form__row { gap: var(--space-sm); }
  .modal__footer { flex-direction: column; }
  .modal__footer .btn { width: 100%; }
  .accordion-trigger { padding: var(--space-md); }
  .accordion-content { padding: 0 var(--space-md) var(--space-md); }
}

/* =========================================================================
   Print
   ========================================================================= */

@media print {
  .top-bar, .bottom-nav, .modal-backdrop, .toast-region, .alert-banner, .bg-blobs { display: none !important; }
  .app { height: auto; }
  .content { padding-top: 0; padding-bottom: 0; }
  .page-view { display: block !important; }
  body { background: white; color: black; }
  .glass, .table-wrap, .form, .accordion {
    background: white; backdrop-filter: none; -webkit-backdrop-filter: none; border-color: #ddd; color: black;
  }
  .page-title, .top-bar__title, .accordion-trigger, .modal__title { color: black; }
}

/* ── Home Header ── */
.home-header {
  padding: 14px 0 8px;
}
.home-header__title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.home-header__hint {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

/* ── Takeout inline button ── */
.btn-takeout-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(167,139,250,0.15);
  border: 1px solid rgba(167,139,250,0.35);
  color: #a78bfa;
  border-radius: 12px;
  padding: 5px 18px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, transform 0.1s;
}
.btn-takeout-inline:hover {
  background: rgba(167,139,250,0.28);
  transform: scale(1.04);
}
.btn-takeout-inline:active {
  transform: scale(0.97);
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
}
.kpi-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-card__icon--warning { background: rgba(255,159,10,0.18); color: #ff9f0a; }
.kpi-card__icon--success { background: rgba(48,209,88,0.18); color: #30d158; }
.kpi-card__icon--danger  { background: rgba(255,69,58,0.18); color: #ff453a; }
.kpi-card__icon--info    { background: rgba(10,132,255,0.18); color: #0a84ff; }
.kpi-card__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
  color: #fff;
}
.kpi-card__label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  white-space: nowrap;
}

/* ── Chart ── */
.chart-section {
  margin: 20px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 18px 20px;
}
.chart-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-section__title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}
.chart-tab-group {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 3px;
}
.chart-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.chart-tab.is-active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.chart-wrap {
  position: relative;
  height: 200px;
}

/* ── Page Transitions ── */
.page-view {
  animation: none;
}
.page-view.is-active {
  animation: pageSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── KPI card entrance ── */
.kpi-card {
  animation: kpiEntrance 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }
@keyframes kpiEntrance {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Table row fade-in ── */
#items-tbody tr {
  animation: rowFadeIn 0.3s ease both;
}
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Order mgmt card entrance ── */
.order-mgmt-card {
  animation: cardSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Theme Toggle Button
   ========================================================================= */

.btn-theme-toggle { position: relative; }

/* Dark mode: show sun, hide moon */
.btn-theme-toggle .icon-sun  { display: block; }
.btn-theme-toggle .icon-moon { display: none; }

/* Light mode: show moon, hide sun */
[data-theme="light"] .btn-theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-moon { display: block; }

/* =========================================================================
   Light / Day Mode — [data-theme="light"]
   ========================================================================= */

[data-theme="light"] {
  --color-bg-start: #f0f4ff;
  --color-bg-mid:   #e8eeff;
  --color-bg-end:   #dde6ff;

  --color-text:           rgba(10, 10, 30, 0.90);
  --color-text-secondary: rgba(10, 10, 30, 0.55);
  --color-text-tertiary:  rgba(10, 10, 30, 0.35);

  /* Glass tokens — light */
  --glass-bg:           rgba(255, 255, 255, 0.65);
  --glass-bg-medium:    rgba(255, 255, 255, 0.75);
  --glass-bg-heavy:     rgba(255, 255, 255, 0.88);
  --glass-border:       rgba(120, 130, 200, 0.22);
  --glass-border-light: rgba(120, 130, 200, 0.12);
  --glass-shadow:       0 8px 32px rgba(80, 90, 180, 0.14);
  --glass-shadow-sm:    0 4px 16px rgba(80, 90, 180, 0.10);
  --glass-inset:        inset 0 1px 0 rgba(255, 255, 255, 0.80);

  --card-gradient: linear-gradient(
    135deg,
    rgba(180, 160, 255, 0.18) 0%,
    rgba(140, 160, 255, 0.12) 40%,
    rgba(120, 200, 255, 0.10) 100%
  );
}

/* Background */
[data-theme="light"] .bg {
  background: linear-gradient(135deg, #dde6ff 0%, #e8eeff 30%, #f0f4ff 60%, #e4ecff 100%);
}

/* Blobs — soft pastel in light mode */
[data-theme="light"] .blob:nth-child(1) {
  background: radial-gradient(circle, rgba(160, 130, 255, 0.30), rgba(180, 160, 255, 0.10));
  opacity: 0.6;
}
[data-theme="light"] .blob:nth-child(2) {
  background: radial-gradient(circle, rgba(100, 160, 255, 0.25), rgba(140, 190, 255, 0.10));
  opacity: 0.5;
}
[data-theme="light"] .blob:nth-child(3) {
  background: radial-gradient(circle, rgba(140, 110, 240, 0.20), rgba(160, 130, 255, 0.08));
  opacity: 0.5;
}
[data-theme="light"] .blob:nth-child(4) {
  background: radial-gradient(circle, rgba(90, 140, 230, 0.20), rgba(110, 160, 240, 0.08));
  opacity: 0.4;
}

/* Glass panels */
[data-theme="light"] .glass {
  background: linear-gradient(135deg, rgba(255,255,255,0.70), rgba(230,235,255,0.55));
  border: 1px solid rgba(150, 160, 220, 0.25);
  box-shadow: 0 8px 32px rgba(80, 90, 180, 0.12), inset 0 1px 0 rgba(255,255,255,0.90);
}
[data-theme="light"] .glass:hover {
  box-shadow: 0 12px 40px rgba(80, 90, 180, 0.18), inset 0 1px 0 rgba(255,255,255,0.95);
}

/* Top-bar */
[data-theme="light"] .top-bar {
  background: rgba(240, 244, 255, 0.82);
  border-bottom: 1px solid rgba(150, 160, 220, 0.20);
}

/* Table */
[data-theme="light"] .table-wrap {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(150, 160, 220, 0.20);
}
[data-theme="light"] .table thead {
  background: linear-gradient(135deg, rgba(130, 110, 220, 0.14), rgba(90, 120, 210, 0.10));
  border-bottom: 1px solid rgba(150, 160, 220, 0.18);
}
[data-theme="light"] .table th {
  color: #2a1e6e;
}
[data-theme="light"] .table td {
  border-bottom: 1px solid rgba(150, 160, 220, 0.12);
  color: var(--color-text);
}
[data-theme="light"] .table tbody tr:hover {
  background: rgba(150, 160, 220, 0.08);
}

/* Row danger / warning — light mode needs stronger colors */
[data-theme="light"] .row--danger {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.12) 0%, rgba(220, 38, 38, 0.03) 100%);
  border-left: 4px solid #dc2626;
}
[data-theme="light"] .row--danger td {
  color: rgba(10, 10, 30, 0.85);
}
[data-theme="light"] .row--danger td:first-child {
  color: #b91c1c;
}
[data-theme="light"] .table tbody tr.row--warning {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.03) 100%);
  border-left: 5px solid #2563eb;
  box-shadow: inset 3px 0 12px rgba(37, 99, 235, 0.08);
}
[data-theme="light"] .table tbody tr.row--warning td {
  color: rgba(10, 10, 30, 0.85);
  border-bottom-color: rgba(37, 99, 235, 0.15);
}

/* Status badges — light mode */
[data-theme="light"] .badge--warning {
  background: rgba(180, 83, 9, 0.12);
  color: #92400e;
  border: 1px solid rgba(180, 83, 9, 0.30);
}
[data-theme="light"] .badge--danger {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}
[data-theme="light"] .badge--success,
[data-theme="light"] .badge--ok {
  background: rgba(21, 128, 61, 0.10);
  color: #15803d;
}
[data-theme="light"] .badge--info {
  background: rgba(29, 78, 216, 0.10);
  color: #1d4ed8;
}

/* 入庫ボタン — light mode */
[data-theme="light"] .btn--receive {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  border-color: rgba(21, 128, 61, 0.40);
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(21, 128, 61, 0.30);
}
[data-theme="light"] .btn--receive:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.40);
}

/* Stock badges — light mode: deeper, readable on white */
[data-theme="light"] .stock-badge--empty {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.35);
}
[data-theme="light"] .stock-badge--low {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.35);
}
[data-theme="light"] .stock-badge--ok {
  background: rgba(21, 128, 61, 0.10);
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.30);
}

/* Bottom nav */
[data-theme="light"] .gnav__list {
  background: rgba(235, 238, 255, 0.55);
  border: 1px solid rgba(150, 160, 220, 0.30);
  box-shadow: 0 8px 32px rgba(80, 90, 180, 0.14);
}
[data-theme="light"] .gnav__link {
  color: rgba(40, 40, 100, 0.50);
}
[data-theme="light"] .gnav__link:hover {
  color: rgba(40, 40, 100, 0.80);
}
[data-theme="light"] .gnav__li.is-active .gnav__link {
  color: #2a1e6e;
  text-shadow: none;
}
[data-theme="light"] .gnav__blob {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  opacity: 1;
}

/* Inputs and selects (.input, .select, .textarea are the actual class names) */
[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(150, 160, 220, 0.40);
  color: rgba(10, 10, 30, 0.90);
}
[data-theme="light"] .input:focus,
[data-theme="light"] .select:focus,
[data-theme="light"] .textarea:focus {
  border-color: rgba(120, 100, 230, 0.60);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 3px rgba(120, 100, 230, 0.12);
}
[data-theme="light"] .input::placeholder,
[data-theme="light"] .textarea::placeholder {
  color: rgba(40, 40, 100, 0.35);
}
[data-theme="light"] .select option {
  background: #f0f4ff;
  color: #1a1040;
}

/* Form panel */
[data-theme="light"] .form {
  background: rgba(255, 255, 255, 0.70);
  border-color: rgba(150, 160, 220, 0.22);
}
[data-theme="light"] .form__field label {
  color: rgba(10, 10, 30, 0.70);
}

/* Modals (class is .modal not .modal__panel) */
[data-theme="light"] .modal {
  background: rgba(235, 240, 255, 0.96);
  border: 1px solid rgba(150, 160, 220, 0.25);
  box-shadow: 0 24px 80px rgba(80, 90, 180, 0.20);
}
[data-theme="light"] .modal__title {
  color: rgba(10, 10, 30, 0.92);
}
[data-theme="light"] .modal-backdrop.is-open {
  background: rgba(60, 60, 120, 0.25);
}

/* Toasts */
[data-theme="light"] .toast {
  background: rgba(240, 244, 255, 0.96);
  border: 1px solid rgba(150, 160, 220, 0.30);
  color: rgba(10, 10, 30, 0.88);
}

/* Accordion */
[data-theme="light"] .accordion {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(150, 160, 220, 0.20);
}
[data-theme="light"] .accordion-trigger {
  color: rgba(10, 10, 30, 0.88);
}
[data-theme="light"] .accordion-body {
  color: rgba(10, 10, 30, 0.75);
}

/* Filter chips */
[data-theme="light"] .chip {
  background: rgba(150, 160, 220, 0.15);
  border-color: rgba(150, 160, 220, 0.30);
  color: rgba(40, 40, 100, 0.70);
}
[data-theme="light"] .chip.is-active {
  background: rgba(120, 100, 230, 0.18);
  border-color: rgba(120, 100, 230, 0.50);
  color: #3a28a0;
}
[data-theme="light"] .chip:hover {
  background: rgba(90, 140, 255, 0.12);
  border-color: rgba(90, 140, 255, 0.35);
  color: #2a3a90;
}

/* Buttons */
[data-theme="light"] .btn--ghost {
  color: rgba(40, 40, 100, 0.75);
  border-color: rgba(150, 160, 220, 0.35);
}
[data-theme="light"] .btn--ghost:hover {
  background: rgba(150, 160, 220, 0.18);
  color: rgba(40, 40, 100, 0.95);
}

/* Alert banner */
[data-theme="light"] .alert-banner {
  background: rgba(255, 150, 0, 0.10);
  border-bottom: 1px solid rgba(255, 150, 0, 0.25);
  color: #7a4000;
}

/* Search wrap (actual class is .search-wrap) */
[data-theme="light"] .search-wrap {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(150, 160, 220, 0.35);
  box-shadow: 0 2px 8px rgba(80, 90, 180, 0.08);
}
[data-theme="light"] .search-wrap:focus-within {
  border-color: rgba(120, 100, 230, 0.55);
  box-shadow: 0 0 0 3px rgba(120, 100, 230, 0.10), 0 4px 16px rgba(80, 90, 180, 0.10);
}
[data-theme="light"] .search-input {
  color: rgba(10, 10, 30, 0.90);
}
[data-theme="light"] .search-icon {
  color: rgba(40, 40, 100, 0.40);
}

/* Hero message title — must override background-clip gradient */
[data-theme="light"] .hero-message__title {
  background: linear-gradient(135deg, #2a1e6e 0%, #5a3aaa 50%, #3a6abf 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .hero-message__text {
  color: rgba(10, 10, 30, 0.55);
}

/* Ticker bar */
[data-theme="light"] .ticker-bar {
  background: linear-gradient(135deg,
    rgba(120, 80, 255, 0.10) 0%,
    rgba(0, 120, 220, 0.08) 40%,
    rgba(180, 80, 160, 0.07) 100%);
  border-color: rgba(150, 160, 220, 0.25);
  box-shadow: 0 4px 20px rgba(80, 90, 180, 0.08);
}
[data-theme="light"] .ticker-bar__icon {
  background: rgba(120, 80, 255, 0.15);
  color: rgba(80, 40, 180, 0.90);
}
[data-theme="light"] .ticker-text,
[data-theme="light"] .ticker-item,
[data-theme="light"] .ticker-bar__content {
  color: #2a1e6e !important;
  -webkit-text-fill-color: #2a1e6e !important;
}

/* Link cards */
[data-theme="light"] .link-card {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(150, 160, 220, 0.22);
  box-shadow: 0 4px 16px rgba(80, 90, 180, 0.10);
}
[data-theme="light"] .link-card:hover {
  box-shadow: 0 8px 24px rgba(80, 90, 180, 0.16);
}
[data-theme="light"] .link-card__name {
  color: rgba(10, 10, 30, 0.90);
}
[data-theme="light"] .link-card__url {
  color: rgba(10, 10, 30, 0.45);
}

/* Page title and section labels */
[data-theme="light"] .page-title {
  color: rgba(10, 10, 30, 0.90);
}
[data-theme="light"] .section-label {
  color: #3a28a0;
  font-weight: 800;
  border-bottom: 2px solid rgba(100, 80, 200, 0.18);
  padding-bottom: 6px;
}
[data-theme="light"] .sub-page-title {
  color: rgba(10, 10, 30, 0.88);
}
[data-theme="light"] .page-subtitle {
  color: rgba(10, 10, 30, 0.55);
}

/* Tab bar — tabs for history page */
[data-theme="light"] .tab-bar {
  background: rgba(150, 160, 220, 0.18);
  border: 1px solid rgba(150, 160, 220, 0.30);
}
[data-theme="light"] .tab-btn {
  color: rgba(40, 40, 100, 0.60);
}
[data-theme="light"] .tab-btn:hover {
  color: rgba(40, 40, 100, 0.85);
  background: rgba(120, 100, 220, 0.10);
}
[data-theme="light"] .tab-btn.is-active {
  background: rgba(255, 255, 255, 0.90);
  color: #2a1e6e;
  box-shadow: 0 2px 8px rgba(80, 90, 180, 0.15);
}

/* Takeout inline button */
[data-theme="light"] .btn-takeout-inline {
  background: rgba(100, 70, 200, 0.12);
  border: 1px solid rgba(100, 70, 200, 0.30);
  color: #4a28a0;
}
[data-theme="light"] .btn-takeout-inline:hover {
  background: rgba(100, 70, 200, 0.22);
  color: #3a1e90;
}

/* Receiving cards (入庫待ち / 入庫済み) */
[data-theme="light"] .recv-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(150, 160, 220, 0.30);
  box-shadow: 0 2px 8px rgba(80, 90, 180, 0.08);
}
[data-theme="light"] .recv-card__name {
  color: rgba(10, 10, 30, 0.90);
}
[data-theme="light"] .recv-card__detail {
  color: rgba(40, 40, 100, 0.55);
}
[data-theme="light"] .recv-card__qty-input {
  background: rgba(240, 243, 255, 0.95);
  border-color: rgba(150, 160, 220, 0.40);
  color: rgba(10, 10, 30, 0.90);
}
[data-theme="light"] .recv-card__qty {
  color: rgba(10, 10, 30, 0.88);
}
[data-theme="light"] .recv-card__qty-label {
  color: rgba(40, 40, 100, 0.50);
}

/* Accordion — clear visual separation between sections */
[data-theme="light"] .accordion {
  background: rgba(255, 255, 255, 0.78);
  border: 1.5px solid rgba(140, 150, 215, 0.30);
  box-shadow: 0 4px 16px rgba(80, 90, 180, 0.08);
}
[data-theme="light"] .accordion-item {
  border-bottom: 1px solid rgba(140, 150, 215, 0.22);
}
[data-theme="light"] .accordion-item:last-child {
  border-bottom: none;
}
[data-theme="light"] .accordion-trigger {
  color: rgba(10, 10, 30, 0.88);
  background: rgba(130, 110, 220, 0.05);
  font-weight: 700;
}
[data-theme="light"] .accordion-trigger:hover {
  background: rgba(130, 110, 220, 0.10);
}
[data-theme="light"] .accordion-item.is-open .accordion-trigger {
  background: rgba(130, 110, 220, 0.08);
  color: #2a1e6e;
}
[data-theme="light"] .accordion-content {
  background: rgba(245, 246, 255, 0.60);
}
[data-theme="light"] .accordion-icon {
  color: rgba(80, 60, 160, 0.60);
}

/* 申請管理カード — light mode */
[data-theme="light"] .order-mgmt-card {
  background: rgba(255, 255, 255, 0.80);
  border: 1px solid rgba(140, 150, 215, 0.30);
  box-shadow: 0 4px 16px rgba(80, 90, 180, 0.10);
}
[data-theme="light"] .order-mgmt-card__name {
  color: rgba(10, 10, 30, 0.90);
}
[data-theme="light"] .order-mgmt-card__meta,
[data-theme="light"] .order-mgmt-card__reason {
  color: rgba(40, 40, 100, 0.60);
}
[data-theme="light"] .reason-chip {
  color: #92400e;
  background: linear-gradient(135deg, rgba(180, 130, 0, 0.12), rgba(161, 98, 7, 0.08));
  border-color: rgba(161, 98, 7, 0.30);
  box-shadow: 0 4px 16px rgba(161, 98, 7, 0.08), inset 0 1px 0 rgba(255,255,255,0.5);
}
[data-theme="light"] .reason-chip:hover {
  background: linear-gradient(135deg, rgba(180, 130, 0, 0.20), rgba(161, 98, 7, 0.14));
  border-color: rgba(161, 98, 7, 0.50);
}
[data-theme="light"] .order-mgmt-card--rejected {
  background: rgba(240, 240, 250, 0.60);
  box-shadow: none;
}
[data-theme="light"] .order-mgmt-order-btn.btn {
  color: #fff;
}
[data-theme="light"] .order-mgmt-reject.btn {
  color: #fff;
}

/* Smooth theme transition */
*, *::before, *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.20s ease, box-shadow 0.25s ease;
}

/* Quick card icons — light mode vivid colors */
[data-theme="light"] #qcard-orders .quick-card__icon {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
}
[data-theme="light"] #qcard-notify .quick-card__icon {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.25);
  color: #dc2626;
}
[data-theme="light"] #qcard-prefs .quick-card__icon {
  background: rgba(109, 40, 217, 0.10);
  border-color: rgba(109, 40, 217, 0.25);
  color: #6d28d9;
}
[data-theme="light"] #qcard-export .quick-card__icon {
  background: rgba(21, 128, 61, 0.10);
  border-color: rgba(21, 128, 61, 0.25);
  color: #15803d;
}
