/* Flashnode Connect - app styles.

   Brand comes first, from centernode (frontend/src/index.css): the orange
   node mark, Flashnode orange (#FF941F) on centernode's OKLCH light/dark
   palette and Rubik, Flashnode's brand typeface. Apple's Human Interface Guidelines shape the rest: system
   text font at readable sizes, 44px touch targets, one accent colour with
   one meaning (orange = the action / the brand), soft layered surfaces
   instead of hard borders, a lightly blurred, mostly opaque nav bar, and
   motion that is brief and switched off under prefers-reduced-motion. */

/* Rubik (SIL OFL 1.1, fonts/Rubik-OFL.txt), self-hosted so no font
   request leaves the EU. Latin covers Finnish; latin-ext the rest. */
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/rubik-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/rubik-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;

  /* Spacing scale (4px base). Use these for new gaps, padding and margins. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.75rem;

  --background: oklch(0.985 0.002 286);
  --surface: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.141 0.005 285.823);
  --primary: #ff941f;
  --primary-hover: #f2830a;
  --primary-foreground: oklch(0.16 0.01 50);
  --primary-soft: rgb(255 148 31 / 12%);
  --primary-text: #b35c00;
  --secondary: oklch(0.955 0.002 286.375);
  --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.5 0.016 285.938);
  --accent: oklch(0.967 0.001 286.375);
  --accent-foreground: oklch(0.21 0.006 285.885);
  --destructive: oklch(0.52 0.22 27);
  --destructive-bg: oklch(0.577 0.245 27.325 / 8%);
  --success: oklch(0.46 0.13 150);
  --success-bg: oklch(0.6 0.14 150 / 11%);
  --border: oklch(0.92 0.004 286.32);
  --border-strong: oklch(0.87 0.006 286.32);
  --input: oklch(0.955 0.003 286.32);
  --ring: rgb(255 148 31 / 45%);
  --navbar-bg: oklch(0.99 0.002 286 / 92%);

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 286 / 6%);
  --shadow-md: 0 1px 2px oklch(0.2 0.01 286 / 5%), 0 8px 24px oklch(0.2 0.01 286 / 7%);
  --shadow-lg: 0 2px 6px oklch(0.2 0.01 286 / 6%), 0 24px 64px oklch(0.2 0.01 286 / 16%);

  --font-display: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-sans: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

:root[data-theme="dark"] {
  --background: oklch(0.141 0.005 285.823);
  --surface: oklch(0.18 0.006 285.885);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.19 0.006 285.885);
  --card-foreground: oklch(0.985 0 0);
  --primary: #ff941f;
  --primary-hover: #ffa640;
  --primary-foreground: oklch(0.16 0.01 50);
  --primary-soft: rgb(255 148 31 / 14%);
  --primary-text: #ffad5c;
  --secondary: oklch(0.26 0.006 286.033);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.23 0.006 286.033);
  --muted-foreground: oklch(0.72 0.015 286.067);
  --accent: oklch(0.274 0.006 286.033);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --destructive-bg: oklch(0.704 0.191 22.216 / 13%);
  --success: oklch(0.76 0.15 150);
  --success-bg: oklch(0.72 0.16 150 / 15%);
  --border: oklch(1 0 0 / 9%);
  --border-strong: oklch(1 0 0 / 16%);
  --input: oklch(1 0 0 / 7%);
  --ring: rgb(255 148 31 / 55%);
  --navbar-bg: oklch(0.15 0.006 285.885 / 92%);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 30%);
  --shadow-md: 0 1px 2px oklch(0 0 0 / 30%), 0 8px 24px oklch(0 0 0 / 30%);
  --shadow-lg: 0 2px 6px oklch(0 0 0 / 30%), 0 24px 64px oklch(0 0 0 / 50%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: oklch(0.141 0.005 285.823);
    --surface: oklch(0.18 0.006 285.885);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.19 0.006 285.885);
    --card-foreground: oklch(0.985 0 0);
    --primary: #ff941f;
    --primary-hover: #ffa640;
    --primary-foreground: oklch(0.16 0.01 50);
    --primary-soft: rgb(255 148 31 / 14%);
    --primary-text: #ffad5c;
    --secondary: oklch(0.26 0.006 286.033);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.23 0.006 286.033);
    --muted-foreground: oklch(0.72 0.015 286.067);
    --accent: oklch(0.274 0.006 286.033);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --destructive-bg: oklch(0.704 0.191 22.216 / 13%);
    --success: oklch(0.76 0.15 150);
    --success-bg: oklch(0.72 0.16 150 / 15%);
    --border: oklch(1 0 0 / 9%);
    --border-strong: oklch(1 0 0 / 16%);
    --input: oklch(1 0 0 / 7%);
    --ring: rgb(255 148 31 / 55%);
    --navbar-bg: oklch(0.15 0.006 285.885 / 92%);
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 30%);
    --shadow-md: 0 1px 2px oklch(0 0 0 / 30%), 0 8px 24px oklch(0 0 0 / 30%);
    --shadow-lg: 0 2px 6px oklch(0 0 0 / 30%), 0 24px 64px oklch(0 0 0 / 50%);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--foreground);
}

h1 {
  font-size: clamp(28px, 3.2vw, 36px);
  margin: 0 0 8px;
}

h2 {
  font-size: 21px;
  margin: 0 0 12px;
}

h3 {
  font-size: 17px;
  margin: 0 0 6px;
}

p {
  margin: 0 0 16px;
  color: var(--muted-foreground);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 28px;
  flex: none;
}

.brand-product {
  color: var(--muted-foreground);
  font-weight: 500;
}

/* ---------- App shell ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--navbar-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.navbar-brand {
  flex: none;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 14px;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-tab:hover {
  color: var(--foreground);
  background: var(--secondary);
  text-decoration: none;
}

.nav-tab[aria-current="page"] {
  color: var(--foreground);
  background: var(--secondary);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.navbar-right form {
  margin: 0;
}

.navbar-user {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-right: 4px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.theme-toggle:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon,
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

.theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

/* Language switch (EN / FI) */

