/* ==========================================================================
   Panel Mania Network
   Paleta corporativa en variables: cambia aquí y cambia en todo el panel.
   ========================================================================== */

:root {
    --blue: #0774FF;
    --blue-600: #0559D9;
    --ink: #2D3C58;
    --gradient: linear-gradient(259deg, #006CF5 7.09%, #0559D9 71.14%);
    --yellow: #FFC107;
    --muted: #4C5671;
    --bg: #F6F9FF;
    --border: #E9EDFF;
    --white: #FFFFFF;

    --blue-soft: #E8F1FF;
    --green: #15803D;
    --green-soft: #E7F6EC;
    --red: #D92D20;
    --red-soft: #FDECEA;
    --yellow-soft: #FFF6DA;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(45, 60, 88, .04), 0 8px 24px rgba(45, 60, 88, .06);
    --sidebar-width: 260px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--ink); }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.link { font-size: 14px; font-weight: 600; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.icon { width: 20px; height: 20px; flex-shrink: 0; }

:focus-visible { outline: 3px solid rgba(7, 116, 255, .35); outline-offset: 2px; }

/* ---------- Layout del panel ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    /* Azul marino oscuro: más contraste que el degradado para leer un menú largo */
    background: #10204A;
    background-image: linear-gradient(180deg, #13295C 0%, #0E1C40 100%);
    color: var(--white);
    padding: 20px 12px;
    transition: transform .25s ease;
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px 20px;
}
.sidebar__brand img { width: 150px; }
.sidebar__close { display: none; color: var(--white); }

.sidebar__brand, .sidebar__footer { flex-shrink: 0; }

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.sidebar__nav > * { flex-shrink: 0; }
.sidebar__nav::-webkit-scrollbar { width: 5px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 999px; }
.sidebar__nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .45); }

