/* Nextdart Helpdesk — client portal */

:root {
	--ndh-accent: #4f46e5;
	--ndh-accent-ink: #ffffff;
	--ndh-bg: #f7f7f8;
	--ndh-surface: #ffffff;
	--ndh-ink: #111827;
	--ndh-muted: #6b7280;
	--ndh-line: #e5e7eb;
	--ndh-soft: #f3f4f6;
	--ndh-agent: #eef2ff;
	--ndh-success: #15803d;
	--ndh-success-bg: #f0fdf4;
	--ndh-error: #b91c1c;
	--ndh-error-bg: #fef2f2;
	--ndh-attention: #7c3aed;
	--ndh-note: #fffbeb;
	--ndh-note-line: #fcd34d;
	--ndh-radius: 12px;
	--ndh-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 1px 1px rgb(0 0 0 / 0.02);
	color-scheme: light;
}

/* Dark is the default; the header switch saves light per user (Front\Theme). */
:root[data-theme="dark"] {
	--ndh-accent: #818cf8;
	--ndh-accent-ink: #0b0b12;
	--ndh-bg: #0f1115;
	--ndh-surface: #171a21;
	--ndh-ink: #e5e7eb;
	--ndh-muted: #9ca3af;
	--ndh-line: #262a33;
	--ndh-soft: #1f232b;
	--ndh-agent: #1c1f33;
	--ndh-success: #4ade80;
	--ndh-success-bg: #0f2418;
	--ndh-error: #f87171;
	--ndh-error-bg: #2a1215;
	--ndh-attention: #a78bfa;
	--ndh-note: #2a2310;
	--ndh-note-line: #a16207;
	color-scheme: dark;
}

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

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

body.ndh {
	margin: 0;
	background: var(--ndh-bg);
	color: var(--ndh-ink);
	font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.ndh a { color: var(--ndh-accent); text-decoration: none; }
.ndh a:hover { text-decoration: underline; }
.ndh h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .25rem; letter-spacing: -0.01em; }
.ndh h2 { font-size: 1.05rem; margin: 0; }
.ndh p { margin: 0 0 .75rem; }
.ndh-muted { color: var(--ndh-muted); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ndh-wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.ndh-main { padding-top: 32px; padding-bottom: 64px; }
/* Pages that are one form read better in a column than across the full width. */
.ndh--new .ndh-main { max-width: 760px; }

/* Header */
.ndh-header { background: var(--ndh-surface); border-bottom: 1px solid var(--ndh-line); }
.ndh-header__inner { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.ndh-brand { font-weight: 700; color: var(--ndh-ink) !important; letter-spacing: -0.01em; }
.ndh-nav { display: flex; gap: 4px; flex: 1; }
.ndh-nav a { color: var(--ndh-muted); padding: 6px 10px; border-radius: 8px; }
.ndh-nav a:hover { color: var(--ndh-ink); background: var(--ndh-soft); text-decoration: none; }
.ndh-nav a[aria-current="page"] { color: var(--ndh-ink); background: var(--ndh-soft); font-weight: 600; }
.ndh-user { display: flex; align-items: center; gap: 10px; margin: 0 0 0 auto; color: var(--ndh-muted); font-size: .9rem; }
.ndh-lang { display: inline-flex; margin-left: auto; padding: 2px; border-radius: 8px; background: var(--ndh-soft); }
.ndh-lang button { border: 0; background: none; padding: 3px 8px; border-radius: 6px; font: inherit; font-size: .75rem; font-weight: 600; letter-spacing: .04em; color: var(--ndh-muted); cursor: pointer; }
.ndh-lang button:hover { color: var(--ndh-ink); }
.ndh-lang button[aria-pressed="true"] { background: var(--ndh-surface); color: var(--ndh-ink); box-shadow: var(--ndh-shadow); }
.ndh-lang + .ndh-theme + .ndh-user, .ndh-lang + .ndh-user { margin-left: 0; }
.ndh-scope { margin: 0; }
.ndh .ndh-scope select { width: auto; max-width: 240px; padding: 5px 10px; border-radius: 8px; font-size: .85rem; text-overflow: ellipsis; }
.ndh-theme { margin: 0; }
.ndh-theme button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 26px; border: 0; border-radius: 8px; background: var(--ndh-soft); color: var(--ndh-muted); cursor: pointer; }
.ndh-theme button:hover { color: var(--ndh-ink); }
.ndh-user__profile { display: inline-flex; align-items: center; gap: 6px; color: var(--ndh-muted); padding: 4px 8px; border-radius: 8px; }
.ndh-user__profile:hover, .ndh-user__profile[aria-current="page"] { color: var(--ndh-ink); background: var(--ndh-soft); text-decoration: none; }
.ndh-profile fieldset { gap: 10px; }
.ndh-link { background: none; border: 0; padding: 0; color: var(--ndh-accent); font: inherit; cursor: pointer; }

/* Buttons */
.ndh-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 9px 16px; border-radius: 10px; border: 1px solid var(--ndh-line);
	background: var(--ndh-surface); color: var(--ndh-ink) !important; font: inherit; font-weight: 500;
	cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s;
}
.ndh-btn:hover { background: var(--ndh-soft); }
.ndh-btn--primary { background: var(--ndh-accent); border-color: var(--ndh-accent); color: var(--ndh-accent-ink) !important; }
.ndh-btn--primary:hover { background: var(--ndh-accent); filter: brightness(1.08); }
.ndh-btn--danger { border-color: var(--ndh-error); color: var(--ndh-error) !important; }
.ndh-btn--danger:hover { background: var(--ndh-error-bg); }
.ndh-btn--sm { padding: 6px 12px; font-size: .9rem; }
.ndh-btn--block { width: 100%; }
.ndh-btn:focus-visible, .ndh a:focus-visible, .ndh input:focus-visible, .ndh textarea:focus-visible, .ndh select:focus-visible {
	outline: 2px solid var(--ndh-accent); outline-offset: 2px;
}