.locale-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--secondary);
}

.locale-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.locale-switch a:hover {
  color: var(--foreground);
  text-decoration: none;
}

.locale-switch a[aria-current="true"] {
  background: var(--surface);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-narrow {
  max-width: 460px;
}

.page-wide {
  max-width: 1160px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-header p {
  margin: 0;
  max-width: 640px;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-text);
  margin-bottom: 6px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 44px 0 16px;
}

.section-title h2 {
  margin: 0;
}

/* ---------- Surfaces ---------- */

.panel {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.panel > :last-child {
  margin-bottom: 0;
}

/* ---------- Forms ---------- */

.form-group {
  display: block;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 13px;
  color: var(--foreground);
}

.form-group input,
.form-group select,
.form-group textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  padding: 10px 14px;
  font: 400 15px/1.4 var(--font-sans);
  color: var(--foreground);
  background: var(--input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.15s var(--ease);
}

.form-group textarea {
  min-height: 160px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 12px;
  color: var(--foreground);
}

.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Toggle row (write access) */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin: 0 0 20px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  transition: opacity 0.15s var(--ease);
}

.toggle-row-saving {
  opacity: 0.6;
}

.toggle-row-error {
  box-shadow: inset 0 0 0 1px var(--destructive);
}

.toggle-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-row-label {
  font-weight: 600;
  font-size: 14px;
}

.toggle-row-hint {
  font-size: 13px;
  color: var(--muted-foreground);
}

.toggle-switch {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.toggle-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background-color 0.2s var(--ease);
}

.toggle-switch-track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px oklch(0 0 0 / 20%);
  transition: transform 0.2s var(--ease);
}

.toggle-switch input:checked + .toggle-switch-track {
  background: var(--success);
}

