:root {
  --bg-color: #0b0f19;
  --card-bg: #151d2f;
  --card-border: #232e48;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.2s ease-in-out;
  --font-family: 'Plus Jakarta Sans', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  line-height: 1.6;
  padding: 1rem;
}

.app-container {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

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

.btn-token-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #3b82f6;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-token-toggle:hover {
  background: #2563eb;
  color: white;
  transform: translateY(-1px);
}

.dot-success {
  background: #10b981 !important;
  box-shadow: 0 0 8px #10b981;
}

.dot-danger {
  background: #ef4444 !important;
  box-shadow: 0 0 8px #ef4444;
}

.btn-install {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-target {
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
}

.badge-target a {
  color: inherit;
  text-decoration: none;
}

.badge-target a:hover {
  text-decoration: underline;
}

.dot {
  width: 7px;
  height: 7px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

/* Toast */
.toast {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  animation: slideDown 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.toast.success {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.toast.error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.toast.info {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title h2, .card-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-icon {
  font-size: 1.2rem;
}

/* Status Indicators */
.status-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator-badge.saved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.status-indicator-badge.saved .status-circle {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.status-indicator-badge.not-saved {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.status-indicator-badge.not-saved .status-circle {
  background: #ef4444;
}

/* Meta rows */
.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #1e293b;
  font-size: 0.875rem;
}

.meta-label {
  color: var(--text-muted);
}

.meta-val {
  font-weight: 500;
}

/* Token Preview Box */
.token-preview-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  overflow: hidden;
}

.token-preview-box code {
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.85rem;
  word-break: break-all;
  max-height: 80px;
  overflow-y: auto;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem 1rem;
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

.btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
}

.btn-secondary:hover {
  background: #334155;
}

.btn-accent {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
}

.btn-icon:hover {
  color: white;
  background: #1e293b;
}

.btn-block {
  width: 100%;
}

.btn-large {
  padding: 0.85rem 1.6rem;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.minimal-action-group {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.action-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.action-btn-group .btn {
  flex: 1;
  min-width: 140px;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}

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

.form-tools {
  display: flex;
  gap: 0.75rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-link.text-muted {
  color: var(--text-muted);
}

textarea, input[type="text"] {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--card-border);
  color: white;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

textarea {
  resize: vertical;
  min-height: 110px;
  font-family: monospace;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-helper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge-pill {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* JWT Payload Collapse */
.jwt-preview-collapse {
  background: #0a0e17;
  border: 1px dashed #2d3b55;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.jwt-preview-header {
  font-size: 0.82rem;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 0.4rem;
}

.jwt-payload-pre {
  color: #94a3b8;
  font-size: 0.78rem;
  font-family: monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 150px;
}

/* Result Card */
.test-status-row {
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.test-details-pre {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.82rem;
  color: #94a3b8;
  max-height: 200px;
  overflow-y: auto;
}

/* Storage Info Card */
.storage-info-card {
  background: rgba(15, 23, 42, 0.5);
  border-style: dashed;
}

.storage-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.storage-list {
  list-style: none;
  padding-left: 0;
  font-size: 0.85rem;
}

.storage-list li {
  margin-bottom: 0.4rem;
  color: #cbd5e1;
}

.storage-list code {
  background: #1e293b;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: #38bdf8;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer code {
  color: #38bdf8;
}

/* Products Card & Form */
.section-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.form-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.checkbox-row {
  margin-bottom: 1.25rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: #cbd5e1;
  cursor: pointer;
}

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

/* Products Result Stats Bar */
.products-results {
  margin-top: 1.5rem;
  border-top: 1px solid var(--card-border);
  padding-top: 1.5rem;
}

.result-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-pill {
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-label {
  color: var(--text-muted);
}

.stat-status-badge {
  font-weight: 700;
  color: #38bdf8;
}

.table-search-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-search-row input {
  flex: 1;
}

.raw-json-box {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: #94a3b8;
  max-height: 350px;
  overflow: auto;
  white-space: pre-wrap;
  margin-bottom: 1rem;
}

/* Table Wrapper */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  max-height: 480px;
  overflow-y: auto;
}

.products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.products-table th {
  background: #0f172a;
  position: sticky;
  top: 0;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #94a3b8;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
  z-index: 2;
}

.products-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
  vertical-align: middle;
}

.products-table tr:hover {
  background: rgba(30, 41, 59, 0.4);
}

.product-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #1e293b;
  border: 1px solid #334155;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.sku-code-badge {
  font-family: monospace;
  background: #1e293b;
  color: #38bdf8;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.product-price {
  font-weight: 700;
  color: #34d399;
}

/* Main Hero Card */
.main-hero-card {
  border: 1px solid #2563eb55;
  background: linear-gradient(180deg, #151d2f 0%, #0f172a 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.section-desc-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.cache-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  animation: fadeIn 0.3s ease-out;
}

.cache-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.main-token-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.main-token-banner:hover {
  border-color: #3b82f6;
  background: #1e293b;
}

.btn-hero {
  padding: 0.95rem 1.8rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  letter-spacing: -0.01em;
}

.btn-hero:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

.main-action-group {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

/* ============================================== */
/* Modal Popup Styles */
/* ============================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

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

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 10;
}

.modal-close-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.modal-body {
  padding: 1.5rem;
}

.token-status-wrapper {
  margin-bottom: 1.25rem;
}

.status-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.status-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
}

.modal-token-actions {
  margin-top: 1rem;
}

.modal-divider {
  border: 0;
  border-top: 1px solid var(--card-border);
  margin: 1.5rem 0;
}

.test-result-box {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
}

.test-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 0.5rem;
}

.modal-lg {
  max-width: 1080px;
  width: 96%;
  height: 90vh;
}

.modal-header-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Button Disabled States */
button:disabled, .btn:disabled, .btn-disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.5);
}

/* Spinner Animation */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

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

/* Real-time Progress Bar */
.fetch-progress-container {
  width: 100%;
  margin-top: 0.5rem;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  animation: fadeIn 0.2s ease-out;
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 0.45rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Minimal Hero Card */
.minimal-hero-card {
  padding: 1.5rem 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Minimal Dataset Switcher */
.dataset-switcher {
  display: inline-flex;
  background: #0f172a;
  padding: 0.3rem;
  border-radius: var(--radius-md);
  border: 1px solid #1e293b;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  max-width: 100%;
  overflow-x: auto;
}

.btn-dataset {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-dataset:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.btn-dataset.active {
  background: #1e293b;
  color: #38bdf8;
  border-color: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.minimal-action-buttons {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0;
}

.minimal-action-buttons .btn {
  padding: 0.75rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  letter-spacing: -0.01em;
}

/* Minimal Cache Status */
.minimal-cache-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.7);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-top: 0.25rem;
  transition: var(--transition);
}

.minimal-cache-status .cache-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Delivery Detail View */
.detail-wrapper {
  animation: fadeIn 0.2s ease-out;
}

.delivery-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.meta-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.meta-card .meta-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.meta-card .meta-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f1f5f9;
}

.detail-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.95rem;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  flex-wrap: wrap;
}

.timeline-step-badge {
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.timeline-time {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.timeline-admin {
  color: #94a3b8;
  margin-left: auto;
  font-size: 0.8rem;
}

.btn-detail-action {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.btn-detail-action:hover {
  background: #0284c7;
  color: white;
}

.detail-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.detail-export-btns {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.detail-export-btns .btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Delivery Items Scroll Container */
.delivery-items-scroll {
  scrollbar-width: thin;
  scrollbar-color: #334155 #0f172a;
}

.delivery-items-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.delivery-items-scroll::-webkit-scrollbar-track {
  background: #0f172a;
  border-radius: 4px;
}

.delivery-items-scroll::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.delivery-items-scroll::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

.delivery-items-scroll tfoot {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

/* Mobile responsive */
@media (max-width: 640px) {
  body {
    padding: 0.5rem;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .action-btn-group {
    flex-direction: column;
  }
  .action-btn-group .btn {
    width: 100%;
  }
}
