/* Delfos design tokens (react_delfos_backoffice: src/utils/DynamicStyles.ts, appShell.css). */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/vendor/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/poppins-latin-600-normal.woff2") format("woff2"); }

:root {
  --primary: #263C7A;
  --primary-50: #253b791a;
  --primary-100: #D6E2F8;
  --primary-200: #AFC5F1;
  --primary-300: #7E9AD7;
  --primary-600: #1B2D68;
  --primary-700: #132157;
  --primary-800: #194AB4;
  --primary-900: #070F3A;
  --tertiary: #07153A;
  --secondary: #66B6FF;
  --secondary-50: #66B6FF1a;
  --secondary-100: #E0F6FF;
  --secondary-300: #A3DCFF;
  --secondary-600: #4A8EDB;
  --secondary-700: #336AB7;
  --secondary-900: #13337A;
  --bg-surface-0: #FFFFFF;
  --bg-surface-1: #FDFDFD;
  --bg-surface-2: #E7E9F0;
  --bg-page: #F8FAFC;
  --border: #EAEAEA;
  --text-dark: #131519;
  --text-medium: #6C6C6C;
  --text-disabled: #B5B5B5;
  --text-white: #FAFBFC;
  --grey-50: #9e9e9e1a;
  --grey-100: #f5f5f5;
  --grey-200: #eeeeee;
  --grey-300: #e0e0e0;
  --grey-400: #bdbdbd;
  --grey-600: #757575;
  --grey-900: #212121;
  --red-dark: #D00416; --red-medium: #FB3748; --red-light: #fb37481a;
  --green-dark: #107434; --green-medium: #1AB752; --green-light: #1AB7521a;
  --yellow-dark: #723B13; --yellow-medium: #E3A008; --yellow-light: #E3A0081a;
  --radius: .5rem;
  --radius-card: 20px;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, .063);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: .875rem;
  line-height: 1.5;
  color: var(--text-dark);
  background: var(--bg-page);
  position: relative;
  overflow-x: hidden;
}
/* Cowork background: flat colour plus two blurred blobs. */
body::before, body::after {
  content: ""; position: fixed; width: 26rem; height: 26rem; border-radius: 50%; pointer-events: none; z-index: -1;
}
body::before { right: -6rem; top: -5rem; background: #DCEBFF; opacity: .9; filter: blur(110px); }
body::after { left: -5rem; bottom: -5rem; background: #DFF7FF; opacity: .95; filter: blur(120px); }

h1, h2, h3, h4 { margin: 0; color: var(--grey-900); line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--secondary-700); text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: .8125rem; }
code { background: var(--grey-100); border-radius: .25rem; padding: .05rem .35rem; color: var(--primary-600); overflow-wrap: anywhere; }
td code { white-space: nowrap; overflow-wrap: normal; }
pre { margin: 0; padding: 1rem; background: var(--tertiary); color: #e0e7ff; border-radius: var(--radius); overflow-x: auto; }
pre code { background: none; padding: 0; color: inherit; word-break: normal; }
small { font-size: .75rem; }
.muted { color: var(--text-medium); }
.icon { width: 1rem; height: 1rem; flex: none; vertical-align: -.15em; }

/* Header (appShell.css .app-header) */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 30px;
  height: 64px; padding: 0 24px;
  background: var(--bg-surface-0); border-bottom: 1px solid var(--border);
}
.app-logo { display: flex; align-items: center; }
.app-logo img { height: 40px; width: auto; display: block; }
.app-nav { display: flex; align-items: center; gap: 8px; flex: 1; }
.nav-link {
  position: relative; padding: 6px 10px; font-size: .8125rem; font-weight: 400; letter-spacing: .01em;
  color: var(--text-dark); opacity: .65; transition: opacity .2s; text-decoration: none;
}
.nav-link::after {
  content: ""; position: absolute; bottom: -4px; left: 50%; width: 0; height: 2px; background: currentColor; border-radius: 1px;
  transition: width .25s cubic-bezier(.4, 0, .2, 1), left .25s cubic-bezier(.4, 0, .2, 1);
}
.nav-link:hover { opacity: 1; color: var(--text-dark); text-decoration: none; }
.nav-link:hover::after { width: 60%; left: 20%; }
.nav-link.active { opacity: 1; font-weight: 500; }
.nav-link.active::after { width: 100%; left: 0; }
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary .icon { width: 14px; height: 14px; }
.nav-menu-items {
  position: absolute; left: 0; top: calc(100% + 10px); min-width: 220px; padding: .5rem; display: grid; gap: 2px;
  background: var(--bg-surface-0); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 2px 2px 8px -2px #9e9e9e29;
}
.nav-menu-items a { padding: .5rem .75rem; border-radius: .5rem; font-size: .8125rem; color: var(--text-dark); text-decoration: none; }
.nav-menu-items a:hover, .nav-menu-items a:focus-visible { background: var(--grey-50); outline: none; }
.nav-menu-items a[aria-current="page"] { font-weight: 500; color: var(--primary); }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: .35rem; padding: 0 .3rem; border-radius: 9999px; font-size: .65rem; font-weight: 600; background: var(--primary); color: #fff; }
.notice-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .8125rem; }
.app-header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.app-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px;
  background: var(--bg-surface-2); color: var(--text-medium); font-size: .75rem; font-weight: 500;
}