.toggle-switch input:checked + .toggle-switch-track::before {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-switch-track {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* Per-endpoint allow / don't allow */

.endpoint-access {
  margin: 0 0 20px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  transition: opacity 0.15s var(--ease);
}

.endpoint-access-saving {
  opacity: 0.6;
}

.endpoint-access-error {
  box-shadow: inset 0 0 0 1px var(--destructive);
}

.endpoint-access-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.endpoint-access-summary::-webkit-details-marker {
  display: none;
}

.endpoint-access-summary .badge {
  flex: none;
}

.endpoint-access-bulk {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
}

.endpoint-group {
  margin: 0 16px;
  border-top: 1px solid var(--border);
}

.endpoint-group:last-child {
  margin-bottom: 8px;
}

.endpoint-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.endpoint-group-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.endpoint-group-toggle:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.endpoint-group-chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  transition: transform 0.15s var(--ease);
}

.endpoint-group-toggle[aria-expanded="true"] .endpoint-group-chevron {
  transform: rotate(90deg);
}

.endpoint-group-count {
  flex: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.endpoint-list {
  list-style: none;
  margin: 0 0 8px 24px;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}

.endpoint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.endpoint-row code {
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.endpoint-choice {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.endpoint-choice button {
  padding: 4px 10px;
  border: 0;
  background: var(--surface);
  color: var(--muted-foreground);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.endpoint-choice button + button {
  border-left: 1px solid var(--border-strong);
}

.endpoint-choice-allow[aria-pressed="true"] {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
}

.endpoint-choice-block[aria-pressed="true"] {
  background: var(--destructive-bg);
  color: var(--destructive);
  font-weight: 600;
}

.endpoint-choice button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: -3px;
}

/* Spreadsheet sheets (Google Sheets, Excel, Airtable) */

.sheets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 0 20px;
  border-radius: var(--radius-lg);
  background: var(--muted);
}

.sheets-share {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.copy-field-sm code {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sheets-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted-foreground);
}

.sheet-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sheet-row {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  transition: opacity 0.15s var(--ease);
}

.sheet-row.endpoint-access-error {
  box-shadow: inset 0 0 0 1px var(--destructive);
}

.sheet-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sheet-name {
  font-weight: 600;
  font-size: 14px;
}

.sheet-description,
.sheet-meta {
  font-size: 13px;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.sheet-edit summary {
  margin-top: 6px;
  font-size: 13px;
  color: var(--primary-text);
  cursor: pointer;
}

.sheet-edit form {
  margin-top: 10px;
}

.sheet-edit-actions {
  margin-bottom: 10px;
}

.sheet-add > summary {
  list-style: none;
  display: inline-flex;
  cursor: pointer;
}

.sheet-add > summary::-webkit-details-marker {
  display: none;
}

.sheet-add form {
  margin-top: 12px;
}

.sheet-access {
  border: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.sheet-access legend {
  padding: 0;
  margin-bottom: 6px;
}

.sheet-access label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 14px;
  white-space: nowrap;
}

/* Undo the text-box styling .form-group gives every input. */
.sheet-access input[type="radio"] {
  display: inline-block;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--primary);
}

.sheets .form-group textarea {
  min-height: 72px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  font: 600 15px/1 var(--font-sans);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 1px 2px oklch(0.5 0.2 45 / 25%);
}

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

.btn-default {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

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

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--secondary);
}

.btn-danger {
  background: transparent;
  color: var(--destructive);
}

.btn-danger:hover {
  background: var(--destructive-bg);
}

.btn-sm {
  min-height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-lg {
  min-height: 52px;
  padding: 0 28px;
  font-size: 17px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- Alerts & badges ---------- */

.alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
}

.alert-status {
  background: var(--success-bg);
  color: var(--success);
}

.alert-errors {
  background: var(--destructive-bg);
  color: var(--destructive);
}

.alert-errors ul {
  margin: 0;
  padding-left: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--secondary);
  color: var(--muted-foreground);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.badge-connected {
  background: var(--success-bg);
  color: var(--success);
}

.badge-connected::before {
  opacity: 1;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: var(--secondary);
  color: var(--muted-foreground);
}

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  vertical-align: middle;
}

th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}

tbody tr + tr td {
  border-top: 1px solid var(--border);
}

/* Admin: one tbody per company, headed by its name. */
.company-row th {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--foreground);
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
}

