:root {
    --black: #0a0a0a;
    --ink: #181818;
    --muted: #696969;
    --soft: #f4f4f4;
    --paper: #f7f7f7;
    --card: #ffffff;
    --line: #dedede;
    --line-strong: #c7c7c7;
    --sidebar: #111111;
    --sidebar-muted: #a8a8a8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 15px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, .button, input, select, textarea { font: inherit; }

button, .button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    cursor: pointer;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    font-weight: 650;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

button:hover, .button:hover { border-color: var(--black); background: var(--soft); }
button:active, .button:active { transform: translateY(1px); }

button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #bdbdbd;
    outline-offset: 2px;
}

.primary { border-color: var(--black); background: var(--black); color: #fff; }
.primary:hover { background: #303030; color: #fff; }

.skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    background: #fff;
    color: #000;
    transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }
.mobile-appbar { display: none; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    width: 252px;
    flex-direction: column;
    padding: 30px 22px 22px;
    background: var(--sidebar);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 17px;
    letter-spacing: -.01em;
}

.brand span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 9px;
    background: #fff;
    color: #000;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.sidebar nav { display: grid; gap: 6px; margin-top: 44px; }

.nav-label {
    margin: 0 10px 9px;
    color: #777;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--sidebar-muted);
    font-weight: 600;
}

.sidebar nav a:hover { background: #1c1c1c; color: #fff; }
.sidebar nav a.active { background: #fff; color: #000; }

.nav-icon {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 6px;
}

.nav-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.sidebar-footer {
    display: grid;
    gap: 14px;
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid #2b2b2b;
}

.session-user { display: flex; align-items: center; gap: 10px; }

.session-user > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #2d2d2d;
    font-size: 12px;
    font-weight: 800;
}

.session-user div { display: grid; }
.session-user strong { font-size: 13px; }
.session-user small { color: #858585; font-size: 11px; }
.logout button { width: 100%; border-color: #3a3a3a; background: transparent; color: #c8c8c8; }
.logout button:hover { border-color: #777; background: #1e1e1e; color: #fff; }

.main {
    max-width: 1500px;
    min-height: 100vh;
    margin-left: 252px;
    padding: 44px clamp(28px, 4vw, 68px) 72px;
}

.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }

.topbar h1 {
    margin: 5px 0 0;
    color: var(--black);
    font-size: clamp(30px, 3vw, 42px);
    font-weight: 760;
    letter-spacing: -.04em;
    line-height: 1.1;
}

.topbar p { max-width: 650px; margin: 10px 0 0; color: var(--muted); }

.eyebrow, .section-kicker {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.page-nav {
    display: flex;
    gap: 7px;
    margin: -4px 0 20px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.page-nav a {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #555;
    font-size: 12px;
    font-weight: 650;
}

.page-nav a:hover { border-color: #999; color: #000; }

.card {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.card h2, .card h3 {
    margin: 3px 0 6px;
    color: var(--black);
    font-family: inherit;
    font-weight: 730;
    letter-spacing: -.025em;
}

.card h2 { font-size: 22px; }
.card h3 { font-size: 18px; }
.card > p, .card-heading p, .section-title p { margin: 0; color: var(--muted); }
.card-heading { margin-bottom: 20px; }

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stats article {
    position: relative;
    min-height: 148px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.stat-heading { display: flex; align-items: center; gap: 9px; }
.stat-icon {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--soft);
    color: #555;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}
.stats article.warning .stat-icon { border-color: #111; background: #111; color: #fff; }

.stats article::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #d9d9d9;
    content: "";
}

.stats article.warning::before { background: #111; }
.stat-label { display: block; color: #484848; font-size: 13px; font-weight: 650; }

.stats strong {
    display: block;
    margin: 11px 0 7px;
    color: #000;
    font-size: 34px;
    font-weight: 750;
    letter-spacing: -.05em;
    line-height: 1;
}

.stats small { color: var(--muted); font-size: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.dashboard-heading { align-items: flex-end; }
.section-count {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}
.section-actions { align-items: flex-end; }
.button-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.table-wrap { margin: 0 -8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line-strong);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-align: left;
    text-transform: uppercase;
}

td { padding: 16px 12px; border-bottom: 1px solid #ededed; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafafa; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.provider-name { color: var(--black); }
.providers-table table { min-width: 760px; }
.providers-mobile-list { display: none; }

.provider-identity { display: flex; align-items: center; gap: 11px; }
.provider-identity > span:last-child { display: grid; }

.provider-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #d1d1d1;
    border-radius: 50%;
    background: #ededed;
    color: #222;
    font-size: 13px;
    font-weight: 800;
}

.provider-avatar.large { width: 48px; height: 48px; flex-basis: 48px; font-size: 16px; }
.provider-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.clients-table table { min-width: 720px; }
.clients-mobile-list { display: none; }

.client-identity { display: flex; align-items: center; gap: 11px; }
.client-identity > span:last-child { display: grid; }
.client-link:hover strong, .client-link:focus-visible strong { text-decoration: underline; }

.client-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #d1d1d1;
    border-radius: 50%;
    background: #ededed;
    color: #222;
    font-size: 13px;
    font-weight: 800;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f5f5f5;
    color: #444;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.is-complete { border-color: #111; background: #111; color: #fff; }

.more-button { gap: 8px; min-height: 34px; padding: 6px 10px; font-size: 11px; }
.more-button span:last-child { font-size: 18px; font-weight: 400; line-height: 1; }

.compact-control {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) auto;
    min-width: 170px;
    gap: 6px;
}

.compact-control select { min-width: 0; }
.compact-control button, .compact-button, .availability-control button { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.compact-control select { min-height: 34px; padding: 6px 8px; font-size: 11px; }

.license-cell { display: grid; justify-items: start; gap: 8px; }

.availability-control { display: grid; justify-items: start; gap: 7px; }

.availability-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; }
.availability-status span { width: 7px; height: 7px; border-radius: 50%; background: #444; }

.license-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.license-status-icon {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #f4f4f4;
    color: #777;
    font-size: 11px;
    font-weight: 800;
}

.license-status.has-license { color: var(--ink); }
.license-status.has-license .license-status-icon { border-color: #111; background: #111; color: #fff; }
.ticket-link { display: inline-flex; align-items: center; gap: 7px; color: var(--black); }

.ticket-link span {
    color: var(--muted);
    font-size: 11px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .15s ease, transform .15s ease;
}

tr:hover .ticket-link span, .ticket-link:focus-visible span { opacity: 1; transform: translateX(0); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid #d7d7d7;
    border-radius: 999px;
    background: #f1f1f1;
    color: #333;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.badge::before { width: 6px; height: 6px; border-radius: 50%; background: #777; content: ""; }
.badge.danger { border-color: #111; background: #111; color: #fff; }
.badge.danger::before { background: #fff; }
.ticket-actions { width: 1%; white-space: nowrap; }
.ticket-actions form { display: inline; }
.ticket-actions .icon-button { vertical-align: middle; }
.dashboard-mobile-list { display: none; }
.dashboard-mobile-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 16px; border-bottom: 1px solid #ededed; }
.dashboard-mobile-card:hover { background: #fafafa; }
.dashboard-mobile-main { display: grid; min-width: 0; gap: 2px; }
.dashboard-mobile-main strong { color: var(--black); font-size: 14px; }
.dashboard-mobile-main span, .dashboard-mobile-main small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-mobile-side { display: flex; align-items: center; gap: 8px; }
.dashboard-mobile-side .badge { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
.mobile-chevron { color: #777; font-size: 26px; font-weight: 300; line-height: 1; }
.row-actions { width: 1%; white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions .icon-button { vertical-align: middle; }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.icon-button.danger:hover { border-color: #111; background: #111; color: #fff; }
.empty { padding: 40px !important; color: var(--muted); text-align: center; }
.empty strong, .empty span { display: block; }
.empty strong { margin-bottom: 4px; color: var(--ink); }
.empty.compact { padding: 30px 12px !important; border: 1px dashed var(--line-strong); border-radius: 8px; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.back-link { display: inline-block; margin: -8px 0 18px; color: var(--muted); font-size: 13px; font-weight: 650; }
.back-link:hover { color: #000; }
.value-pending { color: var(--muted); font-weight: 600; }

.ticket-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    padding: 28px;
}

.ticket-head > div:first-child { max-width: 780px; }
.ticket-head h2 { margin-top: 14px; font-size: 28px; }
.ticket-head p { font-size: 16px; }

.action-box {
    min-width: 230px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--soft);
}

.action-box span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.action-box strong { display: block; margin-top: 5px; }
.ticket-head-actions { display: grid; min-width: 230px; gap: 10px; }

.round-timer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}

.round-timer-copy { display: grid; }
.round-timer-copy > span, .round-timer-copy > small { color: var(--muted); font-size: 10px; font-weight: 700; }
.round-timer-copy > span { letter-spacing: .08em; text-transform: uppercase; }
.round-timer time { color: var(--black); font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 780; letter-spacing: -.03em; line-height: 1.15; }
.round-timer.is-expired time { color: var(--muted); }
.round-timer .round-advance { flex: 0 0 auto; }
.round-timer.compact { min-width: 174px; padding: 9px 10px; background: var(--soft); }
.round-timer.compact time { font-size: 18px; }
.round-timer.compact .round-timer-copy > small { max-width: 112px; line-height: 1.2; }
dl { display: grid; grid-template-columns: 125px 1fr; gap: 0; margin: 0; }
dt, dd { padding: 10px 0; border-bottom: 1px solid #ededed; }
dt { color: var(--muted); }
dd { margin: 0; color: var(--ink); font-weight: 620; }

.offer, .list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid #ededed;
}

.offer:last-child, .list > div:last-child { border-bottom: 0; }
.offer small, .list small { display: block; margin-top: 2px; color: var(--muted); }
.timeline { margin: 22px 0 0 5px; border-left: 1px solid var(--line-strong); }
.timeline > div { position: relative; padding: 0 0 24px 24px; }
.timeline > div:last-child { padding-bottom: 4px; }

.timeline > div::before {
    position: absolute;
    top: 5px;
    left: -5px;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #333;
    box-shadow: 0 0 0 1px #333;
    content: "";
}

.timeline time, .timeline small { display: block; color: var(--muted); font-size: 11px; }
.timeline strong { display: block; margin: 2px 0; }

.messages {
    display: flex;
    max-height: 560px;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding: 4px;
}

.message { max-width: 82%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.message.saliente { margin-left: auto; border-color: #222; background: #222; color: #fff; }
.message small { color: #777; font-size: 10px; }
.message.saliente small { color: #bdbdbd; }
.message p { margin: 5px 0 0; white-space: pre-line; }
.messages.compact { max-height: 430px; }
.form-grid { display: grid; gap: 14px; margin-top: 18px; }
.form-grid.columns { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }

.form-grid label, .stack label {
    display: grid;
    gap: 6px;
    color: #505050;
    font-size: 12px;
    font-weight: 700;
}

input, select, textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
}

input:hover, select:hover, textarea:hover { border-color: #999; }
select[multiple] { min-height: 112px; }
.check { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center !important; }
.check input { width: auto; min-height: 0; }
.inline { display: flex; align-items: center; gap: 9px; }
.inline input, .inline select { width: auto; min-width: 145px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.list { margin-top: 22px; border-top: 1px solid var(--line); }

.settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.settings form { display: flex; align-items: end; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; }
.settings label { flex: 1; }
.mini-card { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; box-shadow: none; }
.mini-card small { display: block; margin-bottom: 8px; color: var(--muted); }
.mini-card button { margin-top: 8px; }
.top-gap { margin-top: 18px; }
.muted { color: var(--muted); }

.notice {
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid var(--line-strong);
    border-left: 4px solid #333;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}

.notice.success { border-left-color: #777; }
.notice.error { border-left-color: #000; background: #f1f1f1; }
.notice ul { margin: 6px 0 0; }
.agent-password-notice p { margin: 6px 0 0; }
.agent-password-value { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.agent-password-value code { padding: 9px 11px; overflow-wrap: anywhere; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--black); font-size: 13px; }
.agent-integration-actions { display: grid; gap: 14px; }
.agent-integration-actions p { margin: 0; }
.agent-warning { max-width: 680px; color: var(--ink); font-weight: 650; }
.agent-status-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; }
.agent-status-list div { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; }
.agent-status-list dt { margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.agent-status-list dd { margin: 0; color: var(--ink); font-weight: 650; }
.agent-status-list dd small { display: block; margin-top: 7px; color: var(--muted); font-weight: 400; }
.agent-history-heading > .status-pill { flex: 0 0 auto; }
.agent-message-history { display: grid; gap: 12px; }
.agent-message-item { padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; }
.agent-message-header, .agent-message-meta, .agent-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.agent-message-header > div:first-child { display: grid; gap: 4px; }
.agent-message-header time { color: var(--muted); font-size: 11px; font-weight: 650; }
.agent-message-header strong { color: var(--ink); font-size: 13px; }
.agent-message-badges, .agent-pagination div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.status-pill.is-failed { border-color: #111; background: #e8e8e8; color: #111; }
.agent-message-preview { margin: 15px 0; color: var(--ink); line-height: 1.55; overflow-wrap: anywhere; }
.agent-message-meta { padding-top: 13px; border-top: 1px solid #e5e5e5; font-size: 12px; }
.agent-message-error { margin: 13px 0 0; padding: 10px 12px; border-left: 3px solid #111; background: #efefef; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.agent-pagination { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.agent-pagination a, .agent-pagination div > span, .agent-pagination div > strong { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 700; }
.agent-pagination a:hover, .agent-pagination a:focus-visible { border-color: #111; }
.agent-pagination div > span { color: #999; }
.agent-pagination div > strong { border-color: #111; background: #111; color: #fff; }
.photo-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: #111;
}

.login-card {
    width: min(420px, 100%);
    padding: 36px;
    border: 1px solid #333;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
}

.login-card > p { margin: 22px 0; color: var(--muted); }
.login-brand { color: var(--ink); }
.login-brand span { background: #111; color: #fff; }
.stack { display: grid; gap: 16px; }

.admin-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.provider-dialog { width: min(820px, calc(100vw - 32px)); }
.invite-dialog { width: min(500px, calc(100vw - 32px)); }

.admin-dialog::backdrop { background: rgba(0, 0, 0, .58); backdrop-filter: blur(2px); }

.dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.dialog-header h2 { margin: 4px 0 5px; font-size: 23px; letter-spacing: -.03em; }
.dialog-header p { margin: 0; color: var(--muted); }
.sticky-dialog-header { position: sticky; z-index: 2; top: 0; background: #fff; }
.invite-form { display: grid; gap: 15px; padding: 24px; }
.invite-form label { display: grid; gap: 6px; color: #505050; font-size: 12px; font-weight: 700; }
.invite-copy { margin: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); color: #4b4b4b; font-size: 12px; line-height: 1.55; }
.invite-form .dialog-actions { margin-top: 4px; }
.provider-dialog-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.provider-dialog-title > div { min-width: 0; }
.provider-dialog-title p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-button {
    width: 36px;
    min-height: 36px;
    flex: 0 0 36px;
    padding: 0;
    border-radius: 50%;
    color: #555;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
}

.license-list { display: grid; gap: 9px; padding: 20px 24px 0; }

.license-record {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fafafa;
}

.license-record-icon {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.license-record div { display: grid; gap: 2px; }
.license-record span { color: #444; font-size: 13px; }
.license-record small { color: var(--muted); font-size: 11px; }

.dialog-form {
    margin: 20px 24px 24px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--soft);
}

.dialog-form-heading { display: grid; gap: 2px; }
.dialog-form-heading strong { color: var(--black); font-size: 16px; }
.dialog-form-heading span { color: var(--muted); font-size: 12px; }

.providers-heading { align-items: flex-end; margin-bottom: 18px; }
.providers-heading .card-heading { margin: 0; }

.profile-summary { display: flex; flex-wrap: wrap; gap: 7px; padding: 16px 24px 0; }

.profile-alert {
    display: grid;
    gap: 2px;
    margin: 16px 24px 0;
    padding: 12px 14px;
    border: 1px solid #bdbdbd;
    border-radius: 9px;
    background: #f1f1f1;
}

.profile-alert strong { font-size: 13px; }
.profile-alert span { color: var(--muted); font-size: 12px; }
.profile-alert.form-errors { margin: 16px 0 0; }
.profile-form { padding: 0 24px 24px; }

.profile-form-section {
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.profile-section-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }

.profile-section-heading > span {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
}

.profile-section-heading div { display: grid; gap: 1px; }
.profile-section-heading strong { font-size: 15px; }
.profile-section-heading small { color: var(--muted); font-size: 11px; }

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.profile-form-grid label {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    color: #505050;
    font-size: 12px;
    font-weight: 700;
}

.profile-form-grid label > input,
.profile-form-grid label > select,
.profile-form-grid label > textarea { grid-column: 1 / -1; }
.field-wide { grid-column: 1 / -1; }
.optional { color: #8a8a8a; font-size: 10px; font-weight: 600; }
textarea { resize: vertical; }

.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 20px; }
.profile-block { margin: 0 24px 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.profile-block-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.profile-block-heading h3, .availability-block h3 { margin: 3px 0 0; font-size: 18px; }
.profile-block .license-list { padding: 16px 0 0; }
.profile-block .dialog-form { margin: 16px 0 0; }
.dni-document-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.dni-document-links a, .dni-document-links span { display: inline-flex; min-height: 42px; align-items: center; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 700; }
.dni-document-links a { background: #fff4ed; color: #a6471c; }
.dni-document-links a:hover { border-color: #df8854; }
.dni-document-links span { color: var(--muted); }

.availability-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafafa;
}

.availability-block p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 1050px) {
    .form-grid.columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    table { min-width: 820px; }
}

@media (max-width: 780px) {
    body { background: #fff; padding: 60px 0 84px; }
    .mobile-appbar {
        position: fixed;
        z-index: 20;
        inset: 0 0 auto;
        display: flex;
        height: 60px;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(12px);
    }

    .mobile-brand { display: flex; align-items: center; gap: 9px; font-size: 14px; }
    .mobile-brand span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 8px; background: #111; color: #fff; font-size: 11px; font-weight: 850; }
    .mobile-appbar button { min-height: 34px; padding: 6px 10px; font-size: 11px; }
    .sidebar {
        z-index: 20;
        inset: auto 0 0;
        width: auto;
        height: 76px;
        padding: 7px max(12px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
        border-top: 1px solid #282828;
    }

    .sidebar .brand, .nav-label, .sidebar-footer { display: none; }
    .sidebar nav { display: flex; gap: 4px; margin: 0; overflow: visible; }
    .sidebar nav a { min-width: 0; flex: 1 1 0; flex-direction: column; gap: 3px; padding: 6px 3px; font-size: 9px; line-height: 1.1; text-align: center; }
    .nav-icon { width: 26px; height: 26px; flex-basis: 26px; border: 0; }
    .nav-icon svg { width: 20px; height: 20px; }
    .main { margin: 0; padding: 24px 16px 20px; }
    .topbar { margin-bottom: 20px; }
    .topbar .eyebrow { display: none; }
    .topbar h1 { margin: 0; font-size: 27px; }
    .topbar p { margin-top: 7px; font-size: 13px; }
    .page-nav { margin-top: -8px; }
    #oficios, #zonas, #plazos { scroll-margin-top: 72px; }
    .grid.two, .stats, .form-grid.columns, .settings { grid-template-columns: 1fr; }
    .card { margin: 0 -16px 14px; padding: 20px 16px; border-width: 1px 0; border-radius: 0; box-shadow: none; }
    .agent-status-list { grid-template-columns: 1fr; }
    .agent-message-header, .agent-message-meta, .agent-pagination { align-items: flex-start; flex-direction: column; }
    .agent-message-badges { margin-top: 4px; }
    .agent-pagination div { width: 100%; }
    .agent-pagination div > * { flex: 1; text-align: center; }
    .stats article { min-height: auto; }
    .ticket-head, .section-title { align-items: flex-start; flex-direction: column; }
    .dashboard-heading { gap: 10px; }
    .section-count { align-self: flex-start; }
    .section-actions > .primary { width: 100%; }
    .section-actions .button-group { width: 100%; }
    .section-actions .button-group button { flex: 1; }
    .providers-heading { width: 100%; gap: 14px; }
    .providers-heading button { width: 100%; }
    .action-box, .ticket-head-actions { width: 100%; min-width: 0; }
    .row, .inline { flex-wrap: wrap; }
    .providers-table { display: none; }
    .providers-mobile-list { display: grid; margin: 0 -16px -20px; border-top: 1px solid var(--line); }

    .clients-table { display: none; }
    .clients-mobile-list { display: grid; margin: 0 -16px -20px; border-top: 1px solid var(--line); }
    .dashboard-table { display: none; }
    .dashboard-mobile-list { display: grid; margin: 0 -16px -20px; border-top: 1px solid var(--line); }

    .client-mobile-card {
        display: grid;
        min-height: 72px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 11px;
        align-items: center;
        padding: 13px 16px;
        border-bottom: 1px solid #ededed;
    }

    .client-mobile-copy { display: grid; min-width: 0; }
    .client-mobile-copy strong, .client-mobile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .client-mobile-copy strong { font-size: 14px; }
    .client-mobile-copy small { color: var(--muted); font-size: 11px; font-weight: 500; }
    .client-mobile-row { display: flex; align-items: stretch; border-bottom: 1px solid #ededed; }
    .client-mobile-row .client-mobile-card { flex: 1; border-bottom: 0; }
    .client-mobile-row form { display: grid; place-items: center; padding-right: 12px; }

    .mobile-home {
        display: grid;
        width: 26px;
        height: 26px;
        place-items: center;
        border: 1px solid var(--line-strong);
        border-radius: 50%;
        background: #f4f4f4;
        color: #8a8a8a;
    }

    .mobile-home svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
    .mobile-home.has-address { border-color: #111; background: #111; color: #fff; }

    .provider-mobile-card {
        display: grid;
        width: 100%;
        min-height: 72px;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        gap: 11px;
        align-items: center;
        padding: 13px 16px;
        border: 0;
        border-bottom: 1px solid #ededed;
        border-radius: 0;
        background: #fff;
        text-align: left;
    }

    .provider-mobile-card:hover { background: #f8f8f8; }
    .provider-mobile-row { display: flex; align-items: stretch; border-bottom: 1px solid #ededed; }
    .provider-mobile-row .provider-mobile-card { flex: 1; border-bottom: 0; }
    .provider-mobile-row form { display: grid; place-items: center; padding-right: 12px; }
    .provider-mobile-copy { display: grid; min-width: 0; }
    .provider-mobile-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
    .provider-mobile-copy small { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

    .mobile-license {
        display: grid;
        width: 26px;
        height: 26px;
        place-items: center;
        border: 1px solid var(--line-strong);
        border-radius: 50%;
        background: #f4f4f4;
        color: #8a8a8a;
        font-size: 11px;
    }

    .mobile-license.has-license { border-color: #111; background: #111; color: #fff; }
    .mobile-chevron { color: #777; font-size: 26px; font-weight: 300; }

    .admin-dialog.provider-dialog {
        inset: auto 0 0;
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - 10px);
        margin: 0;
        border-width: 1px 0 0;
        border-radius: 18px 18px 0 0;
    }

    .dialog-header { position: sticky; z-index: 2; top: 0; padding: 17px 16px; background: #fff; }
    .dialog-header h2 { font-size: 20px; }
    .dialog-header p { font-size: 12px; }
    .provider-avatar.large { width: 42px; height: 42px; flex-basis: 42px; }
    .profile-summary { padding: 14px 16px 0; }
    .profile-alert { margin: 14px 16px 0; }
    .profile-form { padding: 0 16px 20px; }
    .profile-form-section { padding: 19px 0; }
    .profile-form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .profile-block { margin: 0 16px 20px; }
    .profile-block-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
    .license-list { padding: 16px 0 0; }
    .dialog-form { margin: 16px 0 0; padding: 16px; }
    .dialog-form .row { display: grid; grid-template-columns: 1fr; }
    .dialog-actions { position: sticky; bottom: 0; margin: 0 -16px -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); }
    .dialog-actions button { flex: 1; }
    .availability-block { align-items: stretch; flex-direction: column; }
    .availability-block button { width: 100%; }
    dl { grid-template-columns: 1fr; }
    dt { padding-bottom: 1px; border-bottom: 0; }
    dd { padding-top: 1px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