/* Page head */
.ndh-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.ndh-crumb { font-size: .85rem; color: var(--ndh-muted); margin-bottom: .35rem; }
.ndh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: .5rem 0 0; font-size: .9rem; }

/* Cards and lists */
.ndh-card { background: var(--ndh-surface); border: 1px solid var(--ndh-line); border-radius: var(--ndh-radius); box-shadow: var(--ndh-shadow); }
.ndh-card__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--ndh-line); }
.ndh-list { list-style: none; margin: 0; padding: 0; }
.ndh-row + .ndh-row { border-top: 1px solid var(--ndh-line); }
.ndh-row__link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; color: inherit !important; }
.ndh-row__link:hover { background: var(--ndh-soft); text-decoration: none !important; }
.ndh-row__main { display: flex; flex-direction: column; min-width: 0; }
.ndh-row__subject { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ndh-row__meta { font-size: .85rem; color: var(--ndh-muted); }

.ndh-badge {
	display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
	font-size: .8rem; font-weight: 600; white-space: nowrap;
	color: var(--badge); background: color-mix(in srgb, var(--badge) 14%, transparent);
}
.ndh-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--badge); }

/* Tags */
.ndh-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ndh-table__ticket .ndh-tags, .ndh-kcard .ndh-tags { margin-top: 4px; }
.ndh-tag {
	display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 6px; line-height: 1.6;
	font-size: .75rem; font-weight: 600; white-space: nowrap;
	color: color-mix(in srgb, var(--tag) 55%, var(--ndh-ink)); background: color-mix(in srgb, var(--tag) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tag) 30%, transparent);
}
a.ndh-tag:hover { text-decoration: none !important; border-color: var(--tag); }
.ndh-tags--edit { margin-bottom: 10px; }
.ndh-tags--pick { gap: 6px; }
.ndh-tags--pick .ndh-tag { cursor: pointer; font-size: .8rem; padding: 2px 8px; }
.ndh-tags--pick input { margin: 0; accent-color: var(--tag); }
.ndh-tags--edit button { border: 0; background: none; padding: 0 0 0 2px; color: inherit; font: inherit; font-size: .95rem; line-height: 1; cursor: pointer; opacity: .7; }
.ndh-tags--edit button:hover { opacity: 1; }
.ndh-tag-add { display: flex; gap: 6px; margin-bottom: 8px; }
.ndh-tag-add input { flex: 1; min-width: 0; }
.ndh-tag-edit { display: flex; align-items: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.ndh-tag-edit input[type="text"] { flex: 1; min-width: 140px; }
.ndh-tag-edit input[type="color"] { width: 36px; height: 32px; padding: 2px; border-radius: 8px; flex-shrink: 0; }
.ndh-tag-edit > a { min-width: 72px; text-align: right; }
.ndh-member--new { background: var(--ndh-bg); }
.ndh-tag-merge { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; }
.ndh-tag-merge p { margin: 0; }

/* Dashboard */
.ndh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.ndh-stat {
	display: flex; flex-direction: column; padding: 16px; border-radius: var(--ndh-radius);
	background: var(--ndh-surface); border: 1px solid var(--ndh-line); color: inherit !important; box-shadow: var(--ndh-shadow);
}
.ndh-stat:hover { border-color: var(--ndh-accent); text-decoration: none !important; }
.ndh-stat__value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.ndh-stat__label { font-weight: 600; margin-top: 6px; }
.ndh-stat__hint { font-size: .82rem; color: var(--ndh-muted); }
.ndh-stat--attention { border-color: var(--ndh-attention); }
.ndh-stat--attention .ndh-stat__value { color: var(--ndh-attention); }

.ndh-empty { padding: 32px 20px; text-align: center; color: var(--ndh-muted); }
.ndh-empty--page { padding: 64px 20px; }
.ndh-empty--page h1 { color: var(--ndh-ink); }

.ndh-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.ndh-tabs a { padding: 6px 12px; border-radius: 999px; color: var(--ndh-muted); }
.ndh-tabs a[aria-current="page"] { background: var(--ndh-ink); color: var(--ndh-bg); font-weight: 600; }
.ndh-tabs a:hover { text-decoration: none; }
.ndh-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }

/* Thread */
.ndh-thread { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ndh-msg { background: var(--ndh-surface); border: 1px solid var(--ndh-line); border-radius: var(--ndh-radius); padding: 16px 20px; }
.ndh-msg--agent { background: var(--ndh-agent); border-color: transparent; }
.ndh-msg__head { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; margin-bottom: 8px; }
.ndh-msg__head time { color: var(--ndh-muted); }
.ndh-msg__body { overflow-wrap: anywhere; }
.ndh-msg__body > :last-child { margin-bottom: 0; }
.ndh-msg__body img { max-width: 100%; height: auto; }
.ndh-files { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--ndh-line); font-size: .9rem; }
.ndh-files li::before { content: "📎 "; }
.ndh-files__delete { display: inline; margin-left: 6px; }
.ndh-files__delete .ndh-link { font-size: .85em; }