.admin-search {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-search input {
  min-width: 260px;
  min-height: 40px;
  padding: 8px 14px;
  font: 400 14px/1.4 var(--font-sans);
  color: var(--foreground);
  background: var(--input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}

.admin-search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.admin-header-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-search select {
  min-height: 36px;
  padding: 6px 10px;
  font: 400 14px/1.4 var(--font-sans);
  color: var(--foreground);
  background: var(--input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}

.details-table th {
  width: 220px;
  border-bottom: 0;
}

.tag-danger {
  background: var(--destructive-bg);
  color: var(--destructive);
}

.invite-link {
  margin-bottom: 20px;
}

.invite-link .copy-field code {
  word-break: break-all;
}

.company-row th .stat-pill {
  font-size: 13px;
  font-weight: 400;
}

td .btn + form,
td .btn + .btn {
  margin-left: 6px;
}

/* ---------- Dashboard: connect Claude card ---------- */

.connect-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  margin-bottom: 36px;
  border-radius: var(--radius-2xl);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--primary-soft) 0%, transparent 60%),
    var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.connect-card h2 {
  margin-bottom: 4px;
}

.connect-card p {
  margin: 0;
}

.connect-steps {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.assistant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 4px;
}

.assistant-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-foreground);
  font: 500 14px/1 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.assistant-tab:hover {
  color: var(--foreground);
}

.assistant-tab[aria-selected="true"] {
  color: var(--foreground);
  border-color: var(--foreground);
  font-weight: 600;
}

.assistant-tab i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}

.copy-field code {
  font-size: 14px;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-pill {
  font-size: 14px;
  color: var(--muted-foreground);
}

.stat-pill strong {
  color: var(--foreground);
}

/* ---------- Dashboard: system grid ---------- */

.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.system-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  text-align: left;
  font: inherit;
  color: var(--card-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.system-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.system-card:active {
  transform: translateY(0) scale(0.99);
}

.system-card-connected {
  border-color: oklch(0.6 0.14 150 / 35%);
}

.system-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.system-card-meta {
  font-size: 13px;
  color: var(--muted-foreground);
}

.system-card .badge {
  align-self: flex-start;
  margin-top: 6px;
}

.system-card-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  flex: none;
}

.system-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
  box-shadow: inset 0 -2px 0 oklch(0 0 0 / 12%);
}

.system-icon-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 14px;
}

.system-icon-xs {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 11px;
}

.system-icon-light {
  box-shadow: inset 0 0 0 1px var(--border);
}

.system-icon-logo {
  width: 56%;
  height: 56%;
  object-fit: contain;
}

.system-group {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
}

.system-group:first-of-type {
  margin-top: 32px;
}

.system-group-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-xl);
  user-select: none;
  transition: background-color 0.15s var(--ease);
}

.system-group-summary::-webkit-details-marker {
  display: none;
}

.system-group-summary:hover {
  background: var(--accent);
}

.system-group-summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.system-group-icons {
  display: inline-flex;
  flex: none;
}

.system-group-icons .system-icon + .system-icon {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--card);
}

.system-group-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.system-group-label {
  font-weight: 600;
  font-size: 16px;
}

.system-group-systems {
  font-size: 13px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-group-summary .badge {
  flex: none;
}

.system-group-chevron {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted-foreground);
  transition: transform 0.2s var(--ease);
}

.system-group[open] > .system-group-summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.system-group[open] .system-group-chevron {
  transform: rotate(180deg);
}

.system-group > .system-grid {
  padding: 16px 20px 20px;
}

@media (max-width: 480px) {
  .system-group-summary {
    padding: 14px 16px;
    gap: 10px;
  }

  .system-group-summary .badge {
    display: none;
  }

  .system-group > .system-grid {
    padding: 12px 12px 12px;
  }
}

.system-label {
  font-weight: 600;
  font-size: 16px;
}

/* ---------- Modal (sheet) ---------- */

.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}

.modal[open] {
  animation: sheet-in 0.25s var(--ease);
}

.modal::backdrop {
  background: oklch(0.1 0.01 286 / 35%);
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal form[method="dialog"] {
  margin: 0;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--muted-foreground);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--foreground);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 44px 8px 0;
  font-size: 22px;
}

.modal-wide {
  width: min(720px, calc(100vw - 32px));
}

.modal-lead {
  margin: 0 44px 20px 0;
  font-size: 14px;
  color: var(--muted-foreground);
}

.modal textarea {
  resize: vertical;
}

.modal-connected-since {
  font-size: 14px;
  margin-bottom: 20px;
}

