@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* Make the `hidden` attribute always win, regardless of a later
   display:flex/grid rule on the same element (used widely to toggle
   panels, settings fields, dock groups). */
[hidden] {
  display: none !important;
}

/* Inline SVG icons default to display:inline, which leaves baseline/
   descender whitespace around them and makes them look mis-aligned or
   "floating" next to text in a flex row. Forcing block layout fixes it
   everywhere at once. */
svg {
  display: block;
}

/* Brand tokens pulled from scale.dualacquisition.com's own design system:
   near-black surfaces, a lime-green accent (with a near-black "ink" color
   used for text/icons drawn ON TOP of the accent), generous rounding. */
:root {
  --bg-app: #050505;
  --bg-sidebar: #0d0d0f;
  --bg-card: #0d0d0f;
  --border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #9ba0a6;
  --accent: #b4ff3c;
  --accent-dim: #8fd62b;
  --accent-ink: #0a0a0a;
  --bad: #ff5c4d;
  --radius: 14px;
  --sidebar-width: 240px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Surface layer — one place to retint every panel / input / menu so the
     Studio surface can go light (html[data-surface="studio"]) without
     touching the Workflow canvas. Dark defaults == the old hard-coded hexes,
     so Workflow renders pixel-identical. */
  --panel-bg: #111116;        /* settings panel, asset library, modals */
  --node-surface: #17171b;    /* node card, wf-modal box */
  --sunken: #101014;          /* inputs, textareas, progress track */
  --raised: #1b1b22;          /* selects, chips, secondary buttons, dock inner */
  --raised-hover: #1e1e25;
  --chip-bg: #1e1e26;
  --menu-bg: #17171a;         /* shared context menus */
  --menu-bg-wf: #17171d;      /* workflow add-node menu */
  --menu-hover: #24242c;
  --topbar-bg: #0d0d10;
  --dock-bg: #131316;
  --composer-bg: #131317;
  --row-hover: #1a1a20;
  --row-active: rgba(255, 255, 255, 0.14);
  --tab-track: rgba(255, 255, 255, 0.045);
  --tab-active: rgba(255, 255, 255, 0.11);
  --hover-wash: rgba(255, 255, 255, 0.06);
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-panel: 0 16px 40px rgba(0, 0, 0, 0.5);
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sidebar workspace chip — identical on the dashboard and the in-canvas
   sidebar, so both pages read as the same product. */
.sidebar-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.account-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}

/* Sidebar shows just the centred logo — the workspace name is hidden. */
.account-name { display: none; }

.account-chip:hover {
  background: var(--hover-wash);
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}

.account-logo {
  height: 26px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
}

.icon-btn:hover {
  background: var(--hover-wash);
}

.icon-btn.small {
  width: 20px;
  height: 20px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent);
  border: none;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
}

.pill-btn:hover {
  background: var(--accent-dim);
}

/* Simple modal, shared by dashboard "New project" / "New folder" prompts */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  width: 320px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.modal-box h2 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal-box input[type="text"] {
  width: 100%;
  padding: 9px 10px;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions button {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
}

.modal-actions .btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.modal-actions .btn-secondary {
  background: var(--menu-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* ---- Studio / Workflow view tabs (sidebar, both pages) ---- */
.view-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--tab-track);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.view-tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 6px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.view-tab:hover {
  color: var(--text-primary);
  background: var(--hover-wash);
}

.view-tab.active {
  background: var(--tab-active);
  color: var(--text-primary);
}

.view-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ---- Right-click context menu (projects: rename / move to folder / delete) ---- */
.ctx-menu {
  position: fixed;
  z-index: 600;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 190px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.ctx-menu[hidden] {
  display: none;
}

.ctx-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-primary);
  text-align: left;
}

.ctx-menu-item:hover {
  background: var(--hover-wash);
}

.ctx-menu-item.danger {
  color: #ff6b5e;
}

.ctx-submenu {
  position: absolute;
  left: 100%;
  top: -6px;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 160px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.ctx-submenu[hidden] {
  display: none;
}

.ctx-submenu button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-primary);
  text-align: left;
}

.ctx-submenu button:hover {
  background: var(--hover-wash);
}

/* Account dropdown off the sidebar logo chip (uses .ctx-menu base) */
.account-menu { min-width: 190px; }
.account-menu-head {
  padding: 7px 10px 8px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