/* Forms */
.ndh-form { display: flex; flex-direction: column; gap: 16px; }
.ndh-card > .ndh-form, .ndh-card > .ndh-alert { margin: 20px; }
.ndh-reply h2 { padding: 16px 20px 0; }
.ndh-field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.ndh-field > span, .ndh-field > legend { font-weight: 600; font-size: .9rem; padding: 0; }
.ndh input[type="text"], .ndh input[type="password"], .ndh input[type="email"], .ndh input[type="date"], .ndh select, .ndh textarea {
	width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ndh-line);
	background: var(--ndh-surface); color: var(--ndh-ink); font: inherit;
}
.ndh textarea { resize: vertical; min-height: 120px; }
/* Message editor (assets/editor.js) */
.ndh-editor { display: flex; flex-direction: column; border: 1px solid var(--ndh-line); border-radius: 10px; background: var(--ndh-surface); }
.ndh-editor:focus-within { outline: 2px solid var(--ndh-accent); outline-offset: 2px; }
.ndh-editor > textarea:not([hidden]) { border: 0; border-radius: 10px; }
.ndh-editor > textarea:focus-visible { outline: 0; }
.ndh-editor__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--ndh-line); }
.ndh-editor__bar[hidden], .ndh-editor__link[hidden], .ndh-editor__link [hidden] { display: none; }
.ndh-editor__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--ndh-muted); font: inherit; font-size: .85rem; cursor: pointer; }
.ndh-editor__btn:hover { background: var(--ndh-soft); color: var(--ndh-ink); }
.ndh-editor__btn[aria-pressed="true"] { background: var(--ndh-agent); color: var(--ndh-accent); }
.ndh-editor__btn:focus-visible { outline: 2px solid var(--ndh-accent); outline-offset: -2px; }
.ndh-editor__sep { width: 1px; height: 18px; margin: 0 4px; background: var(--ndh-line); }
.ndh-editor__link { display: flex; gap: 6px; align-items: center; padding: 6px; border-bottom: 1px solid var(--ndh-line); background: var(--ndh-soft); }
.ndh .ndh-editor__link input { flex: 1; min-width: 0; padding: 6px 10px; }
.ndh-editor__area { padding: 10px 12px; overflow-wrap: anywhere; cursor: text; max-height: 60vh; overflow-y: auto; }
.ndh-editor__area:focus { outline: 0; }
.ndh-editor__area:empty::before { content: attr(data-placeholder); color: var(--ndh-muted); pointer-events: none; }
.ndh-editor__area.is-invalid { box-shadow: inset 3px 0 0 var(--ndh-error); }
.ndh-editor__error { margin: 0; padding: 0 12px 8px; color: var(--ndh-error); font-size: .85rem; font-weight: 400; }
.ndh-editor__error[hidden] { display: none; }
@media (max-width: 480px) {
	.ndh-editor__sep { display: none; }
	.ndh-editor__btn { min-width: 30px; }
}
.ndh .ndh-editor__area > :first-child, .ndh .ndh-msg__body > :first-child { margin-top: 0; }
.ndh-editor__area p, .ndh-editor__area ul, .ndh-editor__area ol, .ndh-msg__body ul, .ndh-msg__body ol { margin: 0 0 .75em; }
.ndh .ndh-editor__area h2, .ndh .ndh-msg__body h2 { font-size: 1.2rem; margin: 1em 0 .4em; padding: 0; }
.ndh .ndh-editor__area h3, .ndh .ndh-msg__body h3 { font-size: 1.05rem; margin: 1em 0 .4em; }
.ndh-editor__area ul, .ndh-editor__area ol, .ndh-msg__body ul, .ndh-msg__body ol { padding-left: 1.4em; }
.ndh-editor__area a, .ndh-msg__body a { color: var(--ndh-accent); text-decoration: underline; }
.ndh-editor__area blockquote, .ndh-msg__body blockquote { margin: 0 0 .75em; padding: 2px 0 2px 12px; border-left: 3px solid var(--ndh-line); color: var(--ndh-muted); }
.ndh .ndh-editor__area blockquote p, .ndh .ndh-msg__body blockquote p { margin: 0 0 .3em; }
.ndh-editor__area blockquote > :last-child, .ndh-msg__body blockquote > :last-child { margin-bottom: 0; }
.ndh-editor__area pre, .ndh-msg__body pre { margin: 0 0 .75em; padding: 10px 12px; border-radius: 8px; background: var(--ndh-soft); border: 1px solid var(--ndh-line); overflow-x: auto; white-space: pre; font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
.ndh-editor__area code, .ndh-msg__body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

.ndh-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.ndh-form__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ndh-form__actions { display: flex; justify-content: flex-end; gap: 8px; }
.ndh-reply .ndh-form__actions, .ndh--agent-new .ndh-form__actions { flex-wrap: wrap; align-items: center; }
.ndh-reply__silent { margin-right: auto; color: var(--ndh-muted); }
.ndh-form__actions .ndh-form__aside { margin-right: auto; align-self: center; }
.ndh-file { font-size: .9rem; color: var(--ndh-muted); }
.ndh-hint { font-size: .82rem; color: var(--ndh-muted); margin: 0; font-weight: 400; }
.ndh-field-row { display: flex; gap: 12px; }
.ndh-field-row > .ndh-field { flex: 1; }
.ndh-field-row > .ndh-field--short { flex: 0 0 90px; }

.ndh-segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ndh-segmented label { position: relative; }
.ndh-segmented input { position: absolute; opacity: 0; inset: 0; }
.ndh-segmented span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ndh-line); cursor: pointer; font-size: .9rem; }
.ndh-segmented input:checked + span { background: var(--ndh-ink); color: var(--ndh-bg); border-color: var(--ndh-ink); }
.ndh-segmented input:focus-visible + span { outline: 2px solid var(--ndh-accent); outline-offset: 2px; }

.ndh-alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: .95rem; }
.ndh-alert--success { background: var(--ndh-success-bg); color: var(--ndh-success); }
.ndh-alert--error { background: var(--ndh-error-bg); color: var(--ndh-error); }
.ndh-alert--attention { background: color-mix(in srgb, var(--ndh-attention) 10%, var(--ndh-surface)); color: var(--ndh-ink); border: 1px solid color-mix(in srgb, var(--ndh-attention) 35%, transparent); }