/* User menu (UserDropdown.tsx) */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.user-menu > summary::-webkit-details-marker { display: none; }
.avatar {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: var(--text-white); font-size: .75rem; font-weight: 500; user-select: none;
}
.user-menu > summary:hover .avatar, .user-menu > summary:focus-visible .avatar, .user-menu[open] .avatar { outline: 4px solid var(--primary-200); }
.user-menu > summary:focus-visible { outline: none; }
.menu-user {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 300px; padding: 1.25rem 1.25rem 1rem;
  background: var(--bg-surface-0); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 2px 2px 8px -2px #9e9e9e29;
}
.menu-user-head { display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: .75rem; }
.menu-user-head strong { display: block; font-size: .875rem; font-weight: 500; }
.menu-user-head small { color: var(--text-medium); word-break: break-all; display: block; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; }
.menu-row-label { display: inline-flex; align-items: center; gap: .5rem; }
.lang-switch { display: inline-flex; gap: 4px; padding: 3px; background: var(--bg-surface-1); border: 1px solid var(--border); border-radius: var(--radius); margin: 0; }
.lang-switch button {
  height: 28px; padding: 0 12px; border: 1px solid transparent; border-radius: .375rem; background: transparent;
  font: inherit; font-size: .75rem; font-weight: 500; color: var(--text-medium); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--bg-surface-0); border-color: var(--border); color: var(--primary-600); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.menu-user form.logout { margin: .5rem 0 0; }
.menu-user form.logout .btn { width: 100%; }
/* Tenant selector: same look as components/ui/Select.tsx of the Delfos backoffice; each option submits the form. */
.tenant-switch { margin: 0; min-width: 170px; }
.fselect { position: relative; }
.fselect > summary { list-style: none; }
.fselect > summary::-webkit-details-marker { display: none; }
.forminput {
  display: flex; height: 40px; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 1rem;
  border: 1px solid var(--border); background-color: var(--bg-surface-0); border-radius: .5rem; font-size: .875rem; color: var(--grey-900); cursor: pointer;
}
.forminput > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(.75rem + .1vw); color: var(--text-dark); }
.forminput .icon { width: 20px; height: 20px; transition: transform .15s ease-in-out; color: var(--text-dark); }
.fselect[open] > .forminput .icon { transform: rotate(180deg); }
.forminput-down {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; width: 100%; max-height: 16rem; overflow-y: auto;
  border: 1px solid var(--border); background-color: var(--bg-surface-0); border-radius: .5rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
}
.forminput-down-item {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem 1rem;
  border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer;
}
.forminput-down-item span { font-size: .75rem; font-weight: 400; color: var(--text-dark); }
.forminput-down-item:hover, .forminput-down-item:focus-visible { background: var(--grey-50); outline: none; }
.forminput-down-item[aria-selected="true"] { background: var(--secondary-50); }
.forminput-down-item[aria-selected="true"] span { font-weight: 700; }
.forminput-down-item .icon { color: var(--secondary-600); }

/* Layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head p { margin: .25rem 0 0; color: var(--text-medium); max-width: 46rem; }
.page-head .brand-title { color: var(--secondary); }
.breadcrumb { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .8125rem; color: var(--text-medium); }
.breadcrumb a { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-medium); }
.breadcrumb a:hover { color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* Cards */
.card { background: var(--bg-surface-0); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { display: inline-flex; align-items: center; gap: .5rem; }
.card-head p { margin: .15rem 0 0; color: var(--text-medium); font-size: .8125rem; }
.card-body { padding: 1.25rem; }
.card-body > :last-child { margin-bottom: 0; }
.card-table { overflow-x: auto; }
.card.danger { border-color: #fb374840; }
.card.danger .card-head h3 { color: var(--red-dark); }

/* Navy banner (SetupBanner of the backoffice) */
.banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: var(--radius); flex-wrap: wrap;
  background: linear-gradient(90deg, var(--primary-900), var(--secondary-900)); border: 1px solid #263c7a40; color: #e0e0e0;
}
.banner-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 9999px; font-size: 11px; font-weight: 500;
  background: #263c7a26; color: var(--secondary);
}
.banner code { background: transparent; color: var(--text-white); font-size: .875rem; padding: 0; }
.banner .btn-ghost-light { color: var(--secondary); }

