/*
 * EastPrnt OMPS — polish layer.
 * Loaded AFTER app.css (the untouched live stylesheet). Same layout, colors and
 * workflow; refined type, surfaces, depth and motion. Delete this file to get
 * the exact live look back.
 */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --border: #e6e8ee;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .08);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --dur-fast: 140ms;
  --dur: 240ms;
  --dur-slow: 420ms;
}

body {
  font-family: var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  background: #f4f6fa;
  letter-spacing: -0.005em;
}
.page-title { letter-spacing: -0.02em; }
::selection { background: rgba(59, 130, 246, .2); }

/* ---------- Surfaces ---------- */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
/* status tint replaces the thick side stripe */
.stat-card::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--primary); opacity: .9;
}
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.danger::after  { background: var(--danger); }
.stat-card[style*="ea580c"]::after { background: #ea580c; }
.stat-card[onclick]:hover, .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-value { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.table-wrap { border-radius: var(--radius); }
th { background: #f8f9fc; }
tbody tr { transition: background-color var(--dur-fast) ease; }
tbody tr:hover td { background: #f8faff; }

.badge { letter-spacing: .02em; text-transform: none; font-weight: 600; }

/* ---------- Controls ---------- */
.btn {
  border-radius: var(--radius-sm);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) ease,
              background-color var(--dur-fast) ease, filter var(--dur-fast) ease;
  will-change: transform;
}
.btn:hover:not(:disabled) { filter: brightness(1.05); box-shadow: var(--shadow); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); box-shadow: none; }
.btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--primary-light); outline-offset: 2px;
}
input, select, textarea {
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}