/* Login */
.ndh--login .ndh-main, .ndh--signup .ndh-main, .ndh--recover .ndh-main, .ndh--password .ndh-main, .ndh--email-sent .ndh-main, .ndh--quote-link .ndh-main { display: flex; justify-content: center; padding-top: 10vh; }
.ndh-auth { width: 100%; max-width: 380px; }
.ndh-auth--wide { max-width: 520px; }
.ndh-auth .ndh-quote { margin-top: 16px; }
.ndh-auth h1 { font-size: 1.4rem; }
.ndh-auth .ndh-form { margin-top: 24px; }
.ndh-auth__links { margin-top: 16px; text-align: center; font-size: .9rem; }
.ndh-auth__links + .ndh-auth__links { margin-top: 4px; }
.ndh-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Agent console, and the client ticket list that shares its table */
.ndh-console { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; }
.ndh-views { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.ndh-views a { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; color: var(--ndh-muted); }
.ndh-views a:hover { background: var(--ndh-soft); color: var(--ndh-ink); text-decoration: none; }
.ndh-views a[aria-current="page"] { background: var(--ndh-surface); color: var(--ndh-ink); font-weight: 600; box-shadow: var(--ndh-shadow); border: 1px solid var(--ndh-line); }
.ndh-count { font-variant-numeric: tabular-nums; font-size: .85rem; }
.ndh-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.ndh-toolbar input[type="search"] { flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--ndh-line); background: var(--ndh-surface); color: var(--ndh-ink); font: inherit; }
.ndh-toolbar select { width: auto; }
.ndh-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ndh-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ndh-muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--ndh-line); }
.ndh-table td { padding: 12px 16px; border-bottom: 1px solid var(--ndh-line); vertical-align: middle; }
.ndh-table tr:last-child td { border-bottom: 0; }
.ndh-table tbody tr:hover { background: var(--ndh-soft); }
.ndh-table tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--ndh-error); }
.ndh-table__ticket a { display: block; font-weight: 600; color: var(--ndh-ink) !important; }
.ndh-table__ticket .ndh-muted { font-size: .82rem; }
.ndh-table__activity { white-space: nowrap; color: var(--ndh-muted); }
.ndh-table__due { white-space: nowrap; }
.ndh-table__due .ndh-flag { margin-left: 0; }
.ndh-table__money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ndh-table .ndh-table__check { width: 1px; padding-right: 0; }
.ndh-table__check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ndh-accent); cursor: pointer; }
.ndh-table tbody tr.is-selected { background: var(--ndh-agent); }
.ndh-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 8px 8px 16px; border: 1px solid var(--ndh-line); border-radius: var(--ndh-radius); background: var(--ndh-surface); }
.ndh-bulk__count { flex: 1; font-size: .9rem; font-weight: 600; }
.ndh-bulk select { width: auto; }
.ndh-bulk.is-idle { background: transparent; border-style: dashed; }
.ndh-bulk.is-idle .ndh-bulk__count { color: var(--ndh-muted); font-weight: 400; }
.ndh-bulk .ndh-btn:disabled { opacity: .5; cursor: not-allowed; }
.ndh-flag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; background: var(--ndh-soft); color: var(--ndh-ink); }
.ndh-flag--danger { background: var(--ndh-error-bg); color: var(--ndh-error); }
.ndh-flag--note { background: var(--ndh-note); color: #a16207; border: 1px solid var(--ndh-note-line); }

.ndh-split { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.ndh-split__side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.ndh--team .ndh-split + .ndh-split { margin-top: 24px; }
.ndh-props { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.ndh-facts { padding: 16px; font-size: .9rem; }
.ndh-facts h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ndh-muted); margin-bottom: 10px; }
.ndh-facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.ndh-facts dt { color: var(--ndh-muted); }
.ndh-facts dd { margin: 0; overflow-wrap: anywhere; }
.ndh-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ndh-msg--note { background: var(--ndh-note); border-color: var(--ndh-note-line); border-style: dashed; }
.ndh-btn--note { background: var(--ndh-note); border-color: var(--ndh-note-line); }
.ndh-inline { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ndh-muted); }
.ndh-inline select { width: auto; padding: 6px 10px; }

/* List / board switch */
.ndh-console__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ndh-console__head h1 { font-size: 1.3rem; margin: 0; }
.ndh-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--ndh-soft); }
.ndh-switch a { padding: 5px 12px; border-radius: 8px; color: var(--ndh-muted); font-size: .9rem; }
.ndh-switch a:hover { text-decoration: none; color: var(--ndh-ink); }
.ndh-switch a[aria-current="page"] { background: var(--ndh-surface); color: var(--ndh-ink); font-weight: 600; box-shadow: var(--ndh-shadow); }

/* Kanban board */
.ndh--agent-board .ndh-wrap, .ndh--board .ndh-wrap { max-width: none; }
.ndh--agent-board .ndh-header .ndh-wrap, .ndh--board .ndh-header .ndh-wrap { max-width: 1240px; }
.ndh-board { position: relative; display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; scroll-snap-type: x proximity; }
.ndh-col { flex: 1 0 220px; max-width: 340px; background: var(--ndh-soft); border-radius: var(--ndh-radius); padding: 10px; scroll-snap-align: start; border: 2px solid transparent; transition: border-color .15s, background .15s; }
.ndh-col.is-over { border-color: var(--badge); background: color-mix(in srgb, var(--badge) 8%, var(--ndh-soft)); }
.ndh-col--closed { opacity: .8; }
.ndh-col__head { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 4px 6px 10px; font-weight: 600; font-size: .92rem; }
.ndh-col__title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--badge); margin-right: 8px; }
.ndh-col__cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-height: 48px; }
.ndh-col__more { margin: 10px 6px 0; font-size: .82rem; color: var(--ndh-muted); }
.ndh-kcard { background: var(--ndh-surface); border: 1px solid var(--ndh-line); border-radius: 10px; padding: 10px 12px; box-shadow: var(--ndh-shadow); cursor: grab; display: flex; flex-direction: column; gap: 4px; }
.ndh-kcard.is-overdue { box-shadow: inset 3px 0 0 var(--ndh-error), var(--ndh-shadow); }
.ndh-board--readonly .ndh-kcard, .ndh-kcard--fixed { cursor: pointer; }
.ndh-kcard.is-dragging { opacity: .5; }
.ndh-kcard.is-saving { opacity: .6; pointer-events: none; }
.ndh-kcard__title { font-weight: 600; color: var(--ndh-ink) !important; line-height: 1.35; }
.ndh-kcard__meta { font-size: .8rem; color: var(--ndh-muted); }
.ndh-kcard__foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .8rem; margin-top: 2px; }
.ndh-kcard__foot .ndh-flag { margin-left: 0; }
.ndh-col[data-single] .ndh-kcard__status { display: none; }
.ndh-kcard__who { margin-left: auto; color: var(--ndh-muted); }