/* Grupos plegables */
.nav-group { border-radius: var(--radius-sm); }
.nav-group[open] { background: rgba(255, 255, 255, .045); padding-bottom: 6px; }
.nav-group__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
}
.nav-group__head::-webkit-details-marker { display: none; }
.nav-group__head:hover { background: rgba(255, 255, 255, .09); }
.nav-group__head .icon { color: #8FB8FF; }
.nav-group.has-active > .nav-group__head .icon { color: var(--yellow); }
.nav-group__chevron { width: 15px; height: 15px; margin-left: auto; flex-shrink: 0; color: rgba(255, 255, 255, .55); transition: transform .2s; }
.nav-group[open] > .nav-group__head .nav-group__chevron { transform: rotate(90deg); }
.nav-group__badge { margin-left: auto; }
.nav-group__badge + .nav-group__chevron { margin-left: 8px; }
.nav-group[open] .nav-group__badge { display: none; }
.nav-group[open] .nav-group__badge + .nav-group__chevron { margin-left: auto; }
.nav-group__items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 6px 0 22px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .14);
}
.nav-group__items .nav-link { padding: 8px 10px; font-size: 14px; }
.nav-group__items .nav-link .icon { width: 18px; height: 18px; }
.nav-group--muted > .nav-group__head { color: rgba(255, 255, 255, .55); font-weight: 600; }
.nav-group--muted > .nav-group__head .icon { color: rgba(255, 255, 255, .45); }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .82);
    font-weight: 500;
}
.nav-link--top { font-weight: 700; color: #FFFFFF; }
.nav-link--top .icon { color: #8FB8FF; }
.nav-link:hover { background: rgba(255, 255, 255, .1); color: var(--white); text-decoration: none; }
.nav-link.is-active { background: var(--blue); color: var(--white); font-weight: 700; box-shadow: 0 6px 16px rgba(7, 116, 255, .35); }
.nav-link.is-active .icon { color: var(--white); }
.nav-link.is-disabled { opacity: .45; cursor: default; }
.nav-link.is-disabled:hover { background: none; }

.sidebar__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 0;
    border-top: 1px solid rgba(255, 255, 255, .15);
    font-size: 12px;
    color: rgba(255, 255, 255, .7);
}
.sidebar__footer img { width: 26px; filter: brightness(0) invert(1); opacity: .8; }

.sidebar-backdrop { display: none; }

.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 68px;
    padding: 0 28px;
    background: rgba(246, 249, 255, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar__menu { display: none; }
.topbar__title { font-size: 20px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__user { display: flex; align-items: center; gap: 6px; }
.topbar__user form { margin: 0; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 600;
    font-size: 14px;
}
.user-chip:hover { background: var(--white); text-decoration: none; }

.content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-footer { padding: 16px 28px 24px; font-size: 13px; color: var(--muted); }

/* ---------- Componentes ---------- */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar--soft { background: var(--blue-soft); color: var(--blue-600); }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover { background: var(--blue-soft); color: var(--blue); }
.icon-btn--danger:hover { background: var(--red-soft); color: var(--red); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--blue); color: var(--white); box-shadow: 0 6px 16px rgba(7, 116, 255, .25); }
.btn--primary:hover { background: var(--blue-600); }
.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card--flush { padding: 0; overflow: hidden; }
.card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 18px;
}
.card__header h3 { font-size: 16px; font-weight: 700; }
.card__header form { margin: 0; }
.card__header .muted { flex-basis: 100%; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge--yellow { background: var(--yellow); color: var(--ink); }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--gray { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge--light { background: rgba(255, 255, 255, .18); color: var(--white); }

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert > span { flex: 1; }
.alert--success { background: var(--green-soft); color: var(--green); border-color: #C8EBD4; }
.alert--error { background: var(--red-soft); color: var(--red); border-color: #F8CFCB; }
.alert--info { background: var(--blue-soft); color: var(--blue-600); border-color: #CFE2FF; }
.alert__close { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; display: flex; opacity: .7; }
.alert__close:hover { opacity: 1; }
.alert__close .icon { width: 16px; height: 16px; }

/* ---------- Formularios ---------- */

.form { display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.card .form { gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--ink); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"],
input[type="tel"], input[type="date"], select, textarea {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 14px; resize: vertical; line-height: 1.5; }
input[type="file"] { font: inherit; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(7, 116, 255, .12); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); }

.field__hint { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12px; font-weight: 600; color: var(--red); margin-top: 4px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }

.password-input { position: relative; }
.password-input input { padding-right: 46px; }
.password-input__toggle {
    position: absolute; top: 3px; right: 3px;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.password-input__toggle:hover, .password-input__toggle.is-on { color: var(--blue); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--blue); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.choice > span { display: flex; flex-direction: column; gap: 2px; }
.choice.is-disabled { opacity: .55; cursor: not-allowed; }

.check { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }

input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); flex-shrink: 0; }

.switch { display: inline-flex; align-items: center; gap: 12px; margin-top: 20px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
    position: relative; width: 42px; height: 24px; border-radius: 999px;
    background: #C9D3EA; transition: background .15s; flex-shrink: 0;
}
.switch__track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: var(--white); transition: transform .15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + .switch__track { background: var(--blue); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid rgba(7, 116, 255, .35); outline-offset: 2px; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.perm-grid .card__header { margin-bottom: 8px; }

/* ---------- Listados ---------- */

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

.search { position: relative; flex: 1; max-width: 380px; margin: 0; }
.search .icon { position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; color: var(--muted); }
.search input { padding-left: 40px; }

.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFCFF; }
.table td .badge + .badge { margin-left: 4px; }
.table__actions { text-align: right; white-space: nowrap; width: 1%; }
.table__actions form { display: inline; margin: 0; }

.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user > div { display: flex; flex-direction: column; min-width: 0; }
.cell-user .muted { font-size: 13px; }

.list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.pagination { display: flex; align-items: center; gap: 6px; }
.pagination__info { font-size: 13px; color: var(--muted); padding: 0 6px; }
.pagination__link {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--white); border: 1px solid var(--border); color: var(--ink);
}
.pagination__link:hover { border-color: var(--blue); color: var(--blue); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list__item:last-child { border-bottom: 0; padding-bottom: 0; }
.list__item:first-child { padding-top: 0; }
.list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list__body .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Dashboard ---------- */

.hero-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    border-radius: var(--radius);
    background: var(--gradient);
    color: var(--white);
}
.hero-card h2 { color: var(--white); font-size: 28px; margin: 4px 0 14px; }
.hero-card__eyebrow { font-size: 13px; font-weight: 600; color: var(--yellow); text-transform: uppercase; letter-spacing: .08em; }
.hero-card__seal { width: 110px; filter: brightness(0) invert(1); opacity: .18; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stat--link { color: var(--ink); transition: border-color .15s; }
.stat--link:hover { text-decoration: none; border-color: var(--blue); }
.stat__icon {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: var(--blue-soft); color: var(--blue);
}
.stat__value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat__label { font-size: 13px; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }

.roadmap { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.roadmap li {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0 0 16px 40px;
    counter-increment: step;
}
.roadmap li::before {
    content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: var(--bg); border: 1px solid var(--border); color: var(--muted);
}
.roadmap li:not(:last-child)::after {
    content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 1px; background: var(--border);
}
.roadmap li.is-done::before { content: "✓"; background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.roadmap span { font-size: 13px; color: var(--muted); }

/* ---------- Login y páginas sin sesión ---------- */

.auth-page { min-height: 100vh; }

.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }

.login__hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    background: var(--gradient);
    color: var(--white);
}
.login__hero-logo { width: 190px; }
.login__hero h2 { color: var(--white); font-size: 36px; margin-bottom: 12px; }
.login__hero p { max-width: 380px; color: rgba(255, 255, 255, .85); font-size: 17px; }
.login__hero-accent {
    position: absolute; right: -80px; bottom: -80px;
    width: 280px; height: 280px; border-radius: 50%;
    border: 40px solid var(--yellow); opacity: .9;
}

.login__form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--white); }
.login__form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login__form h1 { font-size: 26px; }
.login__form > .muted { margin-top: -12px; }
.login__logo { width: 150px; margin-bottom: 12px; display: none; }

.error-page {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
}
.layout-auth .error-page { min-height: 100vh; }
.error-page__seal { width: 64px; }
.error-page__code { font-size: 64px; font-weight: 800; line-height: 1; color: var(--blue); }
.error-page h1 { font-size: 24px; }
.error-page .btn { margin-top: 12px; }

/* ---------- Comerciales (CRM) ---------- */

.block { display: block; }
.nowrap { white-space: nowrap; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.code-inline {
    display: inline-block; max-width: 100%; padding: 6px 10px; border-radius: 8px;
    background: var(--bg); border: 1px solid var(--border); word-break: break-all;
}
.code-inline--select { display: block; margin-top: 8px; user-select: all; background: var(--white); color: var(--ink); }

.badge--purple { background: #F1ECFF; color: #6D3FD8; }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--orange { background: #FFF1E6; color: #C2570C; }

.score {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    min-width: 36px; height: 28px; padding: 0 8px; border-radius: 999px;
    font-size: 13px; font-weight: 800;
}
.score--high { background: var(--yellow); color: var(--ink); }
.score--mid { background: var(--blue-soft); color: var(--blue-600); }
.score--low { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filters .search { flex: 1 1 240px; }
.filters select, .filters input[type="date"] { width: auto; flex: 0 1 auto; }

.cell-link { display: flex; flex-direction: column; color: var(--ink); }
.cell-link:hover { text-decoration: none; }
.cell-link:hover strong { color: var(--blue); }
.cell-link .muted { font-size: 13px; }

.card__header--padded { padding: 18px 20px 0; margin-bottom: 14px; }
.card--accent { border-color: #CFE2FF; box-shadow: 0 0 0 3px rgba(7, 116, 255, .06), var(--shadow); }

.lead-head { display: grid; grid-template-columns: 1fr auto; gap: 14px 16px; align-items: start; }
.lead-head__main { display: flex; flex-direction: column; gap: 8px; }
.lead-head__meta { font-size: 14px; color: var(--muted); }
.lead-head .score { height: 40px; min-width: 52px; font-size: 18px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.quick-actions form { margin: 0; }

.points { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.points__item { position: relative; padding: 10px 12px 10px 34px; border-radius: var(--radius-sm); font-size: 14px; background: var(--bg); }
.points__item::before { position: absolute; left: 12px; top: 10px; font-weight: 800; }
.points__item--high { background: var(--red-soft); color: #9A1F16; }
.points__item--high::before { content: "!"; color: var(--red); }
.points__item--medium { background: #FFF6DA; color: #7A5A00; }
.points__item--medium::before { content: "•"; color: #C99700; }
.points__item--good { background: var(--green-soft); color: var(--green); }
.points__item--good::before { content: "✓"; }
.points__item--info::before { content: "i"; color: var(--blue); font-style: italic; }
.points--compact { margin: 10px 0 0; }
.points--compact .points__item { font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
.points--compact .points__item::before { top: 7px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 10px; }
.metric { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: var(--radius-sm); text-align: center; }
.metric strong { font-size: 22px; line-height: 1.1; }
.metric span { font-size: 11px; color: var(--muted); }
.metric--good { background: var(--green-soft); color: var(--green); }
.metric--mid { background: #FFF6DA; color: #9A7000; }
.metric--bad { background: var(--red-soft); color: var(--red); }

details.collapse { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
details.collapse > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--blue); list-style: none; }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary::before { content: "+ "; }
details.collapse[open] > summary::before { content: "− "; }
details.collapse[open] > summary { margin-bottom: 14px; }
.card form details.collapse { margin-top: 0; }

.table--compact td, .table--compact th { padding: 10px 12px; }

.date-chip {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    min-width: 52px; height: 32px; padding: 0 8px; border-radius: 8px;
    background: var(--blue-soft); color: var(--blue-600); font-size: 13px; font-weight: 700;
}
.date-chip--late { background: var(--red-soft); color: var(--red); }

.note-form { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-bottom: 18px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
    content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--white); border: 2px solid var(--border);
}
.timeline__item--note::before { border-color: var(--blue); background: var(--blue); }
.timeline__item--activity::before { border-color: var(--green); background: var(--green); }
.timeline__meta { font-size: 12px; color: var(--muted); }
.timeline__meta strong { color: var(--ink); font-size: 13px; }
.timeline__body { font-size: 14px; margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.danger-zone { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.btn--danger-text { color: var(--red); }
.btn--danger-text:hover { border-color: var(--red); color: var(--red); }

.route-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.day-nav { display: flex; align-items: center; gap: 6px; margin: 0; flex-wrap: wrap; }
.day-nav input[type="date"], .day-nav select { width: auto; }
.route-summary { display: flex; flex-direction: column; gap: 12px; }
.progress { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress__bar { display: block; height: 100%; width: 0; background: var(--gradient); border-radius: 999px; transition: width .4s; }

.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.stop {
    display: flex; gap: 14px; padding: 18px; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stop__number {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 50%; background: var(--gradient); color: var(--white); font-weight: 800;
}
.stop__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.stop__name { font-size: 17px; font-weight: 700; color: var(--ink); }
.stop__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.stop__actions form { display: flex; gap: 6px; margin: 0 0 0 auto; }
.stop--done { opacity: .6; box-shadow: none; }
.stop--done .stop__number { background: var(--green); }
.stop--skipped { opacity: .55; box-shadow: none; border-style: dashed; }
.stop--skipped .stop__number { background: var(--muted); }

.pick-list { list-style: none; margin: 0; padding: 0; }
.pick-list li + li { border-top: 1px solid var(--border); }
.pick { display: flex; align-items: center; gap: 14px; padding: 14px 20px; cursor: pointer; }
.pick:hover { background: #FBFCFF; }
.pick:has(input:checked) { background: var(--blue-soft); }
.pick.is-disabled { cursor: default; opacity: .7; }
.pick input { width: 22px; height: 22px; margin: 0; }
.pick__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.sticky-actions {
    position: sticky; bottom: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -8px 24px rgba(45, 60, 88, .08);
}

.token-box { align-items: flex-start; margin: 14px 0; }
.token-box > div { flex: 1; min-width: 0; }
.inline-form { display: flex; gap: 8px; margin-top: 14px; }
.inline-form input { flex: 1; }

/* ---------- Clientes y web ---------- */

a.cell-user { color: var(--ink); }
a.cell-user:hover { text-decoration: none; }
a.cell-user:hover strong { color: var(--blue); }
.icon--xs { width: 14px; height: 14px; vertical-align: -2px; }
.subhead { margin: 18px 0 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card__header + .subhead, .alert + .subhead { margin-top: 0; }
.form-grid__full { grid-column: 1 / -1; }
.input-sm { width: 160px; height: 36px; font-size: 13px; padding: 0 10px; flex-shrink: 0; }
.textarea-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.switch--flush { margin-top: 0; margin-bottom: 14px; }
.card .alert { margin-bottom: 16px; }

.thumb { width: 64px; height: 64px; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--white); flex-shrink: 0; }
.thumb--sm { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.thumb--lg { width: 100%; max-width: 260px; height: auto; max-height: 160px; object-fit: contain; }

.choice-grid--compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.choice-grid--compact .choice { padding: 9px 12px; align-items: center; font-size: 14px; }

.tree { display: flex; flex-direction: column; gap: 6px; }
.tree__group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.tree__group > summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tree__group[open] > summary { margin-bottom: 8px; }
.tree__state { padding: 6px 0 6px 12px; border-left: 2px solid var(--border); margin-left: 4px; }
.tree__city { padding-left: 24px; }
.tree__cities { margin-top: 6px; }
.tree .check { padding: 4px 0; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
/* Los hijos de una rejilla no deben ensancharla por su contenido (tablas, textos largos): mejor que se ajusten o desplacen */
.grid-2 > *, .grid-main > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.prose { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 14px; }
.prose h1 { font-size: 30px; line-height: 1.2; }
.prose h2 { font-size: 22px; margin-top: 28px; }
.prose h3 { font-size: 18px; margin-top: 22px; }
.prose h4 { font-size: 16px; margin-top: 18px; }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 0; }
.prose li + li { margin-top: 4px; }
.prose blockquote { margin: 0; padding: 10px 16px; border-left: 4px solid var(--yellow); background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }
.prose figure { margin: 18px 0 0; }
.prose figure img { border-radius: var(--radius-sm); }
.prose figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: center; }
.prose code { background: var(--bg); padding: 2px 6px; border-radius: 6px; }
.prose__cover { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius-sm); }
.prose__lead { font-size: 18px; color: var(--muted); }

.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.popover__body {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; padding: 16px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}

/* ---------- Facturación ---------- */

.num { text-align: right; }
.table th.num { text-align: right; }
.stack--sm { gap: 8px; }
.stack--sm form { margin: 0; }
.stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.text-danger { color: var(--red); }
.stat--alert { border-color: var(--red); }
.stat--alert .stat__icon { background: var(--red-soft); color: var(--red); }

.nav-badge {
    margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; background: var(--yellow); color: var(--ink);
}

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.row-actions form { display: flex; gap: 6px; margin: 0; }
.input-xs { width: 92px; }

/* Editor de facturas */
.inv-lines td { vertical-align: top; }
.inv-lines textarea { margin-top: 8px; min-height: 0; resize: vertical; }
.inv-line__main { min-width: 300px; }
.inv-line__selects { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }
.inv-lines .input-sm { width: 100%; }
.inv-col-sm { width: 86px; }
.inv-col-md { width: 116px; }
.inv-line__amount { padding-top: 18px !important; text-align: right; font-weight: 700; }
.inv-footer { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px 20px; }
.inv-totals { display: grid; grid-template-columns: auto auto; gap: 6px 28px; margin: 0; min-width: 260px; font-size: 14px; }
.inv-totals dt { color: var(--muted); }
.inv-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.inv-totals .inv-totals__grand { padding-top: 8px; border-top: 1px solid var(--border); font-size: 18px; font-weight: 800; color: var(--ink); }
.inv-paid { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.inv-paid__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; margin-top: 10px; }
.inv-paid__fields[hidden] { display: none; }

.prorate-box { margin: 6px 0 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--ink); font-weight: 600; }

/* Pestañas (tarifa): botones que bajan de línea si no caben, nunca barra de scroll */
.tabs {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 6px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tabs__link {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s;
}
.tabs__link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.tabs__link.is-active { background: var(--gradient); color: var(--white); box-shadow: 0 4px 12px rgba(5, 89, 217, .25); }
.tabs__count {
    min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
    font-size: 12px; font-weight: 700; background: var(--bg); color: var(--muted);
}
.tabs__link.is-active .tabs__count { background: rgba(255, 255, 255, .22); color: var(--white); }

/* Precios de dominios (pestaña Dominios) */
.table .col-sep { border-left: 1px solid var(--border); }
.domain-tools { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0 20px 14px; }
.domain-tools__item > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); list-style: none; }
.domain-tools__item > summary::-webkit-details-marker { display: none; }
.domain-tools__item[open] { flex-basis: 100%; }
.domain-tools__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 10px; }
.domain-tools__form .field { margin: 0; min-width: 160px; }
.domain-filters { padding: 0 20px 16px; }
.stat__icon--red { background: var(--red-soft); color: var(--red); }
.fav-col { width: 36px; padding-right: 0 !important; }
.fav-col form { margin: 0; }
.fav-btn { border: 0; background: none; padding: 2px 4px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--border); }
.fav-btn:hover { color: var(--yellow); }
.fav-btn.is-on { color: var(--yellow); }
.domain-picker__date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.domain-picker__date input { width: 150px; }
.domain-picker__track { margin-top: 8px; font-size: 13px; }

.inv-domains { padding: 0 20px 4px; }
.inv-domains--top { padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--border); }
.inv-domains > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); list-style: none; }
.inv-domains > summary::-webkit-details-marker { display: none; }
.domain-picker { margin-top: 10px; }
.domain-picker__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.domain-picker__bar .search { flex: 1 1 260px; }
.domain-picker__results { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.domain-picker__item {
    width: 100%; display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; gap: 12px;
    padding: 10px 12px; text-align: left; font: inherit; color: var(--ink);
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.domain-picker__item:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); }
.domain-picker__item:disabled { opacity: .5; cursor: not-allowed; }
.domain-picker__price { font-weight: 800; white-space: nowrap; }

/* Documentos */
.doc-section { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.doc-section:first-child { padding-top: 0; }
.doc-section__head { display: flex; gap: 8px; align-items: center; }
.doc-section__title { font-weight: 700; }
.doc-section textarea { margin-top: 8px; font-size: 14px; }
.js-sections + .btn { margin-top: 14px; }
.inv-line__extra { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.inv-line__extra .input-sm { width: 140px; }
.inv-lines tr.is-optional td { background: var(--yellow-soft); }
.plan-table td { padding: 6px 0 !important; border: 0 !important; }
.plan-table td + td { padding-left: 10px !important; }
.doc-actions .btn { width: 100%; }
.doc-actions form { margin: 0; }
.input-block { width: 100%; margin-bottom: 8px; }
.new-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.new-docs__item {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; color: var(--ink);
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    transition: border-color .15s, transform .15s;
}
.new-docs__item:hover { border-color: var(--blue); text-decoration: none; transform: translateY(-1px); }
.new-docs__icon { display: inline-flex; padding: 8px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); }
.doc-hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; word-break: break-all; color: var(--muted); }

/* Qué toca hacer */
.nav-badge--red { background: var(--red); color: var(--white); }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius-sm); background: var(--white);
}
.todo--p1 { border-left-color: var(--red); background: #FFFBFA; }
.todo--p2 { border-left-color: #F59E0B; }
.todo--p3 { border-left-color: #C9D2E6; }
.todo__icon { display: inline-flex; padding: 7px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); flex-shrink: 0; }
.todo__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.todo .btn { flex-shrink: 0; }
.todo-client .card__header h3 a { color: var(--ink); }

/* Recorrido del cliente */
.journey { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 0; counter-reset: none; }
.journey__step { position: relative; flex: 1 1 110px; min-width: 104px; padding: 0 8px 14px; text-align: center; }
.journey__step::before {
    content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0;
}
.journey__step:first-child::before { display: none; }
.journey__step.is-done::before { background: var(--blue); }
.journey__step.is-current::before { background: linear-gradient(90deg, var(--blue), var(--yellow)); }
.journey__dot {
    position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border-radius: 50%; background: var(--white); border: 3px solid var(--border); color: var(--muted); font-weight: 800; font-size: 13px;
}
.journey__step.is-done .journey__dot { background: var(--blue); border-color: var(--blue); color: var(--white); }
.journey__step.is-current .journey__dot { border-color: var(--yellow); background: var(--yellow-soft); color: var(--ink); box-shadow: 0 0 0 5px rgba(255, 193, 7, .2); }
.journey__label { display: block; margin-top: 6px; font-weight: 700; font-size: 13px; color: var(--ink); }
.journey__label a { color: inherit; }
.journey__step.is-todo .journey__label { color: var(--muted); font-weight: 600; }
.journey__detail { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
.journey-card .subhead { margin-top: 10px; }

/* Cómo se aceptó */
.acceptance { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--green-soft); }
.acceptance .icon { color: var(--green); flex-shrink: 0; margin-top: 2px; }
.acceptance > div { min-width: 0; overflow-wrap: anywhere; }
.acceptance--registered { background: var(--blue-soft); }
.acceptance--registered .icon { color: var(--blue); }

/* Estadísticas */
.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bar-list__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 14px; }
.month-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.month-bars__item { display: grid; grid-template-columns: 36px minmax(0, 1fr) 100px; align-items: center; gap: 12px; font-size: 13px; }
.month-bars__label { color: var(--muted); font-weight: 600; }
.month-bars__value { text-align: right; font-variant-numeric: tabular-nums; }

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

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
    .sidebar-open .sidebar { transform: none; }
    .sidebar__close { display: inline-flex; }
    .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(45, 60, 88, .45); }
    .main { margin-left: 0; }
    .topbar__menu { display: inline-flex; }
    .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .topbar { padding: 0 14px; height: 60px; }
    .topbar__title { font-size: 17px; }
    .user-chip__name { display: none; }
    .content { padding: 18px 14px; }
    .app-footer { padding: 12px 14px 20px; }
    .form-grid, .stats { grid-template-columns: 1fr; }
    .hero-card { padding: 22px; }
    .hero-card__seal { display: none; }
    .search { max-width: none; flex-basis: 100%; }
    .page-head .btn { width: 100%; }
    .table th, .table td { padding: 12px 14px; }
    .hide-sm { display: none; }
    .form-actions .btn { flex: 1; }

    .filters select, .filters input[type="date"] { flex: 1 1 45%; }
    .filters .btn { flex: 1; }
    .lead-head .quick-actions .btn { flex: 1 1 auto; }
    .stop { padding: 14px; gap: 10px; }
    .stop__actions .btn { flex: 1 1 auto; }
    .stop__actions form { margin-left: 0; }
    .pick { padding: 12px 14px; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dd { margin-bottom: 8px; }
    .inline-form { flex-direction: column; }
    .input-sm { width: 110px; }
    .prose h1 { font-size: 24px; }

    .login { grid-template-columns: 1fr; }
    .login__hero { display: none; }
    .login__logo { display: block; }
}

/* ---------- Editor Markdown, tipos de publicación y documentación ---------- */
[hidden] { display: none !important; }
.choice--block small { font-size: 13px; line-height: 1.45; }
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--bg); }
.md-toolbar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.md-toolbar__btn { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--ink); font: 600 13px/1 var(--font); cursor: pointer; }
.md-toolbar__btn:hover, .md-toolbar__btn:focus-within { border-color: var(--blue); color: var(--blue); }
.md-toolbar__btn--bold { font-weight: 800; }
.md-toolbar__btn--italic { font-style: italic; font-family: Georgia, serif; }
.md-toolbar__btn--image { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.md-toolbar__status { margin-left: auto; color: var(--muted); font-size: 13px; }
textarea.is-dropping { outline: 3px dashed var(--blue); outline-offset: -6px; background: var(--blue-soft); }
.docs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.docs-nav { position: sticky; top: 20px; }
.docs-nav h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; text-decoration: none; }
.docs-nav a:hover { background: var(--bg); }
.docs-nav a.is-active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.docs-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); color: var(--ink); text-decoration: none; }
.docs-card:hover { border-color: var(--blue); text-decoration: none; }
.docs-card span { color: var(--muted); font-size: 14px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--bg); }
.prose pre { overflow-x: auto; padding: 12px 14px; border-radius: var(--radius-sm); background: #0f1d36; color: #e6eeff; font-size: 13px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; } .docs-nav { position: static; } }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.steps .inline-form, .steps textarea { margin-top: 8px; }
.steps textarea { width: 100%; }
.table textarea { width: 100%; min-width: 220px; }

@media (max-width: 1100px) { .stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .stats--4 { grid-template-columns: 1fr; }
    .inv-line__selects { grid-template-columns: 1fr; }
    .inv-line__main { min-width: 220px; }
    .inv-paid__fields { grid-template-columns: 1fr; }
    .row-actions { flex-wrap: wrap; }
    .domain-picker__item { grid-template-columns: 1fr auto; }
    .domain-picker__item .small { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
    .todo { flex-wrap: wrap; }
    .todo__body { flex-basis: calc(100% - 50px); }
    .todo .btn { width: 100%; }
    .journey { flex-direction: column; flex-wrap: nowrap; }
    .journey__step { flex: none; min-width: 0; display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 12px; text-align: left; padding: 0 0 10px; }
    .journey__step::before { top: -10px; left: 15px; width: 3px; height: 14px; }
    .journey__step.is-current::before { background: var(--blue); }
    .journey__dot { grid-row: 1 / span 2; align-self: start; }
    .journey__label { margin-top: 2px; }
    /* Documento: primero lo que hay que hacer, luego la vista previa (que se puede desplazar en horizontal) */
    .grid-main > aside { order: -1; }
}