/* ---------- Sidebar ---------- */
.sidebar { background: #0f1422; }
.nav-item {
  margin: 2px 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border-left: 0;
  position: relative;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.nav-item:hover { background: rgba(255, 255, 255, .06); transform: translateX(2px); }
.nav-item.active { background: rgba(59, 130, 246, .16); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--primary-light);
  animation: omps-grow-y var(--dur) var(--ease-out);
}

/* ---------- Tabs ---------- */
.tab { transition: color var(--dur-fast) ease, border-color var(--dur) var(--ease-out); }
.tab:hover { color: var(--gray-900); }

/* ---------- Kanban ---------- */
.kanban-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kanban-card:active { transform: translateY(0) scale(.99); }

/* ---------- Modal ---------- */
.modal { background: rgba(15, 20, 34, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal.active { animation: omps-fade var(--dur) ease both; }
.modal.active .modal-content { animation: omps-pop var(--dur-slow) var(--ease-spring) both; }
.modal-content { border-radius: 16px; box-shadow: var(--shadow-lg); }

/* ---------- Toasts & notifications ---------- */
.toast {
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: omps-toast-in var(--dur-slow) var(--ease-spring) both;
}
.notif-panel { box-shadow: var(--shadow-lg); }
.notif-item { transition: background-color var(--dur-fast) ease; }

/* ---------- Login ---------- */
.login-card {
  border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .45);
  animation: omps-rise var(--dur-slow) var(--ease-out) both;
}

/* ---------- Page transitions (class added by motion.js on navigation) ---------- */
.main.omps-enter > * { animation: omps-rise var(--dur-slow) var(--ease-out) both; }
.main.omps-enter > *:nth-child(2) { animation-delay: 40ms; }
.main.omps-enter > *:nth-child(3) { animation-delay: 80ms; }
.main.omps-enter > *:nth-child(4) { animation-delay: 120ms; }
.main.omps-enter > *:nth-child(n+5) { animation-delay: 160ms; }
.main.omps-enter .stats-grid > * { animation: omps-rise var(--dur-slow) var(--ease-out) both; }
.main.omps-enter .stats-grid > *:nth-child(2) { animation-delay: 60ms; }
.main.omps-enter .stats-grid > *:nth-child(3) { animation-delay: 110ms; }
.main.omps-enter .stats-grid > *:nth-child(4) { animation-delay: 160ms; }
.main.omps-enter .stats-grid > *:nth-child(n+5) { animation-delay: 200ms; }
.main.omps-enter .kanban-card { animation: omps-rise var(--dur) var(--ease-out) both; }

/* number count-up target (motion.js) */
.omps-count { display: inline-block; }

/* ---------- Keyframes ---------- */
@keyframes omps-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes omps-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes omps-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes omps-toast-in { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes omps-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}

/* ── Production Board: readable "NN% complete" label (pill over the bar) ── */
.prod-progress-text {
  inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 1px 10px; border-radius: 999px; line-height: 16px;
  background: rgba(255, 255, 255, .94); color: var(--gray-800, #1f2937);
  text-shadow: none; box-shadow: 0 1px 3px rgba(16, 24, 40, .18);
  font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none;
}

/* ── Secretary Queue: section status labels as shining pills (no blinking) ── */
.sq-urgent-label {
  position: relative; overflow: hidden; display: inline-flex; align-items: center;
  margin-left: 8px; padding: 3px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; line-height: 1.3;
  color: #fff !important; background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 2px 8px rgba(220, 38, 38, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: none !important; opacity: 1 !important; transform: none !important;
}
.sq-urgent-label--ok {
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 2px 8px rgba(22, 163, 74, .32), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.sq-urgent-label::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 50%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: omps-pill-shine 2.8s ease-in-out infinite;
}
@keyframes omps-pill-shine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .sq-urgent-label::after { display: none; } }

/* ── Boot loader: real 0–100% progress, current step, rotating messages (boot-progress.js) ── */
#bootLoader { transition: opacity .4s ease; }
#bootLoader.omps-bl-done { opacity: 0; pointer-events: none; }
.omps-bl { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; width: min(320px, calc(100vw - 32px)); }
.omps-bl-row { width: 100%; display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.omps-bl-pct { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.omps-bl-track { width: 100%; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.omps-bl-fill { position: relative; height: 100%; width: 0; border-radius: 999px; background: #fff; overflow: hidden; transition: width .3s var(--omps-ease, ease); }
.omps-bl-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(59, 130, 246, .45) 50%, transparent 65%); animation: omps-bl-shine 1.4s linear infinite; }
@keyframes omps-bl-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.omps-bl-step { font-size: 12px; opacity: .8; min-height: 16px; }
.omps-bl-msg { min-height: 44px; margin-top: 6px; text-align: center; font-size: 14px; line-height: 1.5; transition: opacity .3s ease, transform .3s ease; }
.omps-bl-msg.out { opacity: 0; transform: translateY(6px); }
@media (prefers-reduced-motion: reduce) { .omps-bl-fill::after { display: none; } .omps-bl-msg.out { transform: none; } }

/* ── Login screen: shining logo, greeting, rotating fun line (login-fun.js) ── */
.omps-logo-shine { position: relative; display: block; margin: 0 auto 10px; line-height: 0; }
.omps-logo-shine::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .85) 48%, rgba(255, 255, 255, .85) 52%, transparent 70%);
  background-size: 250% 100%; background-repeat: no-repeat; background-position: 150% 0;
  -webkit-mask: var(--omps-logo) center / 100% 100% no-repeat; mask: var(--omps-logo) center / 100% 100% no-repeat;
  animation: omps-logo-shine 3.6s ease-in-out infinite;
}
@keyframes omps-logo-shine { 0% { background-position: 150% 0; } 45%, 100% { background-position: -60% 0; } }
.omps-login-greet { font-weight: 600; color: var(--gray-800, #1f2937); }
.omps-login-fun { text-align: center; font-size: 13px; color: var(--primary, #1e40af); margin: -4px 0 16px; min-height: 20px; transition: opacity .3s ease, transform .3s ease; }
.omps-login-fun.out { opacity: 0; transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) { .omps-logo-shine::after { animation: none; opacity: 0; } .omps-login-fun.out { transform: none; } }

/* ── Production Board: Refresh board button (board-refresh.js) ── */
.omps-board-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.omps-refresh-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 1px solid var(--gray-300, #d1d5db); border-radius: 8px; background: #fff;
  color: var(--primary, #1e40af); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .12s var(--omps-ease, ease), background-color .15s ease, color .15s ease, border-color .15s ease;
}
.omps-refresh-btn:hover:not(:disabled) { background: #eff6ff; }
.omps-refresh-btn:active:not(:disabled) { transform: scale(.97); }
.omps-refresh-ico { display: inline-block; font-size: 17px; line-height: 1; }
.omps-refresh-btn.spin { color: var(--gray-500, #6b7280); cursor: wait; }
.omps-refresh-btn.spin .omps-refresh-ico { animation: omps-spin .8s linear infinite; }
.omps-refresh-btn.ok { color: #15803d; border-color: #86efac; background: #f0fdf4; }
@keyframes omps-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .omps-refresh-btn.spin .omps-refresh-ico { animation: none; } }