/* Companies */
.ndh-narrow { max-width: 560px; }
.ndh-status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; white-space: nowrap; }
.ndh-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ndh-success); }
.ndh-status--pending::before { background: var(--ndh-attention); }
.ndh-status--inactive { color: var(--ndh-muted); }
.ndh-status--inactive::before { background: var(--ndh-muted); }
.ndh-flag--attention { background: color-mix(in srgb, var(--ndh-attention) 14%, transparent); color: var(--ndh-attention); }
.ndh-members { list-style: none; margin: 0; padding: 0; }
.ndh-member { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--ndh-line); }
.ndh-member:last-child { border-bottom: 0; }
.ndh-member.is-pending { box-shadow: inset 3px 0 0 var(--ndh-attention); }
.ndh-member__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; font-size: .92rem; }
.ndh-member__who .ndh-flag { margin-left: 0; }
.ndh-member__who > a, .ndh-member__who > .ndh-muted { flex-basis: 100%; font-size: .85rem; overflow-wrap: anywhere; }
.ndh-member__who > a.ndh-member__name { flex-basis: auto; font-size: inherit; color: inherit; text-decoration: none; }
.ndh-member__who > a.ndh-member__name:hover { text-decoration: underline; }
.ndh-member__access { flex-basis: 100%; font-size: .85rem; }
.ndh-member__access > summary { cursor: pointer; list-style: none; }
.ndh-member__access .ndh-form { margin-top: 10px; font-size: .92rem; }
.ndh-member__access .ndh-btn { align-self: flex-start; }
.ndh--team .ndh-member { flex-wrap: wrap; }
.ndh-member__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ndh-member__actions select { width: auto; padding: 6px 10px; }
.ndh-menu { position: relative; }
.ndh-menu summary { list-style: none; cursor: pointer; }
.ndh-menu summary::-webkit-details-marker { display: none; }
.ndh-menu__items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 220px; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--ndh-surface); border: 1px solid var(--ndh-line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.ndh-menu__items .ndh-link { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ndh-ink); }
.ndh-menu__items .ndh-link:hover { background: var(--ndh-soft); }
.ndh-link--danger, .ndh-menu__items .ndh-link--danger { color: var(--ndh-error); }
.ndh-add-member { margin-top: 16px; }
.ndh-card > .ndh-form > .ndh-hint { margin-top: -8px; }
.ndh-props__title { font-size: .8rem !important; text-transform: uppercase; letter-spacing: .04em; color: var(--ndh-muted); }
.ndh-props .ndh-alert { margin: 0; }
.ndh-props textarea { min-height: 72px; }