.modal-subtitle {
  margin: 20px 0 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--foreground);
}

.modal-instructions {
  margin: 0 0 22px;
  padding: 16px 16px 16px 36px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 14px;
}

.modal-instructions li + li {
  margin-top: 6px;
}

.modal-disconnect {
  margin: 12px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal .btn-primary {
  width: 100%;
}

/* ---------- Skills ---------- */

.skills-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.skills-sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.skills-sidebar-title {
  font-size: 17px;
  margin-bottom: 6px;
}

.base-skill-group {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.base-skill-group + .base-skill-group {
  margin-top: 8px;
}

.base-skill-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-lg);
  user-select: none;
}

.base-skill-group-title::-webkit-details-marker {
  display: none;
}

.base-skill-group-title:hover {
  background: var(--accent);
}

.base-skill-group-title:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.base-skill-section-title {
  margin: 22px 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.base-skill-group-icons {
  display: inline-flex;
  flex-shrink: 0;
}

.base-skill-group-icons .system-icon + .system-icon {
  margin-left: -5px;
  box-shadow: 0 0 0 2px var(--card);
}

.base-skill-group-label {
  flex: 1;
  min-width: 0;
}

.base-skill-group-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.base-skill-group-chevron {
  flex-shrink: 0;
  color: var(--muted-foreground);
  transition: transform 0.15s var(--ease);
}

.base-skill-group[open] > .base-skill-group-title .base-skill-group-chevron {
  transform: rotate(180deg);
}

.base-skill-group[open] > .base-skill-group-title {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.base-skill-list {
  padding: 0 12px;
  border-top: 1px solid var(--border);
}

.base-skill-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.base-skill-list .base-skill-item:first-child {
  border-top: none;
}

.base-skill-item.is-added .base-skill-name,
.base-skill-item.is-added .base-skill-description {
  opacity: 0.5;
}

.base-skill-item .btn:disabled {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.base-skill-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

.base-skill-description {
  display: block;
  font-size: 13px;
  color: var(--muted-foreground);
}

.empty-state {
  text-align: center;
  padding: 44px 24px;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.empty-state p {
  max-width: 420px;
  margin: 0 auto 20px;
}

/* ---------- Auth (login / reset) ---------- */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  color: #fff;
  background:
    radial-gradient(90% 70% at 85% 10%, rgb(255 148 31 / 55%) 0%, transparent 60%),
    radial-gradient(80% 80% at 0% 100%, rgb(240 120 0 / 45%) 0%, transparent 60%),
    oklch(0.17 0.01 285);
}

.auth-aside .brand {
  color: #fff;
}

.auth-aside .brand-product {
  color: oklch(1 0 0 / 60%);
}

.auth-aside h2 {
  color: #fff;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.08;
  max-width: 440px;
  margin: 0 0 14px;
}

.auth-aside p {
  color: oklch(1 0 0 / 92%);
  max-width: 420px;
  font-size: 17px;
}

.auth-aside-mark {
  position: absolute;
  right: -60px;
  bottom: -40px;
  width: 360px;
  opacity: 0.12;
  pointer-events: none;
}

.auth-aside-footer {
  font-size: 13px;
  color: oklch(1 0 0 / 55%);
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--surface);
  position: relative;
}

.auth-tools {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-card h1 {
  font-size: 32px;
  margin-bottom: 6px;
}

.auth-card > p {
  margin-bottom: 28px;
}

.auth-card .btn-primary {
  width: 100%;
  margin-top: 4px;
}

.auth-links {
  margin-top: 24px;
  font-size: 14px;
  text-align: center;
}

/* ---------- Files ---------- */

.files-overview {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.file-usage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4) var(--space-6);
}

.file-usage-item {
  display: grid;
  gap: var(--space-2);
}

.file-usage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.file-usage-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.file-usage-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.file-usage-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--secondary);
}

.file-usage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--muted-foreground);
}

.file-usage-bar.is-full span {
  background: var(--destructive);
}

.files-full {
  margin: 0;
  color: var(--destructive);
  font-size: 14px;
}

.files-privacy {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.5;
}

.files-privacy svg {
  flex: none;
  margin-top: 1px;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.file-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-4);
  padding: var(--space-5);
}

