/* ==========================================================================
   EOS prototype · Shared theme (copied from EOS_WMS_Toolkit engine/prototype/shared/css/theme.css)
   Fluent-style flat UI, soft neutrals, VS Code-like chrome, EOS blue accent.
   ========================================================================== */

:root {
  /* surfaces */
  --bg:          #F3F5F8;
  --surface:     #FFFFFF;
  --surface-2:   #F8F9FB;
  --surface-3:   #EEF1F5;
  --sidebar:     #F7F8FA;
  --activity:    #E9EDF2;
  --hover:       #EDF1F6;
  --selected:    #E3EEF9;
  --border:      #E1E6ED;
  --border-2:    #D3DAE3;

  /* text */
  --text:        #243140;
  --text-2:      #4B5868;
  --muted:       #7A8594;
  --faint:       #A5AEB9;

  /* brand */
  --accent:      #0A74C9;   /* EOS blue */
  --accent-2:    #1A9BE0;   /* EOS cyan */
  --accent-soft: #E6F1FB;
  --accent-ink:  #FFFFFF;
  --statusbar:   #0A74C9;

  /* semantic */
  --ok:        #2E9E6B;  --ok-soft:     #E4F4EC;
  --warn:      #C98A16;  --warn-soft:   #FBF1DC;
  --danger:    #D1495B;  --danger-soft: #FBE6E9;
  --info:      #2B8FA6;  --info-soft:   #E1F2F6;
  --violet:    #7E6BC9;  --violet-soft: #EEEAFA;
  --neutral-soft: #EEF1F5;

  /* icon tints (explorer-style colored flat icons) */
  --ic-blue:   #3B82C4;
  --ic-green:  #2E9E7A;
  --ic-orange: #D08A2E;
  --ic-pink:   #C2557A;
  --ic-violet: #8A6FD1;
  --ic-teal:   #2B8FA6;
  --ic-slate:  #6B7A8C;

  /* type & shape */
  --font: "Nunito Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;
  --fs:   13.5px;
  --r-sm: 4px;
  --r:    6px;
  --r-lg: 10px;
  --shadow-1: 0 1px 2px rgba(20, 38, 64, .06);
  --shadow-2: 0 6px 20px rgba(20, 38, 64, .10);
  --shadow-3: 0 16px 48px rgba(20, 38, 64, .18);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:          #1B1F25;
  --surface:     #22272E;
  --surface-2:   #262C34;
  --surface-3:   #2D343D;
  --sidebar:     #20252C;
  --activity:    #181C21;
  --hover:       #2B323B;
  --selected:    #1E3A57;
  --border:      #333B45;
  --border-2:    #3E4753;
  --text:        #DDE3EA;
  --text-2:      #B5BFCA;
  --muted:       #8B96A3;
  --faint:       #66707C;
  --accent:      #3D9BE9;
  --accent-2:    #4FB6EE;
  --accent-soft: #1C3550;
  --statusbar:   #0B5FA5;
  --ok:     #4CC08A;  --ok-soft:     #183A2B;
  --warn:   #E0A93B;  --warn-soft:   #3A2F17;
  --danger: #EC6A7B;  --danger-soft: #3F2027;
  --info:   #4DB3CB;  --info-soft:   #173741;
  --violet: #A594E8;  --violet-soft: #2E2849;
  --neutral-soft: #2D343D;
  --ic-blue: #5EA1E0; --ic-green: #4CBF99; --ic-orange: #E4A552; --ic-pink: #E07B9D;
  --ic-violet: #A993EC; --ic-teal: #4DB3CB; --ic-slate: #93A2B3;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3);
  --shadow-2: 0 6px 20px rgba(0,0,0,.35);
  --shadow-3: 0 16px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--fs)/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* icons */
.ic { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.ic-lg { width: 20px; height: 20px; }
.ic-xl { width: 24px; height: 24px; }

/* ---------- shared primitives ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  border-radius: var(--r); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: var(--r);
  background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px;
  font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--neutral-soft); color: var(--text-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.ok     { background: var(--ok-soft);     color: var(--ok); }
.pill.warn   { background: var(--warn-soft);   color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info   { background: var(--info-soft);   color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.pill.plain::before { display: none; }

.input, .select {
  height: 32px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--r);
  background: var(--surface); color: var(--text); min-width: 0;
}
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { height: auto; padding: 8px 10px; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r); padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 24px; padding: 0 10px; border-radius: 4px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 5px;
}
.seg button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }

.toast-host { position: fixed; right: 16px; bottom: 36px; display: grid; gap: 8px; z-index: 1000; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; min-width: 280px; max-width: 380px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r); box-shadow: var(--shadow-2); animation: toast-in .18s ease-out;
}
.toast.ok { border-left-color: var(--ok); } .toast.warn { border-left-color: var(--warn); } .toast.danger { border-left-color: var(--danger); }
.toast b { display: block; font-size: 13px; }
.toast small { color: var(--muted); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