/* Files */
.ndh-drive__actions { display: flex; align-items: flex-start; gap: 8px; flex-shrink: 0; }
.ndh-drive__upload { margin: 0; display: flex; gap: 8px; }
.ndh-drive__upload label.ndh-btn { position: relative; }
.ndh-drive__upload label.ndh-btn:focus-within { outline: 2px solid var(--ndh-accent); outline-offset: 2px; }
.ndh-menu__form { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.ndh-menu__items.ndh-menu__form { min-width: 260px; padding: 10px; }
.ndh-menu__form input[type="text"], .ndh-menu__form select { padding: 7px 10px; }
.ndh-menu__form .ndh-btn { align-self: flex-end; }
.ndh-menu__items .ndh-menu__form + .ndh-menu__form, .ndh-menu__items .ndh-menu__form + form { border-top: 1px solid var(--ndh-line); }
.ndh-drive { position: relative; overflow: visible; }
.ndh-drive__table td { padding-top: 10px; padding-bottom: 10px; }
.ndh-drive__name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ndh-drive__name a { font-weight: 600; color: var(--ndh-ink) !important; overflow-wrap: anywhere; }
.ndh-drive__name > span:last-child:not(.ndh-icon) { display: flex; flex-direction: column; min-width: 0; }
.ndh-drive__name a.ndh-drive__where { font-size: .82rem; font-weight: 400 !important; color: var(--ndh-muted) !important; }
span.ndh-drive__where { font-size: .82rem; color: var(--ndh-muted); }
.ndh-drive__group th { text-align: left; padding-top: 18px; background: var(--ndh-soft); font-weight: 600; }
.ndh-drive__group th .ndh-muted { font-weight: 400; margin-left: 8px; }
.ndh-drive__menu { width: 1%; }
.ndh-drive__menu .ndh-menu summary { margin-left: auto; width: fit-content; }
.ndh-drive__foot { margin-top: 10px; }
.ndh-icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; }
.ndh-icon--file { background: var(--ndh-soft); color: var(--ndh-muted); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.ndh-icon--folder { background: color-mix(in srgb, var(--ndh-accent) 12%, transparent); }
.ndh-icon--folder::before { content: ""; width: 18px; height: 14px; border-radius: 2px 3px 3px 3px; background: var(--ndh-accent); clip-path: polygon(0 0, 42% 0, 52% 18%, 100% 18%, 100% 100%, 0 100%); }
.ndh-progress { margin-bottom: 12px; }
.ndh-progress__bar { height: 6px; border-radius: 999px; background: var(--ndh-soft); overflow: hidden; margin-bottom: 6px; }
.ndh-progress__bar span { display: block; height: 100%; width: 0; background: var(--ndh-accent); transition: width .2s; }
.ndh-dropzone { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--ndh-accent) 14%, rgb(0 0 0 / .35)); pointer-events: none; }
.ndh-dropzone[hidden] { display: none; }
.ndh-dropzone p { padding: 18px 28px; border-radius: var(--ndh-radius); background: var(--ndh-surface); font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / .18); border: 2px dashed var(--ndh-accent); }
/* Payments */
.ndh-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ndh-text-danger { color: var(--ndh-error); }
.ndh-gap { margin-top: 16px; }
.ndh-sums { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 12px; font-size: .92rem; color: var(--ndh-muted); }
.ndh-sums strong { color: var(--ndh-ink); font-variant-numeric: tabular-nums; }
.ndh-sums__overdue strong { color: var(--ndh-error); }
.ndh-pay { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--ndh-soft); color: var(--ndh-muted); }
.ndh-pay--pending { background: color-mix(in srgb, var(--ndh-attention) 14%, transparent); color: var(--ndh-attention); }
.ndh-pay--paid { background: var(--ndh-success-bg); color: var(--ndh-success); }
.ndh-pay--overdue { background: var(--ndh-error-bg); color: var(--ndh-error); }
.ndh-pay-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ndh-payrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.ndh-payrow.is-overdue { box-shadow: inset 3px 0 0 var(--ndh-error); }
.ndh-payrow__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.ndh-stats--pay { grid-template-columns: repeat(2, 1fr); }
.ndh-stats--pay .ndh-stat__value { font-size: 1.45rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ndh-stat--danger { border-color: var(--ndh-error); }
.ndh-stat--danger .ndh-stat__value { color: var(--ndh-error); }
.ndh-alert--action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.ndh-alert--action a { font-weight: 600; white-space: nowrap; }
.ndh-paymode legend { margin-bottom: 4px; }
.ndh-paymode:has(input[name="pagos"][value="selected"]:not(:checked)) .ndh-paymode__users { display: none; }
.ndh-boardmove:has(input[name="mover"][value="selected"]:not(:checked)) .ndh-paymode__users { display: none; }
.ndh-paymode__facts { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--ndh-line); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem; }
.ndh-paymode__facts dt { color: var(--ndh-muted); }
.ndh-paymode__facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ndh-paymode__links { display: flex; justify-content: space-between; gap: 8px; margin: 0 !important; font-size: .9rem; }
.ndh-modules__item { align-items: flex-start; }
.ndh-modules__item input { margin-top: 3px; }
.ndh-modules__item small { display: block; margin-top: 2px; }
.ndh-quote { display: grid; gap: 4px; }
.ndh-quote + .ndh-quote { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ndh-line); }
.ndh-quote p { margin: 0; font-size: .9rem; }
.ndh-quote__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ndh-quote__amount { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.ndh-quote__text { white-space: normal; }
.ndh-quote__note { margin: 4px 0 0; padding-left: 10px; border-left: 3px solid var(--ndh-line); font-size: .9rem; }
.ndh-quotes__older summary, .ndh-quotes__new summary { cursor: pointer; list-style: none; }
.ndh-quotes__older summary { font-size: .85rem; color: var(--ndh-muted); }
.ndh-quotes__older[open] summary { margin-bottom: 8px; }
.ndh-quotes__new summary::-webkit-details-marker, .ndh-quotes__older summary::-webkit-details-marker { display: none; }
.ndh-quotes__new[open] summary { margin-bottom: 12px; }
.ndh-quote-form:has(input[name="modo"][value="hours"]:checked) .ndh-quote-form__amount,
.ndh-quote-form:has(input[name="modo"][value="amount"]:checked) .ndh-quote-form__hours { display: none; }
.ndh-quote-form:has(input[name="no_notificar"]:checked) .ndh-quote-form__notify,
.ndh-quote-form:has(input[name="no_notificar"]:checked) .ndh-quote-form__valid,
.ndh-quote-form:not(:has(input[name="no_notificar"]:checked)) .ndh-quote-form__silent { display: none; }
.ndh-new-quote__fields { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; padding: 14px; border: 1px solid var(--ndh-line); border-radius: var(--ndh-radius); }
.ndh-new-quote__fields .ndh-segmented { align-self: flex-start; }
.ndh-new-quote:not(:has(input[name="presupuesto"]:checked)) .ndh-new-quote__fields, .ndh-new-quote[hidden] { display: none; }
.ndh-card:not(.ndh-props) > .ndh-quote, .ndh-card:not(.ndh-props) > .ndh-hint { margin: 16px 20px; }
.ndh-card:not(.ndh-props) > .ndh-quote-decision { margin-top: 0; }
.ndh-quotes:not(.ndh-props) { margin-bottom: 16px; }
.ndh-quote__actual { font-weight: 600; }
.ndh-quote-hours { display: grid; gap: 4px; margin: 8px 0 4px; }
.ndh-quote-hours .ndh-hint { margin: 0; font-size: .8rem; }
.ndh-quote-hours__row { display: flex; gap: 8px; }
.ndh-quote-hours__row input { flex: 1; min-width: 0; }
.ndh-sheet { overflow-x: auto; }
.ndh-card--table + .ndh-card--table { margin-top: 16px; }
.ndh-report th[scope="row"] { text-align: left; text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ndh-ink); padding: 12px 16px; border-bottom: 1px solid var(--ndh-line); }
.ndh-report__num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ndh-report tfoot th, .ndh-report tfoot td { font-weight: 700; border-top: 2px solid var(--ndh-line); border-bottom: 0; }
.ndh-pay-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: .9rem; }
.ndh-pay-foot p { margin: 0; }
.ndh-danger-zone { text-align: center; font-size: .9rem; }
.ndh-danger-zone .ndh-link--danger { color: var(--ndh-error) !important; }
.ndh-delete__list { margin: 0 0 16px; padding-left: 20px; }
.ndh-delete__list li { margin: 4px 0; }