/* Buttons (DynamicStyles BOTONES) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.5rem; padding: .5rem 1rem;
  border: 1px solid transparent; border-radius: var(--radius); font: inherit; font-size: .875rem; font-weight: 400; line-height: 1;
  white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .2s linear, color .2s linear, border-color .2s linear;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; }
.btn-sm { height: 2rem; padding: .5rem .75rem; }
.btn-xs { height: 1.5rem; padding: .25rem .5rem; border-radius: .25rem; font-size: .75rem; gap: .35rem; }
.btn-xs .icon { width: .75rem; height: .75rem; }
.btn-icon { width: 2rem; height: 2rem; padding: 0; }
.btn-icon.btn-xs { width: 1.75rem; height: 1.75rem; padding: 0; border-radius: .375rem; }
.btn-icon.btn-xs .icon { width: .9rem; height: .9rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--text-white); }
.btn-primary:hover { background: var(--primary-700); border-color: var(--primary-700); color: var(--text-white); }
.btn-primary:active, .btn-primary:focus-visible { background: var(--primary-800); border-color: var(--primary-800); outline: 2px solid var(--primary-100); }
.btn-primary:disabled { background: var(--primary-300); border-color: var(--primary-300); color: var(--primary-100); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-50); border-color: var(--primary-700); color: var(--primary-700); }
.btn-outline:active, .btn-outline:focus-visible { background: var(--primary-100); border-color: var(--primary-800); color: var(--primary-800); outline: none; }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--text-white); }
.btn-secondary:hover { background: var(--secondary-600); border-color: var(--secondary-600); color: var(--text-white); }
.btn-secondary:active, .btn-secondary:focus-visible { background: var(--secondary-700); border-color: var(--secondary-700); outline: 2px solid var(--secondary-100); }
.btn-grey { background: var(--grey-100); border-color: var(--grey-100); color: var(--text-dark); }
.btn-grey:hover { background: var(--grey-300); border-color: var(--grey-300); color: var(--text-dark); }
.btn-grey:active, .btn-grey:focus-visible { background: var(--grey-300); outline: 2px solid var(--grey-200); }
.btn-grey-outline { background: transparent; border-color: var(--grey-400); color: var(--grey-900); }
.btn-grey-outline:hover { background: var(--grey-50); border-color: var(--grey-600); color: var(--grey-900); }
.btn-danger { background: transparent; border-color: var(--red-medium); color: var(--red-dark); }
.btn-danger:hover { background: var(--red-medium); border-color: var(--red-medium); color: #fff; }
.btn-danger:disabled { background: transparent; border-color: var(--grey-300); color: var(--text-disabled); }
.btn-transparent { background: transparent; color: var(--text-dark); }
.btn-transparent:hover { background: var(--grey-100); color: var(--text-dark); }
.btn-group { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
[aria-busy="true"] { cursor: progress; opacity: .7; }

/* Forms (DynamicStyles INPUT) */
form { margin: 0; }
.form-grid { display: grid; gap: 1rem; }
label, .label { display: flex; flex-direction: column; gap: .25rem; font-size: .75rem; font-weight: 600; color: var(--text-dark); }
label small.error { font-weight: 400; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; height: 40px; padding: .5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface-0); color: var(--grey-900); font: inherit; font-size: .875rem; font-weight: 400;
  transition: border-color .15s, outline-color .15s;
}
textarea { height: auto; min-height: 80px; padding: .75rem 1rem; line-height: 1.5em; resize: vertical; }
select { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236C6C6C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }
input:focus, select:focus, textarea:focus { outline: 4px solid var(--secondary-50); border-color: var(--secondary); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red-dark); outline: 4px solid var(--red-light); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-surface-1); color: var(--text-disabled); }
::placeholder { color: var(--text-medium); font-style: italic; opacity: 1; }
fieldset { margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); display: grid; gap: 1rem; }
fieldset.plain { border: 0; padding: 0; }
legend { padding: 0 .35rem; font-size: .75rem; font-weight: 600; color: var(--text-medium); text-transform: uppercase; letter-spacing: .05em; }
.hint { margin: 0; font-size: .75rem; font-weight: 400; color: var(--text-medium); }
.inline-form { display: flex; gap: .5rem; align-items: flex-start; }
.inline-form input { flex: 1; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* Switch (Switch.tsx) */
.switch { flex-direction: row; align-items: center; gap: .75rem; font-size: .875rem; font-weight: 500; cursor: pointer; width: fit-content; }
.switch input { appearance: none; position: relative; width: 40px; height: 24px; margin: 0; border: 2px solid var(--grey-400); border-radius: 9999px; background: transparent; cursor: pointer; transition: background-color .2s, border-color .2s; }
.switch input::after { content: ""; position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--grey-400); border: 2px solid #fff; box-sizing: border-box; transition: transform .2s, background-color .2s; }
.switch input:checked { background: var(--secondary-600); border-color: var(--secondary-600); }
.switch input:checked::after { transform: translateX(16px); background: #fff; border-color: var(--secondary-600); }
.switch input:focus-visible { outline: 4px solid var(--secondary-50); }
/* Same look as a button (role="switch"), so hx-confirm can cancel without leaving it toggled. */
span.switch { display: inline-flex; cursor: default; }
.switch-toggle { appearance: none; position: relative; flex-shrink: 0; width: 40px; height: 24px; margin: 0; padding: 0; border: 2px solid var(--grey-400); border-radius: 9999px; background: transparent; cursor: pointer; transition: background-color .2s, border-color .2s; }
.switch-toggle::after { content: ""; position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--grey-400); border: 2px solid #fff; box-sizing: border-box; transition: transform .2s, background-color .2s; }
.switch-toggle[aria-checked="true"] { background: var(--secondary-600); border-color: var(--secondary-600); }
.switch-toggle[aria-checked="true"]::after { transform: translateX(16px); background: #fff; border-color: var(--secondary-600); }
.switch-toggle:focus-visible { outline: 4px solid var(--secondary-50); }
.switch-toggle:disabled { opacity: .45; cursor: not-allowed; }

/* Disclosure ("New connection", "Advanced options") */
details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); }
details.disclosure > summary {
  display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; cursor: pointer; list-style: none; font-weight: 500; color: var(--primary);
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon:last-child { margin-left: auto; transition: transform .2s; color: var(--text-medium); }
details.disclosure[open] > summary .icon:last-child { transform: rotate(180deg); }
details.disclosure > .disclosure-body { padding: 0 1rem 1rem; display: grid; gap: 1rem; }

/* Tables (DynamicStyles TABLA) */
table { width: 100%; border-collapse: collapse; }
th, td { font-size: .75rem; font-weight: 400; color: var(--text-dark); text-align: left; vertical-align: middle; }
thead { background: var(--bg-surface-1); border-bottom: 1px solid var(--border); }
thead th { color: var(--text-medium); padding: .5rem .75rem; height: 2rem; line-height: 1.2; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background-color .2s linear; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--grey-50); }
tbody td { padding: .6rem .75rem; white-space: nowrap; }
tbody td.wrap { white-space: normal; min-width: 10rem; }
tbody td.date { white-space: normal; min-width: 5.5rem; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn-group { justify-content: flex-end; flex-wrap: nowrap; }
td a code { color: var(--primary); }
td .muted { font-size: .7rem; }
tr.editing:hover { background: transparent; }
tr.editing td { padding: 1rem 1.25rem; background: var(--bg-surface-1); }

/* Status chips (chip-s / StatusView.tsx) */
.status { display: inline-flex; align-items: center; gap: .35rem; height: 24px; padding: 0 .6rem; border-radius: 9999px; font-size: .7rem; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.outcome-ok { background: var(--green-light); color: var(--green-dark); }
.outcome-error { background: var(--red-light); color: var(--red-dark); }
.outcome-denied { background: var(--yellow-light); color: var(--yellow-dark); }
.status-active { background: var(--green-light); color: var(--green-dark); }
.status-idle { background: var(--grey-50); color: var(--grey-600); }
.status-warning { background: var(--yellow-light); color: var(--yellow-dark); }
.status-error { background: var(--red-light); color: var(--red-dark); }

/* Charts (server-side SVG) */
.spark { display: grid; gap: .35rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); }
.spark-head { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-medium); }
.spark-head strong { color: var(--text-dark); font-size: .875rem; }
.spark-svg { width: 100%; height: 64px; }
.chart-axis { display: flex; justify-content: space-between; font-size: .6875rem; color: var(--text-medium); }
.inline-form select { flex: 0 1 18rem; }
.rate-form { flex-wrap: wrap; }
.inline-form .kind-key { flex: 0 0 10rem; align-self: center; }
.rate-form input[name=model] { flex: 2 1 14rem; }
.rate-form select { flex: 0 1 9rem; }
.rate-form input[type=date] { flex: 0 1 10rem; }
.rate-form input[type=number] { flex: 1 1 7rem; min-width: 7rem; }
.card-table td label { font-weight: 400; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filters label { flex: 0 1 12rem; }
.log-table td { vertical-align: top; }
.log-data { display: block; margin-top: .25rem; font-size: .6875rem; color: var(--text-medium); white-space: pre-wrap; word-break: break-word; background: transparent; padding: 0; }
.page-head h1 .status { vertical-align: middle; margin-left: .5rem; }
.band-chart { height: 160px; }
.spark-line { stroke: var(--primary); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.band-area { fill: #66B6FF33; }
.band-expected { stroke: #66B6FF; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.legend { display: inline-block; width: 12px; height: 3px; margin-right: .3rem; vertical-align: middle; }
.legend-actual { background: var(--primary); }
.legend-expected { background: #66B6FF; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; }
.kpi { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); }
.kpi span { display: block; font-size: .75rem; color: var(--text-medium); }
.kpi strong { font-size: 1.25rem; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 .55rem; border-radius: 9999px; font-size: .7rem; font-weight: 500; background: var(--primary-50); color: var(--primary); white-space: nowrap; }
.chip-grey { background: var(--grey-50); color: var(--grey-600); }
.count { display: inline-flex; align-items: center; justify-content: center; height: 18px; min-width: 18px; padding: 0 5px; border-radius: 9999px; background: var(--primary); color: #fff; font-size: .65rem; font-weight: 500; }

/* Messages (snackbar) */
.ok, .error, .warning { font-size: .8125rem; }
p.ok, p.error, p.warning, div.ok, div.error, div.warning {
  display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 1rem; padding: .6rem 1rem; border-radius: var(--radius); border: 1px solid;
}
p.ok, div.ok { background: var(--green-light); border-color: var(--green-medium); color: var(--green-dark); }
p.error, div.error { background: var(--red-light); border-color: var(--red-medium); color: var(--red-dark); }
p.warning, div.warning { background: var(--yellow-light); border-color: var(--yellow-medium); color: var(--yellow-dark); }
p.ok .icon, p.error .icon, p.warning .icon { margin-top: .15rem; }
small.error, span.error { color: var(--red-dark); }
[aria-live]:empty { display: none; }
[aria-live] > :last-child { margin-bottom: 0; }

/* Empty state (KnowledgeEmptyState.tsx) */
.empty { display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: 2.5rem 1rem; text-align: center; }
.empty img { width: 96px; height: 96px; }
.empty h3 { font-size: 1.125rem; }
.empty p { margin: 0; color: var(--text-medium); max-width: 28rem; }
td.empty-cell { padding: 0; }
td.empty-cell:hover, tr:has(td.empty-cell):hover { background: transparent; }
.empty-row { padding: 1.25rem; text-align: center; color: var(--text-medium); font-style: italic; }

/* Definition list */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--text-medium); font-size: .8125rem; }
.kv dd { margin: 0; font-size: .8125rem; word-break: break-word; }

/* Detail pages */
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-head h1 code { font-size: .875rem; vertical-align: middle; }
div.message { flex-direction: row; }
div.message > div { display: grid; gap: .5rem; min-width: 0; }
div.message pre { font-size: .75rem; }

/* Tokens */
.key-cell { display: inline-flex; gap: .5rem; align-items: center; }
.key-value { user-select: all; word-break: break-all; }
.created-key { display: grid; gap: .5rem; padding: 1rem; border: 1px solid var(--green-medium); border-radius: var(--radius); background: var(--green-light); color: var(--green-dark); }
.created-key p { margin: 0; }
.created-key .key-cell code { background: var(--bg-surface-0); color: var(--text-dark); padding: .35rem .5rem; }
fieldset.checks { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
label.check { display: inline-flex; flex-direction: row; gap: .4rem; align-items: center; font-weight: 400; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.login-card { width: 100%; max-width: 26rem; padding: 2.5rem 2rem 1.5rem; border-radius: 2.5rem; border: 1px solid rgb(226 232 240 / .8); background: var(--bg-surface-0); box-shadow: 0 14px 36px -18px rgba(15, 23, 42, .10); text-align: center; }
.login-card img { height: 56px; width: auto; margin: 0 auto 1.5rem; display: block; }
.login-card h1 { font-size: 1.25rem; letter-spacing: -.03em; margin-bottom: .35rem; }
.login-card h1 .brand-title { color: var(--secondary); }
.login-card > p { color: var(--text-medium); }
.login-card .btn { width: 100%; height: 3rem; margin-top: .5rem; font-weight: 500; }
.login-card .lang-switch { margin-top: 1.5rem; }
.login-card p.error { text-align: left; }

@media (max-width: 760px) {
  .grid.two { grid-template-columns: 1fr; }
  .app-header { gap: 12px; padding: 0 12px; }
  .app-logo img { height: 32px; }
  .app-pill { display: none; }
  .container { padding: 1.25rem .75rem 2rem; }
}


/* Dirección dashboard (épica 02 DT10, mockup v7): only blues, Poppins, no inline styles. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.dash { --navy: #07153A; --cobalt: #263C7A; --blue: #4766A8; --steel: #8FA6D6; --sky: #66B6FF; --ice: #D4E9FF; --mist: #EAF4FF; --dgrey: #919191; }
.dash .hero { position: relative; overflow: hidden; border-radius: 24px; padding: 28px 32px 30px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #263C7A 0%, #07153A 55%, #050E28 100%); box-shadow: 0 20px 40px rgba(7, 21, 58, .25); }
.dash .hero::after { content: ""; position: absolute; right: -80px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(102,182,255,.35), rgba(102,182,255,0) 70%); pointer-events: none; }
.dash .hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.dash .eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); font-weight: 500; }
.dash .hero h1 { margin: 6px 0 4px; font-size: 28px; font-weight: 600; color: #fff; }
.dash .hero p { margin: 0; color: #C9D6F2; max-width: 720px; }
.dash .hero-note { color: #9FB3E0; font-size: 12px; }
.dash .filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: relative; z-index: 2; }
.dash .seg { display: inline-flex; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 3px; }
.dash .seg button, .dash .seg-opt span { display: inline-block; border: 0; background: none; color: #C9D6F2; font: inherit; font-size: 12px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.dash .seg-opt { position: relative; margin: 0; }
.dash .seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dash .seg-opt input:checked + span, .dash .seg button.on { background: #fff; color: var(--navy); font-weight: 500; }
.dash .seg-opt input:focus-visible + span { outline: 2px solid var(--sky); }
.dash .seg.light { background: var(--mist); border-color: #DCE8F8; }
.dash .seg.light button { color: var(--cobalt); }
.dash .seg.light button.on { background: var(--cobalt); color: #fff; }
.dash .chipf { font: inherit; font-size: 12px; padding: 6px 30px 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); color: #E3ECFF; background-color: rgba(255,255,255,.06); background-position: right .6rem center; max-width: 14rem; }
.dash .chipf option { color: var(--text-dark); }
.dash .dkpis { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 26px; }
.dash .dkpi { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 16px 18px 10px; transition: transform .2s, background .2s; }
.dash .dkpi:hover { transform: translateY(-2px); background: rgba(255,255,255,.1); }
.dash .dkpi .lbl { font-size: 12px; color: #B7C6EA; display: flex; justify-content: space-between; gap: 8px; }
.dash .dkpi .val { font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; line-height: 1.1; }
.dash .dkpi .val small { font-size: 15px; font-weight: 400; color: #B7C6EA; margin-left: 4px; }
.dash .dkpi .sub { font-size: 12px; color: #B7C6EA; margin-top: 2px; }
.dash .delta { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.dash .delta.up { background: rgba(102,182,255,.18); color: var(--sky); }
.dash .delta.down { background: rgba(255,255,255,.12); color: #fff; }
.dash .dspark { display: block; width: 100%; height: 46px; margin-top: 6px; }
.dash .dgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; margin-top: 20px; }
.dash .dcard { background: #fff; border-radius: 20px; box-shadow: 0 8px 24px rgba(15, 23, 42, .063); padding: 20px 22px; border: 1px solid #F0F2F6; min-width: 0; }
.dash .dcard h2 { margin: 0; font-size: 16px; font-weight: 600; color: #212121; }
.dash .dcard h3 { margin: 0; font-size: 14px; font-weight: 600; color: #212121; }
.dash .intro { color: var(--text-medium); font-size: 12px; margin: 2px 0 12px; }
.dash .dcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.dash .dcard-head > div:first-child { flex: 1 1 14rem; min-width: 0; }
.dash .tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--mist); color: var(--cobalt); white-space: nowrap; }
.dash .tag.part { background: #F1F1F1; color: var(--text-medium); }
.dash .c12 { grid-column: span 12; } .dash .c8 { grid-column: span 8; } .dash .c6 { grid-column: span 6; } .dash .c4 { grid-column: span 4; } .dash .c3 { grid-column: span 3; }
.dash .big { display: block; font-size: 24px; font-weight: 600; color: var(--navy); }
.dash .big.cobalt { color: var(--cobalt); }
.dash .big.band { font-size: 18px; color: var(--text-medium); }
.dash .huge { font-size: 34px; font-weight: 600; color: var(--navy); letter-spacing: -.02em; line-height: 1.1; }
.dash .badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--mist); color: var(--cobalt); margin-left: 6px; vertical-align: middle; }
.dash .badge.dark { background: var(--navy); color: #fff; margin: 0 0 6px; }
.dash .dlegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-medium); margin-top: 6px; }
.dash .dlegend.center, .dash .stat-row.center { justify-content: center; text-align: center; }
.dash .dlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dash .sw-line { background: linear-gradient(90deg, var(--cobalt), var(--sky)); }
.dash .sw-steel { background: var(--steel); }
.dash .sw-ice { background: var(--ice); }
.dash .sw-soft { background: linear-gradient(180deg, var(--ice), var(--steel)); }
.dash .sw-bar { background: linear-gradient(180deg, var(--sky), var(--cobalt)); }
.dash .sw-navy { background: linear-gradient(180deg, var(--cobalt), var(--navy)); }
.dash .sw-sky { background: linear-gradient(180deg, #A9D6FF, var(--blue)); }
.dash .sw-hatch { background: repeating-linear-gradient(45deg, var(--sky), var(--sky) 2px, var(--ice) 2px, var(--ice) 4px); }
.dash .dlegend i.sw-dash { height: 0; width: 14px; border-radius: 0; border-top: 2px dashed var(--sky); vertical-align: 3px; }
.dash .dlegend i.sw-dot { height: 0; width: 14px; border-radius: 0; border-top: 3px dotted var(--steel); vertical-align: 3px; }
.dash .stat-row { display: flex; gap: 28px; margin: 4px 0 6px; flex-wrap: wrap; align-items: flex-start; }
.dash .stat-row span { display: block; font-size: 12px; color: var(--text-medium); }
.dash .stat-row span.badge { display: inline-block; color: var(--cobalt); }
.dash .stat-row small { font-size: 12px; color: var(--cobalt); font-weight: 500; }
.dash .chart { display: block; width: 100%; height: auto; }
.dash svg text { font-family: var(--font); }
.dash .axis { fill: var(--dgrey); font-size: 11px; }
.dash .gridline { stroke: #EEF1F6; stroke-dasharray: 3 4; }
.dash .section-title { grid-column: span 12; margin: 14px 0 -6px; display: flex; align-items: baseline; gap: 12px; }
.dash .section-title h2 { margin: 0; font-size: 18px; color: var(--navy); }
.dash .section-title span { color: var(--text-medium); font-size: 12px; }
.dash .rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash .rows td { padding: 7px 0; border-bottom: 1px solid #F3F4F7; vertical-align: middle; }
.dash .rows td:first-child { width: 130px; font-weight: 500; }
.dash .rows td.num { width: 76px; text-align: right; color: var(--text-medium); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash .rows td.hcol { color: var(--text-medium); font-size: 12px; white-space: nowrap; }
.dash .rows td.pad { padding-left: 12px; }
.dash .rows td.muted-row { color: var(--text-medium); font-style: italic; }
.dash .hbar { display: block; width: 100%; height: 10px; }
.dash .hbar.tall { height: 22px; margin: 10px 0 6px; }
.dash .foot { color: var(--text-medium); font-size: 11px; margin-top: 8px; }
.dash .mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.dash .mini > div { border-radius: 14px; padding: 12px 14px; background: linear-gradient(160deg, var(--mist), #fff); border: 1px solid #E3EEFB; }
.dash .mini .k, .dash .k-label { font-size: 12px; color: var(--text-medium); }
.dash .mini .v { font-size: 22px; font-weight: 600; color: var(--navy); }
.dash .mini .v.blue { color: var(--blue); }
.dash .mini .s { font-size: 11px; color: var(--cobalt); }
.dash .split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.dash .sub-h { font-size: 13px; margin-bottom: 6px; }
.dash .ring-row { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.dash .ring { flex: none; }
.dash .devs { list-style: none; margin: 0; padding: 0; }
.dash .devs li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F3F4F7; font-size: 13px; }
.dash .devs i { font-style: normal; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; flex: none; }
.dash .devs i.up { background: var(--navy); color: #fff; }
.dash .devs i.down { background: var(--ice); color: var(--cobalt); }
.dash .devs i.flat { background: var(--mist); color: var(--blue); }
.dash .devs small { display: block; color: var(--text-medium); font-size: 11px; }
.dash .conc { margin: 10px 0 14px; }
.dash .conc-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.dash .conc-head b { color: var(--navy); }
.dash .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dash-draw 1.4s cubic-bezier(.4,0,.2,1) forwards; }
.dash .draw-ring { stroke-dashoffset: 1; animation: dash-draw 1.4s cubic-bezier(.4,0,.2,1) forwards; }
.dash .fade { opacity: 0; animation: dash-fade .9s ease forwards .4s; }
.dash .grow { transform-box: fill-box; transform-origin: left; transform: scaleX(0); animation: dash-grow 1s cubic-bezier(.4,0,.2,1) forwards; }
.dash .growy { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: dash-growy .9s cubic-bezier(.4,0,.2,1) forwards; }
.dash .pulse { transform-box: fill-box; transform-origin: center; animation: dash-pulse 2.4s ease-in-out infinite; }
@keyframes dash-draw { to { stroke-dashoffset: 0; } }
@keyframes dash-fade { to { opacity: 1; } }
@keyframes dash-grow { to { transform: scaleX(1); } }
@keyframes dash-growy { to { transform: scaleY(1); } }
@keyframes dash-pulse { 0%, 100% { transform: scale(1); opacity: .35; } 50% { transform: scale(1.6); opacity: .1; } }
@media (prefers-reduced-motion: reduce) {
  .dash .draw, .dash .draw-ring, .dash .fade, .dash .grow, .dash .growy, .dash .pulse { animation: none; stroke-dashoffset: 0; opacity: 1; transform: none; }
  .dash .dkpi { transition: none; }
}
.dtip { position: fixed; pointer-events: none; z-index: 50; background: #07153A; color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(7,21,58,.3); opacity: 0; transition: opacity .12s; max-width: 280px; left: 0; top: 0; }
.dtip.on { opacity: 1; }
@media (max-width: 1100px) {
  .dash .dkpis { grid-template-columns: repeat(2, 1fr); }
  .dash .c8, .dash .c6, .dash .c4, .dash .c3 { grid-column: span 12; }
  .dash .split { grid-template-columns: 1fr; }
}
.dash .filters label { flex: none; }
.dash .filters select { width: auto; height: auto; min-height: 0; flex: none; }
.dash .team-pick { position: relative; }
.dash .team-pick summary { list-style: none; cursor: pointer; display: inline-block; }
.dash .team-pick summary::-webkit-details-marker { display: none; }
.dash .team-pick-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 16rem; max-height: 20rem; overflow: auto; background: #fff; color: var(--text-dark); border-radius: 12px; box-shadow: 0 12px 30px rgba(7,21,58,.25); padding: 8px 12px; display: grid; gap: 4px; }
.dash .team-pick-menu label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.dash .team-pick-menu small { color: var(--text-medium); margin-left: auto; }
.dash .rows.wide td:first-child { width: auto; min-width: 9rem; }
.dash .rows tr.head td { color: var(--text-medium); font-size: 12px; }
.dash .rows td { padding-right: 8px; }
.dash .rows .kind { display: block; color: var(--text-medium); font-size: 11px; font-weight: 400; }
.dash .rows td.barcell { min-width: 6rem; }
.dash .rows td.sparkcell { width: 8rem; }
.dash .rows td.sparkcell .dspark { height: 28px; margin: 0; }
.dash .rows td.repo { overflow-wrap: anywhere; font-weight: 500; }
.dash .sub-h.top { margin-top: 14px; }