.file-item + .file-item {
  border-top: 1px solid var(--border);
}

.file-format {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--secondary);
  color: var(--muted-foreground);
}

.file-format span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.file-main {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.file-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.file-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.file-meta > span + span::before {
  content: "\00B7";
  margin-right: var(--space-2);
}

.file-main > .muted {
  margin: 0;
}

.file-error {
  margin: 0;
  color: var(--destructive);
  font-size: 14px;
}

.file-label {
  justify-self: start;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.file-description {
  display: -webkit-box;
  max-width: 75ch;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.file-description.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

/* .btn sets display, which would otherwise beat the hidden attribute. */
.file-more[hidden] {
  display: none;
}

.file-more {
  justify-self: start;
  margin-left: calc(-1 * var(--space-3));
  color: var(--primary-text);
}

/* Upload is switched off while the plan's allowance is used up. */
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.file-actions form {
  display: inline-flex;
}

/* ---------- Responsive ---------- */

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

  .skills-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    padding: 28px 24px;
    min-height: 0;
  }

  .auth-aside h2 {
    font-size: 26px;
  }

  .auth-aside-mark {
    width: 200px;
  }

  .auth-aside-footer {
    display: none;
  }

  .connect-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .navbar-inner {
    gap: 12px;
    padding: 0 16px;
  }

  .brand-product,
  .navbar-user {
    display: none;
  }

  .nav-tab {
    padding: 0 10px;
  }

  .page {
    padding: 28px 16px 64px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel {
    padding: 20px;
  }

  .connect-card {
    padding: 20px;
  }

  .skills-table th:nth-child(2),
  .skills-table td:nth-child(2) {
    display: none;
  }

  .file-item {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: var(--space-4);
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .file-meta-uploaded {
    flex-basis: 100%;
  }

  .file-meta-uploaded::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .navbar-inner {
    gap: 8px;
  }

  /* Three or four tabs (Finnish names are long) don't fit next to Log out:
     the tabs scroll sideways instead of pushing the page wider. */
  .nav-tabs {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: none;
    padding: 0 var(--space-2);
  }

  .navbar .brand-name {
    display: none;
  }

  .navbar-right {
    gap: 2px;
  }

  /* Phones: the switch shows only the language you can switch to. */
  .locale-switch {
    background: transparent;
  }

  .locale-switch a[aria-current="true"] {
    display: none;
  }

  .navbar .theme-toggle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Admin: company page ---------- */

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 8px 0 20px;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.admin-stat strong {
  font-size: 18px;
}

.admin-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.admin-tabs {
  margin: 0 0 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.muted {
  color: var(--muted-foreground);
  font-size: 13px;
}

.admin-table {
  width: 100%;
}

.admin-table td,
.admin-table th {
  vertical-align: top;
}

.admin-nowrap {
  white-space: nowrap;
}

.danger-zone {
  border-color: var(--destructive);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
}

.admin-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.admin-form-grid input[type="text"],
.admin-form-grid input[type="date"] {
  min-height: 40px;
  padding: 8px 12px;
  font: 400 14px/1.4 var(--font-sans);
  color: var(--foreground);
  background: var(--input);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}

/* Dropdown: native select, restyled, with a chevron that follows the text colour. */
.select-wrap {
  position: relative;
  display: inline-block;
  min-width: 220px;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted-foreground);
  border-bottom: 2px solid var(--muted-foreground);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 40px;
  padding: 8px 40px 8px 14px;
  font: 500 14px/1.4 var(--font-sans);
  color: var(--foreground);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.select:hover:not(:disabled) {
  border-color: var(--foreground);
}

.select:focus-visible {
  outline: none;
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--foreground) 15%, transparent);
}

.select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.select option {
  background: var(--card);
  color: var(--foreground);
}

/* One quiet line under a skill's name: plain text, no boxes. */
.skill-notes {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

/* More air in the skills list: taller rows, and a name column wide enough
   that a short name and its note don't wrap into each other. */
.skills-table td {
  padding-top: 20px;
  padding-bottom: 20px;
  vertical-align: middle;
}

.skills-table td:first-child {
  min-width: 190px;
  padding-right: 24px;
}