/* Lightbox for attachments and files (assets/preview.js). Always dark, whatever the theme. */
.ndh-lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0a0b0e; color: #f3f4f6; overflow: hidden; }
.ndh-lightbox[open] { display: flex; flex-direction: column; }
.ndh-lightbox::backdrop { background: #0a0b0e; }
.ndh-lightbox__bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.ndh-lightbox__title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.ndh-lightbox__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ndh-lightbox__count { color: #9ca3af; font-size: .85rem; white-space: nowrap; }
.ndh-lightbox__actions { display: flex; align-items: center; gap: 8px; }
.ndh-lightbox .ndh-btn:not(.ndh-btn--primary) { background: transparent; border-color: rgb(255 255 255 / 0.2); color: #f3f4f6 !important; }
.ndh-lightbox .ndh-btn:not(.ndh-btn--primary):hover { background: rgb(255 255 255 / 0.08); }
.ndh-lightbox__close { border: 0; background: none; color: #f3f4f6; font-size: 1.8rem; line-height: 1; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; }
.ndh-lightbox__close:hover { background: rgb(255 255 255 / 0.08); }
.ndh-lightbox__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px 72px; }
.ndh-lightbox__stage img, .ndh-lightbox__stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.ndh-lightbox__stage audio { width: min(520px, 100%); }
.ndh-lightbox__stage iframe { width: min(1100px, 100%); height: 100%; border: 0; border-radius: 6px; background: #ffffff; }
.ndh-lightbox__failed { color: #d1d5db; text-align: center; }
.ndh-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.1); color: #f3f4f6; font-size: 2rem; line-height: 1; cursor: pointer; }
.ndh-lightbox__nav:hover { background: rgb(255 255 255 / 0.2); }
.ndh-lightbox__nav--prev { left: 12px; }
.ndh-lightbox__nav--next { right: 12px; }
.ndh-lightbox__nav[hidden] { display: none; }
.ndh-lightbox :focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }

@media (max-width: 960px) {
	.ndh-console, .ndh-split { grid-template-columns: 1fr; }
	.ndh-views { position: static; flex-direction: row; overflow-x: auto; }
	.ndh-views a { white-space: nowrap; gap: 8px; }
	.ndh-split__side { position: static; }
	.ndh-table th:nth-child(3), .ndh-table td:nth-child(3), .ndh-table th:nth-child(4), .ndh-table td:nth-child(4) { display: none; }
	/* Payments keep the due date and hide the paid date instead. */
	.ndh-table--payments th:nth-child(3), .ndh-table--payments td:nth-child(3) { display: table-cell; }
	/* The report keeps every column, like a spreadsheet; it scrolls sideways when needed. */
	.ndh-report th:nth-child(n), .ndh-report td:nth-child(n) { display: table-cell; }
	/* The checkbox column shifts priority and assignee one place. */
	.ndh-table--select th:nth-child(3), .ndh-table--select td:nth-child(3) { display: table-cell; }
	.ndh-table--select th:nth-child(5), .ndh-table--select td:nth-child(5) { display: none; }
}

@media (max-width: 720px) {
	.ndh-stats { grid-template-columns: repeat(2, 1fr); }
	.ndh-page-head { flex-direction: column; }
	.ndh-header__inner { gap: 12px; padding-top: 8px; padding-bottom: 8px; }
	/* Brand, language and sign-out on the first row; nav and "Nuevo ticket" below. */
	.ndh-nav { order: 3; flex: 1 0 60%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
	.ndh-nav a { white-space: nowrap; }
	.ndh-header__inner > .ndh-btn { order: 4; }
	/* The project picker starts the second row, next to "Nuevo ticket". */
	.ndh-scope { order: 4; flex: 1 1 50%; min-width: 0; }
	.ndh .ndh-scope select { width: 100%; max-width: none; }
	.ndh-user__name { display: none; }
	.ndh-row__link { flex-direction: column; align-items: flex-start; gap: 6px; }
	.ndh-row__subject { white-space: normal; }
	.ndh-toolbar { flex-wrap: wrap; }
	.ndh-toolbar input[type="search"] { flex-basis: 100%; order: -1; }
	.ndh-toolbar select { flex: 1; min-width: 0; }
	.ndh-bulk { padding-left: 12px; }
	.ndh-bulk__count { flex-basis: 100%; }
	.ndh-bulk select { flex: 1; min-width: 0; }
	.ndh-col { flex-basis: 80vw; }
	.ndh-table .ndh-table__quote { display: none; }
	.ndh-card--table { overflow-x: auto; }
	.ndh-card--table .ndh-table td, .ndh-card--table .ndh-table th { padding: 10px 12px; }
	.ndh-card--table .ndh-table__activity { white-space: normal; }
	.ndh-card--table .ndh-table__ticket { min-width: 180px; }
	.ndh-member { flex-direction: column; align-items: flex-start; }
	.ndh-menu__items { right: auto; left: 0; }
	.ndh-field-row { flex-direction: column; }
	.ndh-field-row > .ndh-field--short { flex-basis: auto; }
	.ndh-drive__actions { width: 100%; }
	.ndh-drive__actions > * { flex: 1; }
	.ndh-drive__actions .ndh-btn { width: 100%; }
	.ndh-drive__table th:nth-child(2), .ndh-drive__table td:nth-child(2) { display: none; }
	.ndh-stats--pay { grid-template-columns: 1fr; }
	.ndh-table--payments th:nth-child(3), .ndh-table--payments td:nth-child(3) { display: none; }
	.ndh-table--payments td, .ndh-table--payments th { padding: 10px 12px; }
	.ndh-lightbox__bar { flex-wrap: wrap; padding: 8px 12px; }
	.ndh-lightbox__title { flex-basis: calc(100% - 52px); order: 1; }
	.ndh-lightbox__actions { display: contents; }
	.ndh-lightbox__close { order: 2; }
	.ndh-lightbox__open, .ndh-lightbox__download { order: 3; flex: 1; text-align: center; }
	.ndh-lightbox__stage { padding: 12px; }
	.ndh-lightbox__nav { top: auto; bottom: 16px; transform: none; }
}

/* Projects */
.ndh-dash-projects { margin-bottom: 24px; }
.ndh-project-row { display: flex; align-items: center; }
.ndh-project-row .ndh-row__link { flex: 1; min-width: 0; }
.ndh-project-row__links { display: flex; gap: 12px; padding-right: 20px; font-size: .9rem; white-space: nowrap; }
.ndh-project-row__members { padding: 0 20px 14px; }
.ndh-projects > .ndh-hint { padding: 12px 20px 0; margin: 0; }
.ndh-project__edit { display: flex; flex-direction: row; align-items: flex-end; gap: 12px; }
.ndh-project__edit > .ndh-field { flex: 1; margin: 0; }
.ndh-project__edit > .ndh-field--short { flex: 0 0 160px; }
.ndh-project__new { padding: 16px 20px; border-top: 1px solid var(--ndh-line); }
.ndh-project-members .ndh-btn { align-self: flex-start; }
.ndh-project-list { list-style: none; margin: 12px 0 0; padding: 0; }
.ndh-project-list > li { border-top: 1px solid var(--ndh-line); }
.ndh-project > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 20px; cursor: pointer; }
.ndh-project-row__members .ndh-project > summary { padding: 0; font-size: .9rem; color: var(--ndh-muted); }
.ndh-project__body { display: flex; flex-direction: column; gap: 16px; padding: 0 20px 16px; }
.ndh-project-members { padding-top: 8px; }
.ndh-project-members:has(input[name="quienes"][value="elegidos"]:not(:checked)) .ndh-paymode__users { display: none; }

@media (max-width: 720px) {
	.ndh-project-row { flex-direction: column; align-items: stretch; }
	.ndh-project-row__links { padding: 0 20px 14px; }
	.ndh-project__edit { flex-direction: column; align-items: stretch; }
}
.ndh-project__body--flush { padding: 12px 0 0; }
.ndh-project__delete { margin-top: -4px; }
.ndh-ticket-project select { width: 100%; padding: 2px 8px; font-size: .85rem; min-height: 0; }

/* Client ticket: conversation on the left, ticket data and files on the right. */
.ndh-ticket .ndh-split__side { position: static; }
.ndh-ticket .ndh-facts dl { align-items: center; }
.ndh-ticket .ndh-flag { margin-left: 0; }
.ndh-ticket-glance { display: none; }
.ndh-ticket-files h2 { display: flex; align-items: center; gap: 8px; }
.ndh-ticket-files .ndh-count { padding: 0 7px; border-radius: 999px; background: var(--ndh-soft); color: var(--ndh-ink); font-size: .75rem; letter-spacing: 0; }
.ndh-ticket-files__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ndh-ticket-files__list li { display: flex; flex-direction: column; padding: 8px 0; overflow-wrap: anywhere; }
.ndh-ticket-files__list li + li { border-top: 1px solid var(--ndh-line); }
.ndh-ticket-files__list li:first-child { padding-top: 0; }
.ndh-ticket-files__list .ndh-muted { font-size: .8rem; }
.ndh-ticket-files__empty { margin: 0 !important; }
@media (max-width: 960px) {
	.ndh-ticket-glance { display: flex; }
}

/* Ticket window over the kanban boards (templates/portal/ticket-modal.php, assets/board-modal.js). */
.ndh-board .ndh-kcard__title { cursor: pointer; }
.ndh-tmodal { width: min(1120px, calc(100vw - 48px)); height: min(860px, calc(100vh - 48px)); height: min(860px, calc(100dvh - 48px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--ndh-line); border-radius: var(--ndh-radius); background: var(--ndh-bg); color: var(--ndh-ink); box-shadow: 0 24px 64px rgb(0 0 0 / 0.35); overflow: hidden; }
.ndh-tmodal[open] { display: flex; flex-direction: column; }
.ndh-tmodal::backdrop { background: rgb(10 11 14 / 0.6); }
.ndh-tmodal.is-max { width: calc(100vw - 24px); height: calc(100vh - 24px); height: calc(100dvh - 24px); }
.ndh-tmodal__bar { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; background: var(--ndh-surface); border-bottom: 1px solid var(--ndh-line); }
.ndh-tmodal__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ndh-tmodal__actions { display: flex; align-items: center; gap: 2px; }
.ndh-tmodal__btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--ndh-muted) !important; cursor: pointer; }
.ndh-tmodal__btn:hover { background: var(--ndh-soft); color: var(--ndh-ink) !important; text-decoration: none !important; }
.ndh-tmodal__btn:focus-visible { outline: 2px solid var(--ndh-accent); outline-offset: 1px; }
.ndh-tmodal__icon-restore, .ndh-tmodal.is-max .ndh-tmodal__icon-max { display: none; }
.ndh-tmodal.is-max .ndh-tmodal__icon-restore { display: block; }
.ndh-tmodal__body { flex: 1; min-height: 0; }
.ndh-tmodal__frame { display: block; width: 100%; height: 100%; border: 0; background: var(--ndh-bg); }
@media (max-width: 720px) {
	.ndh-tmodal, .ndh-tmodal.is-max { width: 100vw; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
	.ndh-tmodal__max { display: none; }
}

/* A page shown inside that window: no site header, less air around it. */
.ndh-embedded .ndh-header { display: none; }
.ndh-embedded .ndh-main { padding-top: 20px; padding-bottom: 32px; }

/* Asana import (/agente/importar) */
.ndh-import > .ndh-card + .ndh-card, .ndh-import > .ndh-form + .ndh-card { margin-top: 16px; }
.ndh-import .ndh-card > p.ndh-muted { margin: 20px; }
.ndh-import__setup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ndh-import__box { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.ndh-import__box h2 { margin: 0; font-size: 1rem; }
.ndh-card.ndh-import__box > .ndh-hint { margin: -6px 0 0; }
.ndh-import__map { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.ndh-import__map > span { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ndh-import__map select { width: auto; min-width: 12rem; }
.ndh-import__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ndh-import__bar .ndh-sums { margin: 0; }
.ndh-import__actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.ndh-import__asana { display: block; font-size: .8rem; }
.ndh-table tr.is-muted td { color: var(--ndh-muted); }
@media (max-width: 960px) {
	.ndh-import__setup { grid-template-columns: 1fr; }
	/* The import table keeps the status and hides section and priority. */
	.ndh-table--import th:nth-child(2), .ndh-table--import td:nth-child(2) { display: none; }
	.ndh-table--import th:nth-child(3), .ndh-table--import td:nth-child(3) { display: table-cell; }
}
@media (max-width: 480px) {
	.ndh-import__map { flex-direction: column; align-items: stretch; }
	.ndh-import__map select { width: 100%; min-width: 0; }
	.ndh-import__bar .ndh-form__actions { flex-wrap: wrap; }
}
