:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #d9e2ee;
    --panel: #ffffff;
    --soft: #f6f8fb;
    --nav: #0f1f2e;
    --accent: #0d6efd;
    --accent-dark: #084db8;
    --gold: #f59e0b;
    --graphite: #1e293b;
    --danger: #ef4444;
    --success: #16a34a;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 16px 44px rgba(15, 23, 42, 0.11);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 256px 1fr;
    color: var(--ink);
    background: var(--soft);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1200;
    width: 256px;
    min-height: 100vh;
    max-height: 100vh;
    overflow: visible;
    padding: 24px 15px;
    background:
        radial-gradient(circle at 46px 110px, color-mix(in srgb, var(--accent) 22%, transparent) 0 6px, transparent 7px),
        radial-gradient(circle at 46px 180px, rgba(255, 255, 255, 0.12) 0 7px, transparent 8px),
        radial-gradient(circle at 46px 250px, rgba(255, 255, 255, 0.09) 0 8px, transparent 9px),
        linear-gradient(180deg, var(--nav) 0%, color-mix(in srgb, var(--nav) 82%, #020617 18%) 100%);
    color: #fff;
}

.brand {
    display: grid;
    gap: 10px;
    margin-bottom: 26px;
}

.brand-logo {
    display: block;
    width: 100%;
    height: 104px;
    object-fit: contain;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.brand-user {
    display: grid;
    gap: 2px;
    padding-left: 3px;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 6px;
    background: #f4c430;
    color: #111827;
    font-weight: 700;
}

.brand small {
    display: block;
    margin-top: 2px;
    padding-left: 3px;
    color: #c3d3e6;
}

.brand-role {
    color: #93c5fd !important;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.company-brand-card {
    display: grid;
    gap: 7px;
    width: 146px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.company-brand-card span {
    color: #8fb3da;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.company-brand-card img {
    width: 100%;
    height: 44px;
    object-fit: contain;
    padding: 5px;
    border-radius: 9px;
    background: #fff;
}

nav {
    display: grid;
    gap: 7px;
    position: relative;
}

.nav-group {
    position: relative;
    display: block;
}

.nav-trigger {
    width: 100%;
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.045);
    color: #edf5ff;
    cursor: default;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    text-transform: none;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.nav-trigger::before {
    content: "\25B6";
    flex: 0 0 auto;
    color: color-mix(in srgb, var(--accent) 65%, #ffffff 35%);
    font-size: 10px;
    line-height: 1;
    transition: transform 140ms ease, color 140ms ease;
}

.nav-group:hover .nav-trigger::before,
.nav-group:focus-within .nav-trigger::before {
    color: #fff;
    transform: translateX(2px);
}

.nav-group:hover .nav-trigger,
.nav-group:focus-within .nav-trigger {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 86%, #ffffff 14%), color-mix(in srgb, var(--accent) 64%, #020617 36%));
    color: #fff;
    border-color: color-mix(in srgb, var(--accent) 65%, #ffffff 35%);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 22%, transparent);
}

.nav-flyout {
    position: fixed;
    top: var(--flyout-top, 12px);
    left: var(--flyout-left, 266px);
    z-index: 5000;
    display: none;
    width: 286px;
    max-height: min(calc(100vh - 18px), 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 7px;
    border: 1px solid #d9e2ee;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.24);
}

.nav-group:hover .nav-flyout,
.nav-group:focus-within .nav-flyout,
.nav-group.is-open .nav-flyout {
    display: grid;
    gap: 4px;
}

.nav-flyout::before {
    content: "";
    position: absolute;
    top: 0;
    left: -22px;
    width: 22px;
    height: 100%;
}

.nav-group::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 100%;
    z-index: 1299;
    width: 34px;
    height: calc(100% + 16px);
}

nav a {
    display: flex;
    min-height: 40px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e5edf5;
    text-decoration: none;
    position: relative;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

nav a:hover {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    transform: translateX(1px);
}

.nav-flyout a {
    min-height: 38px;
    padding: 9px 11px;
    border-radius: 7px;
    color: #0f172a;
    font-size: 13px;
}

.nav-flyout a:hover {
    background: color-mix(in srgb, var(--accent) 12%, #ffffff 88%);
    color: color-mix(in srgb, var(--accent) 76%, #0f172a 24%);
    transform: none;
}

.nav-flyout form {
    margin: 0;
}

nav a.is-active {
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #60a5fa 28%));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 24%, transparent);
}

.nav-flyout a.is-active {
    background: color-mix(in srgb, var(--accent) 14%, #ffffff 86%);
    color: color-mix(in srgb, var(--accent) 82%, #0f172a 18%);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-flyout a.is-disabled-module {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    opacity: 0.78;
}

.nav-flyout a.is-disabled-module:hover {
    background: #eef4ff;
    color: #334155;
    opacity: 1;
}

.nav-flyout a.is-disabled-module span {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.nav-badge {
    float: right;
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    text-align: center;
}

.main {
    grid-column: 2;
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 28px;
    overflow-x: auto;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 8%, transparent) 0, transparent 34%),
        var(--soft);
}

.global-search {
    display: grid;
    grid-template-columns: minmax(220px, 520px) auto;
    gap: 8px;
    margin-bottom: 18px;
}

.login-body {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 1fr;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(15, 31, 46, 0.86), rgba(13, 110, 253, 0.46)),
        var(--login-image, linear-gradient(135deg, #071d33 0%, #0d6efd 52%, #63b3ff 100%)) center / cover;
}

.login-card {
    width: min(460px, calc(100% - 32px));
    padding: 22px 28px 28px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.login-brand {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--ink);
}

.login-logo {
    width: 100%;
    max-width: 390px;
    height: 185px;
    object-fit: contain;
}

.login-title {
    width: 100%;
    display: grid;
    gap: 4px;
}

.login-title strong {
    font-size: 16px;
}

.login-title small {
    color: #bfd2ea;
}

.login-password-row {
    position: relative;
    display: grid;
    gap: 6px;
}

.login-password-control {
    position: relative;
}

.login-password-control input {
    width: 100%;
    padding-right: 116px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 9px;
    min-height: 30px;
    padding: 4px 9px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, #d9e2ee 78%);
    background: #fff;
    color: color-mix(in srgb, var(--accent) 78%, #0f172a 22%);
    font-size: 12px;
    font-weight: 700;
    transform: translateY(-50%);
    box-shadow: none;
}

.login-card form {
    display: grid;
    gap: 14px;
}

.login-button {
    width: 100%;
}

.login-home-link {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    color: #31506f;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.login-home-link::before {
    content: "←";
    margin-right: 7px;
}

.login-home-link:hover,
.login-home-link:focus-visible {
    color: var(--accent);
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 6px;
}

.permissions-grid label {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.permissions-grid input {
    width: auto;
    min-height: auto;
}

.permissions-grid span {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
}

.theme-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 10px 0 16px;
}

.theme-preset {
    display: flex;
    min-height: 64px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    text-align: left;
}

.swatch-row {
    display: flex;
    gap: 5px;
}

.swatch-row i {
    display: block;
    width: 28px;
    height: 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.theme-color-grid input[type="color"] {
    min-height: 42px;
    padding: 4px;
}

.company-assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.company-assets-grid label {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.company-asset-preview {
    width: 100%;
    height: 92px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.company-assets-grid label:first-child .company-asset-preview {
    object-fit: contain;
}

.inline-check {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: 28px;
}

h2 {
    margin-bottom: 14px;
    font-size: 18px;
}

p {
    color: var(--muted);
}

button,
input,
select,
.button {
    min-height: 38px;
    border-radius: 10px;
    font: inherit;
}

button,
.button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.button.is-active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, #ffffff 90%);
    color: var(--accent-dark);
    font-weight: 700;
}

button.primary,
.primary-link {
    padding: 0 16px;
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #60a5fa 28%));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}

button.primary:hover,
.primary-link:hover {
    background: var(--accent-dark);
}

.module-hero {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    margin-bottom: 22px;
    padding: 28px;
    border-radius: 8px;
    color: #fff;
    background-color: #111315;
    background-image: var(--hero-image, linear-gradient(135deg, #071d33 0%, #0d6efd 52%, #63b3ff 100%));
    background-size: cover;
    background-position: center;
}

.module-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(17, 19, 21, 0.92), rgba(17, 19, 21, 0.58) 48%, rgba(17, 19, 21, 0.08)),
        linear-gradient(0deg, rgba(17, 19, 21, 0.38), rgba(17, 19, 21, 0.02));
}

.module-hero > div {
    position: relative;
    max-width: 760px;
}

.module-hero span {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}

.module-hero h1 {
    margin-bottom: 8px;
    font-size: 34px;
    color: #fff;
}

.module-hero p {
    max-width: 620px;
    margin-bottom: 0;
    color: #f0f3f6;
    font-size: 16px;
}

.compact-hero {
    min-height: 165px;
}

.hero-auditorium {
    --hero-image: url("/static/imagenes/ia_banner_auditorios.png");
}

.hero-production {
    --hero-image: url("/static/imagenes/ia_banner_iglesias.png");
}

.hero-renting {
    --hero-image: url("/static/imagenes/ia_banner_bares.png");
}

.hero-inventory {
    --hero-image: url("/static/imagenes/ia_banner_inventario_audio.png");
}

button.danger {
    min-height: 32px;
    padding: 0 10px;
    border-color: #f3b8b3;
    color: var(--danger);
}

input,
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: #fff;
}

textarea {
    min-height: 110px;
    border-radius: 6px;
    font: inherit;
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    text-decoration: none;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    width: min(620px, 100%);
}

.search {
    display: flex;
    gap: 8px;
    width: min(420px, 100%);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.summary-card,
.panel,
.table-panel {
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.summary-card {
    display: flex;
    min-height: 98px;
    padding: 16px;
    flex-direction: column;
    justify-content: space-between;
    color: var(--ink);
    text-decoration: none;
    border-top: 3px solid var(--accent);
}

.summary-card span {
    color: var(--muted);
}

.summary-card strong {
    font-size: 28px;
}

.visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.visual-card {
    position: relative;
    min-height: 138px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 16px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-decoration: none;
}

.visual-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(17, 19, 21, 0.82), rgba(17, 19, 21, 0.1));
}

.visual-card span {
    position: relative;
    font-weight: 700;
}

.visual-auditorium {
    background-image: var(--visual-dashboard, url("/static/imagenes/ia_banner_auditorios.png"));
}

.visual-production {
    background-image: var(--visual-production, url("/static/imagenes/ia_banner_iglesias.png"));
}

.visual-renting {
    background-image: var(--visual-renting, url("/static/imagenes/ia_banner_bares.png"));
}

.visual-inventory {
    background-image: var(--visual-inventory, url("/static/imagenes/ia_banner_inventario_audio.png"));
}

.visual-sillas {
    background-image: url("/static/imagenes/producto_sillas.jpg.jpeg");
}

.panel {
    padding: 18px;
    margin-bottom: 18px;
}

.table-panel {
    max-width: 100%;
    overflow: auto;
}

.path {
    overflow-wrap: anywhere;
    margin-bottom: 0;
    color: var(--ink);
}

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

.full-field {
    display: block;
    margin-top: 14px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.quote-lines-wrap {
    overflow-x: auto;
}

.quote-lines {
    min-width: 1320px;
}

.quote-lines th,
.quote-lines td {
    white-space: normal;
}

.quote-lines input {
    min-width: 110px;
}

.quote-lines [name="nivel_precio"] {
    min-width: 125px;
}

.quote-lines [name="producto"] {
    min-width: 260px;
}

.quote-lines [name="total_linea"] {
    background: #f8fafc;
    font-weight: 700;
}

.quote-total {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 16px;
    font-size: 18px;
}

.quote-total span {
    color: var(--muted);
}

.quote-form {
    display: grid;
    gap: 0;
}

@media screen and (max-width: 2200px) {
    .quote-form .panel {
        padding: 13px;
    }

    .quote-form .entry-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .quote-lines-wrap {
        overflow: visible;
    }

    .quote-lines {
        display: block;
        width: 100%;
        min-width: 0;
        background: transparent;
    }

    .quote-lines thead {
        display: none;
    }

    .quote-lines tbody {
        display: grid;
        gap: 10px;
    }

    .quote-lines tr {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        padding: 12px;
        border: 1px solid var(--line);
        border-left: 4px solid var(--accent);
        border-radius: 7px;
        background: #fff;
    }

    .quote-lines td {
        display: grid;
        min-width: 0;
        max-width: none;
        gap: 4px;
        padding: 0;
        border: 0;
    }

    .quote-lines td::before {
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .quote-lines td:nth-child(1)::before { content: "Proyecto"; }
    .quote-lines td:nth-child(2)::before { content: "Codigo"; }
    .quote-lines td:nth-child(3)::before { content: "Producto"; }
    .quote-lines td:nth-child(4)::before { content: "Unidad"; }
    .quote-lines td:nth-child(5)::before { content: "Color"; }
    .quote-lines td:nth-child(6)::before { content: "Ubicacion"; }
    .quote-lines td:nth-child(7)::before { content: "Cantidad"; }
    .quote-lines td:nth-child(8)::before { content: "Nivel precio"; }
    .quote-lines td:nth-child(9)::before { content: "Precio"; }
    .quote-lines td:nth-child(10)::before { content: "Total"; }
    .quote-lines td:nth-child(11)::before { content: "Anticipo"; }

    .quote-lines td:nth-child(3) {
        grid-column: span 2;
    }

    .quote-lines td:last-child {
        align-self: end;
    }

    .quote-lines input,
    .quote-lines select,
    .quote-lines [name="producto"],
    .quote-lines [name="nivel_precio"] {
        width: 100%;
        min-width: 0;
    }

    .quote-lines td:last-child button {
        width: 100%;
    }
}

@media screen and (max-width: 1180px) {
    .quote-form .entry-form,
    .quote-lines tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quote-lines td:nth-child(3) {
        grid-column: span 2;
    }
}

@media screen and (max-width: 560px) {
    .quote-form .entry-form,
    .quote-lines tr {
        grid-template-columns: minmax(0, 1fr);
    }

    .quote-lines td:nth-child(3) {
        grid-column: auto;
    }

    .quote-form .section-heading,
    .quote-total {
        align-items: stretch;
        flex-direction: column;
    }

    .quote-form .section-heading button {
        width: 100%;
    }

    .quote-total {
        gap: 4px;
        text-align: right;
    }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.production-expenses-grid {
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
}

.production-expenses-grid > .panel {
    min-width: 0;
}

.compact-expenses {
    overflow-x: auto;
}

.compact-expenses table {
    min-width: 560px;
    table-layout: fixed;
}

.compact-expenses th,
.compact-expenses td {
    padding: 7px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.operation-cost-form {
    display: grid;
    grid-template-columns: 1fr 150px 150px 1.4fr 80px auto;
    gap: 6px;
    align-items: center;
}

.operation-cost-form input,
.operation-cost-form select,
.operation-cost-form button {
    min-width: 0;
}

.price-list-panel {
    max-height: calc(100vh - 190px);
}

.price-list-table {
    table-layout: fixed;
}

.price-list-table th:first-child,
.price-list-table td:first-child {
    width: 22%;
}

.price-list-table td {
    padding: 7px 9px;
}

.price-list-table td:first-child strong,
.price-list-table td:first-child small {
    display: block;
    overflow-wrap: anywhere;
}

.price-list-table td:first-child small {
    margin-top: 2px;
    color: var(--muted);
}

.price-row-form {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(90px, 0.65fr) repeat(4, minmax(110px, 1fr)) auto;
    gap: 6px;
    align-items: center;
}

.price-row-form label {
    position: relative;
}

.price-row-form label span {
    position: absolute;
    right: 8px;
    bottom: 8px;
    margin: 0;
    color: var(--muted);
}

.price-row-form output {
    min-height: 34px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #f7f8fa;
    font-weight: 700;
}

.price-row-form input,
.price-row-form button {
    min-width: 0;
}

.price-pagination {
    margin: 10px 0 18px;
    justify-content: center;
}

.price-catalog,
.material-catalog,
.bom-components {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.price-product-card,
.material-card,
.bom-component-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel, #fff);
}

.price-product-card > header,
.material-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.price-product-title,
.material-card header > div {
    min-width: 0;
}

.price-product-title strong,
.price-product-title small,
.material-card header strong,
.material-card header small {
    display: block;
    overflow-wrap: anywhere;
}

.price-product-title small,
.material-card header small {
    margin-top: 2px;
    color: var(--muted);
}

.product-type-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
    border-radius: 999px;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, #fff);
    font-size: 11px;
    font-weight: 700;
}

.price-product-card form {
    display: grid;
    grid-template-columns: 145px 125px minmax(420px, 1fr) 158px;
    gap: 8px;
    align-items: stretch;
}

.price-basis,
.price-margin,
.price-values-grid > div {
    min-width: 0;
}

.price-basis,
.price-margin {
    display: flex;
    min-height: 70px;
    flex-direction: column;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f7f8fa;
}

.price-basis output {
    min-height: 0;
    margin-top: auto;
    padding: 0 0 3px;
    border: 0;
    background: transparent;
    font-size: 16px;
}

.price-margin .input-suffix {
    min-height: 32px;
    margin-top: auto;
    background: #fff;
}

.price-basis > span,
.price-margin > span:first-child,
.price-values-grid span,
.material-fields label > span,
.bom-component-form label > span,
.bom-overhead-form label > span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.price-basis output,
.price-values-grid output,
.material-fields output {
    display: block;
    min-height: 35px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #f7f8fa;
    font-weight: 700;
    white-space: nowrap;
}

.price-basis > output {
    min-height: 0;
    margin-top: auto;
    padding: 0 0 3px;
    border: 0;
    background: transparent;
    font-size: 16px;
}

.price-values-grid small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.price-values-grid small b {
    color: var(--text);
}

.input-suffix {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

.input-suffix input {
    min-width: 0;
    border: 0;
    box-shadow: none;
}

.input-suffix b {
    padding-right: 9px;
    color: var(--muted);
}

.price-values-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f7f8fa;
}

.price-values-grid > div {
    padding: 6px 8px;
    border-right: 1px solid var(--line);
}

.price-values-grid > div:last-child {
    border-right: 0;
}

.price-values-grid output {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.price-product-card footer {
    align-items: stretch;
    flex-direction: column;
}

.price-product-card footer .button,
.price-product-card footer button {
    width: 100%;
    min-height: 32px;
    padding: 6px 8px;
    text-align: center;
}

.price-product-card footer,
.material-card footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.material-catalog {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
}

.material-fields {
    display: grid;
    grid-template-columns: .7fr 1.5fr .8fr .9fr .65fr .65fr;
    gap: 7px;
}

.material-fields input,
.material-fields select {
    min-width: 0;
    width: 100%;
}

.material-card footer {
    justify-content: space-between;
    margin-top: 9px;
    color: var(--muted);
    font-size: 12px;
}

.bom-cost-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 8px;
    margin: 12px 0;
}

.bom-cost-grid article {
    padding: 11px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--primary);
    border-radius: 6px;
    background: var(--panel, #fff);
}

.bom-cost-grid span,
.bom-cost-grid strong {
    display: block;
}

.bom-cost-grid span {
    color: var(--muted);
    font-size: 12px;
}

.bom-cost-grid strong {
    margin-top: 4px;
}

.bom-layout {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 10px;
}

.bom-layout h2 {
    margin-top: 0;
    font-size: 17px;
}

.bom-component-form,
.bom-overhead-form {
    display: grid;
    grid-template-columns: 2fr .6fr .6fr 1.2fr auto;
    gap: 7px;
    align-items: end;
}

.bom-overhead-form {
    grid-template-columns: repeat(3, 1fr) auto;
}

.bom-component-card {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(360px, 2fr) auto;
    gap: 12px;
    align-items: center;
}

.bom-component-name small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.bom-component-card dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(80px, 1fr));
    gap: 6px;
    margin: 0;
}

.bom-component-card dl div {
    display: block;
}

.bom-component-card dt,
.bom-component-card dd {
    margin: 0;
}

.bom-component-card dt {
    color: var(--muted);
    font-size: 11px;
}

.material-adjustment {
    min-width: 150px;
}

.material-adjustment summary {
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.material-adjustment[open] {
    min-width: 210px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel, #fff);
}

.material-adjustment form {
    display: grid;
    gap: 5px;
    margin-top: 6px;
}

.material-adjustment input,
.material-adjustment button {
    width: 100%;
    min-width: 0;
}

.bom-print-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 14px;
    border: 1px solid #222;
}

.bom-print-summary span {
    padding: 7px;
    border-right: 1px solid #222;
    font-size: 10px;
}

.bom-print-summary span:last-child {
    border-right: 0;
}

.bom-print-summary strong {
    display: block;
    margin-top: 3px;
    font-size: 12px;
}

@media (max-width: 1250px) {
    .material-fields {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .bom-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1050px) {
    .price-product-card form {
        grid-template-columns: minmax(130px, 1fr) minmax(120px, .7fr) minmax(0, 3fr);
    }

    .price-product-card footer {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
    }

    .price-product-card footer .button,
    .price-product-card footer button {
        width: auto;
    }
}

@media (max-width: 820px) {
    .price-product-card form,
    .bom-component-card {
        grid-template-columns: 1fr;
    }
    .price-values-grid,
    .bom-component-card dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bom-cost-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bom-total {
        grid-column: 1 / -1;
    }
    .bom-component-form,
    .bom-overhead-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .material-fields,
    .bom-component-form,
    .bom-overhead-form {
        grid-template-columns: 1fr;
    }
    .price-values-grid {
        grid-template-columns: 1fr 1fr;
    }
    .price-product-card footer,
    .material-card footer {
        align-items: stretch;
        flex-direction: column;
    }
    .price-product-card footer .button,
    .price-product-card footer button,
    .material-card footer button {
        width: 100%;
        text-align: center;
    }
}

.price-print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.price-print-header img {
    width: 190px;
    max-height: 70px;
    object-fit: contain;
}

.price-print-table {
    font-size: 11px;
}

.price-print-table th,
.price-print-table td {
    padding: 5px 7px;
}

.price-print-table td small {
    display: block;
    margin-top: 2px;
    font-size: 9px;
    font-weight: 700;
}

.compact-create-panel summary {
    cursor: pointer;
    font-weight: 700;
}

.compact-create-panel[open] summary {
    margin-bottom: 14px;
}

.dashboard-followups {
    min-width: 0;
    overflow: hidden;
}

.dashboard-followups-table {
    min-width: 0;
    table-layout: fixed;
}

.dashboard-followups-table th,
.dashboard-followups-table td {
    padding: 9px 8px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dashboard-followups-table th:first-child,
.dashboard-followups-table td:first-child {
    width: 22%;
    white-space: nowrap;
}

.dashboard-followups-table th:nth-child(2),
.dashboard-followups-table td:nth-child(2) {
    width: 28%;
}

.dashboard-followups-table th:nth-child(4),
.dashboard-followups-table td:nth-child(4) {
    width: 22%;
}

dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    margin: 0;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    font-weight: 700;
}

.table-link {
    color: var(--accent-dark);
    font-weight: 700;
}

label span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 13px;
}

table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    background: #f0f2f4;
    font-size: 13px;
    color: #3f4650;
}

.actions {
    width: 1%;
}

.actions form {
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #cfd7e6;
    background: #eef3f8;
    color: #27364a;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.semaforo-vencido {
    border-color: #efb2a8;
    background: #fff0ee;
    color: #a12a1c;
}

.semaforo-vence-hoy {
    border-color: #edc26a;
    background: #fff7df;
    color: #7b5700;
}

.semaforo-proximo {
    border-color: #a8c6f2;
    background: #eef5ff;
    color: #244d87;
}

.semaforo-a-tiempo,
.semaforo-terminado {
    border-color: #a7d8ba;
    background: #effaf2;
    color: #1f6a39;
}

.semaforo-sin-fecha,
.semaforo-anulado {
    border-color: #d7d7d7;
    background: #f4f4f4;
    color: #555;
}

.crm-toolbar {
    width: min(860px, 100%);
}

.crm-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(235px, 1fr));
    gap: 12px;
    min-width: 1720px;
    align-items: start;
}

.crm-column {
    display: grid;
    gap: 10px;
    min-height: 480px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.crm-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 4px 10px;
    color: #344054;
    font-size: 13px;
}

.crm-column-head span {
    display: inline-flex;
    min-width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e4e7ec;
    font-weight: 700;
}

.crm-card {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.crm-card.is-dragging {
    opacity: 0.55;
}

.crm-column.is-drop-target {
    outline: 2px dashed var(--accent);
    outline-offset: -6px;
}

.crm-card-title {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
    white-space: normal;
}

.crm-card span,
.crm-card small {
    color: var(--muted);
    white-space: normal;
}

.crm-card form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    margin-top: 4px;
}

.crm-card button {
    min-height: 34px;
    padding: 0 9px;
}

.crm-empty {
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fff;
}

.alert-panel {
    border-left: 4px solid var(--accent);
}

.quote-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff7f4;
}

.quote-info strong,
.quote-info span {
    display: block;
}

.calendar-board {
    display: grid;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.calendar-weekdays,
.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 8px;
    min-width: 900px;
}

.calendar-weekdays strong {
    padding: 8px 10px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.calendar-day {
    min-height: 128px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.calendar-day.is-muted {
    background: #f7f8fa;
    color: var(--muted);
}

.calendar-date {
    margin-bottom: 6px;
    font-weight: 800;
}

.calendar-task {
    display: grid;
    gap: 2px;
    margin-bottom: 5px;
    padding: 5px 6px;
    border-left: 4px solid var(--accent);
    border-radius: 5px;
    background: #fff7f3;
    color: var(--ink);
    font-size: 12px;
    text-decoration: none;
}

.calendar-task:hover {
    background: #ffe9df;
}

.calendar-task strong,
.calendar-task span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-more {
    color: var(--muted);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inline-form input {
    width: 96px;
    min-height: 32px;
}

.inline-form button {
    min-height: 32px;
    padding: 0 10px;
}

.row-warning td {
    background: #fff7df;
}

.checklist {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.checklist label {
    display: flex;
    gap: 10px;
    align-items: center;
}

.checklist input {
    width: auto;
    min-height: auto;
}

.checklist span {
    margin: 0;
    color: var(--ink);
}

.alert-table {
    margin-bottom: 18px;
}

.alert-table h2 {
    padding: 14px 16px 0;
}

.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.message {
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
}

.message.success {
    border-color: #99d6c8;
    background: #ecfdf5;
}

.message.error {
    border-color: #f3b8b3;
    background: #fff1f0;
}

.print-body {
    display: block;
    min-height: auto;
    background: #e5e7eb;
}

.print-page {
    width: min(960px, calc(100% - 32px));
    margin: 24px auto;
    padding: 32px;
    background: #fff;
    color: var(--ink);
}

.print-header,
.print-grid,
.print-totals {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.print-header h1 {
    margin-bottom: 4px;
}

.print-grid > div {
    flex: 1;
}

.print-table th,
.print-table td {
    white-space: normal;
}

.print-totals {
    justify-content: flex-end;
    text-align: right;
}

.print-totals p {
    min-width: 160px;
    color: var(--ink);
}

@media (max-width: 1280px) {
    body {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .sidebar {
        width: 220px;
        padding: 14px 12px;
    }

    .nav-flyout {
        width: min(276px, calc(100vw - 236px));
    }

    .brand {
        display: grid;
        gap: 8px;
        margin-bottom: 16px;
    }

    .brand-logo {
        width: 100%;
        height: 108px;
    }

    nav {
        gap: 3px;
    }

    nav a {
        padding: 8px 9px;
        font-size: 13px;
    }

    .main {
        padding: 18px;
        font-size: 14px;
    }

    .global-search {
        grid-template-columns: minmax(180px, 1fr) auto;
        margin-bottom: 14px;
    }

    .toolbar {
        gap: 10px;
        margin-bottom: 14px;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .toolbar-actions .search,
    .toolbar-actions form.search {
        width: min(520px, 100%);
    }

    .module-hero {
        min-height: 150px;
        margin-bottom: 16px;
        padding: 20px;
    }

    .module-hero h1 {
        font-size: 28px;
    }

    .module-hero p {
        font-size: 14px;
    }

    h1 {
        font-size: 24px;
    }

    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }

    .summary-card {
        min-height: 78px;
        padding: 12px;
    }

    .summary-card strong {
        font-size: 23px;
    }

    .visual-grid {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .visual-card {
        min-height: 112px;
        padding: 12px;
    }

    .panel {
        padding: 14px;
        margin-bottom: 14px;
    }

    .table-panel {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }

    .entry-form {
        grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
        gap: 9px;
    }

    .detail-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }

    th,
    td {
        padding: 8px 9px;
        font-size: 13px;
    }

    button,
    input,
    select,
    .button {
        min-height: 34px;
        font-size: 13px;
    }

    .crm-board {
        grid-template-columns: repeat(7, minmax(210px, 1fr));
        min-width: 1520px;
    }
}

@media (max-width: 1024px) and (min-width: 821px) {
    body {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .sidebar {
        width: 190px;
        padding: 12px 9px;
    }

    .nav-flyout {
        width: min(260px, calc(100vw - 204px));
    }

    .brand-logo {
        width: 100%;
        height: 100px;
    }

    .brand strong {
        font-size: 13px;
    }

    .brand small,
    nav a {
        font-size: 12px;
    }

    nav a {
        padding: 7px;
    }

    .nav-badge {
        min-width: 19px;
        padding: 1px 5px;
        font-size: 10px;
    }

    .main {
        padding: 12px;
    }

    .module-hero {
        min-height: 125px;
        padding: 16px;
    }

    .compact-hero {
        min-height: 120px;
    }

    .toolbar-actions {
        gap: 6px;
    }

    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }

    .summary-card {
        min-height: 70px;
        padding: 10px;
    }

    .summary-card strong {
        font-size: 20px;
    }

    .entry-form {
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    }

    .permissions-grid {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

    .dashboard-followups-table th,
    .dashboard-followups-table td {
        padding: 7px 5px;
        font-size: 12px;
    }

    .dashboard-followups-table th:first-child,
    .dashboard-followups-table td:first-child {
        width: 22%;
    }

    .dashboard-followups-table th:nth-child(4),
    .dashboard-followups-table td:nth-child(4) {
        width: 20%;
    }
}

@media (max-height: 760px) and (min-width: 821px) {
    .sidebar {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .brand {
        gap: 6px;
        margin-bottom: 10px;
    }

    .brand-logo {
        height: 76px;
    }

    .company-brand-card {
        gap: 4px;
        padding: 7px;
    }

    .company-brand-card img {
        height: 34px;
        padding: 3px;
    }

    nav {
        gap: 4px;
    }

    .nav-trigger {
        min-height: 36px;
        padding: 0 10px;
        font-size: 12px;
        border-radius: 9px;
    }

    .nav-flyout {
        max-height: calc(100vh - 14px);
    }

    .nav-flyout a {
        min-height: 34px;
        padding: 8px 10px;
    }
}

@media (max-width: 820px) {
    body {
        display: block;
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: auto;
        max-height: 42vh;
        min-height: auto;
        overflow-y: auto;
        padding: 12px;
    }

    .sidebar nav {
        grid-template-columns: 1fr;
    }

    .nav-flyout {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 0;
        padding: 6px;
        box-shadow: none;
    }

    .nav-group::before {
        display: none;
    }

    .main {
        padding: 12px;
        overflow-x: hidden;
    }

    .toolbar {
        display: grid;
    }

    .toolbar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        width: 100%;
    }

    .toolbar-actions > *,
    .toolbar-actions .search,
    .toolbar-actions form.search {
        width: 100%;
    }

    .toolbar-actions .search,
    .toolbar-actions form.search {
        grid-column: 1 / -1;
    }

    .module-hero {
        min-height: 135px;
        padding: 16px;
    }

    .module-hero h1 {
        font-size: 24px;
    }

    .brand-logo {
        width: 100%;
        height: 82px;
    }

    .global-search,
    .search {
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .summary-grid,
    .visual-grid,
    .detail-grid,
    .entry-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel {
        padding: 12px;
    }

    .table-panel {
        overflow-x: auto;
    }

    .table-panel table {
        width: max-content;
        min-width: 100%;
    }

    .dashboard-followups-table,
    .dashboard-followups-table tbody,
    .dashboard-followups-table tr,
    .dashboard-followups-table td {
        display: block;
        width: 100%;
    }

    .dashboard-followups-table thead {
        display: none;
    }

    .dashboard-followups-table tr {
        padding: 8px 0;
        border-bottom: 1px solid var(--line);
    }

    .dashboard-followups-table td {
        padding: 3px 0;
        border: 0;
    }

    .dashboard-followups-table td:first-child {
        white-space: normal;
    }

    .dashboard-followups-table td:nth-child(3) {
        color: var(--muted);
    }

    dl {
        grid-template-columns: 110px minmax(0, 1fr);
    }
}

@media (max-width: 1100px) {
    .production-expenses-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .operation-cost-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .price-list-table th:nth-child(n+2) {
        display: none;
    }

    .price-list-table th:first-child,
    .price-list-table td:first-child {
        width: 32%;
    }

    .price-row-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .toolbar-actions,
    .summary-grid,
    .visual-grid,
    .detail-grid,
    .entry-form {
        grid-template-columns: 1fr;
    }

    .sidebar nav {
        grid-template-columns: 1fr;
    }

    .sidebar nav a,
    .nav-trigger {
        padding: 7px;
        font-size: 12px;
    }

    .global-search,
    .search {
        display: grid;
        grid-template-columns: 1fr;
    }

    .module-hero {
        min-height: 120px;
    }

    h1 {
        font-size: 21px;
    }

    dl {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* Logistica y mensajeria urbana. */
.logistics-summary {
    grid-template-columns: repeat(5, minmax(135px, 1fr));
}

.logistics-summary .compact-value {
    font-size: 16px;
    line-height: 1.25;
}

.logistics-summary .alert-card {
    border-top-color: #d92d20;
}

.logistics-kpi-grid {
    grid-template-columns: repeat(5, minmax(135px, 1fr));
}

.courier-metrics-panel {
    max-width: 1120px;
}

.courier-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
}

.courier-metrics-grid article {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    background: #fff;
}

.courier-metrics-grid span {
    color: var(--muted);
    font-size: 13px;
}

.logistics-routes-strip > div {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.logistics-routes-strip a {
    display: grid;
    min-width: 210px;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
    background: #fff;
}

.logistics-routes-strip span,
.logistics-table small,
.route-pending-grid small,
.courier-service-card small {
    color: var(--muted);
}

.logistics-table {
    min-width: 1320px;
}

.logistics-table td:nth-child(3),
.logistics-table td:nth-child(4) {
    min-width: 240px;
    white-space: normal;
}

.compact-form-panel {
    max-width: 1120px;
}

.logistics-route-form {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.compact-entry-form {
    gap: 10px;
}

.compact-entry-form label {
    min-width: 0;
}

.compact-entry-form input,
.compact-entry-form select,
.compact-entry-form textarea {
    min-height: 38px;
}

.route-card-grid,
.logistics-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.dense-route-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 340px));
}

.route-card,
.logistics-service-card {
    display: grid;
    gap: 9px;
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.route-card header,
.logistics-service-card header {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    justify-content: space-between;
}

.route-card header div,
.logistics-service-card header div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.route-card small,
.logistics-service-card small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.route-card dl,
.logistics-service-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.route-card dt,
.logistics-service-card dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.route-card dd,
.logistics-service-card dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.route-card p {
    margin: 0;
    color: var(--muted);
}

.route-card footer,
.logistics-service-card footer {
    display: flex;
    justify-content: flex-end;
}

.service-route-mini {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.logistics-detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.compact-dl {
    display: grid;
    gap: 7px;
}

.compact-dl div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding-bottom: 6px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.compact-dl dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.compact-dl dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.vehicle-profile-grid {
    grid-template-columns: minmax(520px, 1.35fr) minmax(300px, 0.85fr);
}

.vehicle-general-panel {
    min-width: 0;
}

.vehicle-dl {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.vehicle-dl div {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
}

.vehicle-dl .full-row {
    grid-column: 1 / -1;
}

.vehicle-dl dd {
    overflow-wrap: break-word;
    word-break: normal;
}

.service-points-grid {
    grid-template-columns: repeat(2, minmax(360px, 1fr));
}

.service-point-panel {
    min-width: 0;
}

.service-point-dl {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
}

.service-point-dl div {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
}

.service-point-dl .full-row {
    grid-column: 1 / -1;
}

.service-point-dl dd {
    overflow-wrap: break-word;
    word-break: normal;
}

.compact-table-panel table th,
.compact-table-panel table td {
    padding: 8px 9px;
}

.document-list {
    display: grid;
    gap: 7px;
}

.service-route-mini > div {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 9px;
    border-radius: 6px;
    background: #f7f8fa;
}

.service-route-mini span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.service-route-mini strong {
    overflow-wrap: anywhere;
}

.page-flota .detail-grid,
.page-flota_vehiculo .detail-grid,
.page-flota_conductor .detail-grid {
    align-items: start;
}

.page-flota .route-card,
.page-flota_vehiculo .route-card,
.page-flota_conductor .route-card {
    min-height: 0;
}

.page-flota .table-panel,
.page-flota_vehiculo .table-panel,
.page-flota_conductor .table-panel {
    min-width: 0;
}

.page-flota .table-panel table,
.page-flota_vehiculo .table-panel table,
.page-flota_conductor .table-panel table {
    min-width: 680px;
}

.compact-button {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 13px;
}

@media (max-width: 980px) {
    .vehicle-profile-grid,
    .vehicle-dl,
    .service-points-grid,
    .service-point-dl {
        grid-template-columns: 1fr;
    }

    .page-flota .summary-grid,
    .page-flota_vehiculo .summary-grid,
    .page-flota_conductor .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-flota .route-card dl,
    .page-flota_vehiculo .route-card dl,
    .page-flota_conductor .route-card dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.route-pending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.route-pending-grid label {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.route-pending-grid span {
    display: grid;
    gap: 4px;
}

.route-pending-grid.compact {
    grid-template-columns: minmax(0, 1fr);
    max-height: 260px;
    overflow: auto;
}

.logistics-route-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
    gap: 12px;
    align-items: start;
}

.route-add-panel,
.route-order-panel {
    min-width: 0;
}

.route-service-stack,
.route-stop-list {
    display: grid;
    gap: 8px;
}

.route-service-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.route-service-card label {
    display: grid;
    gap: 3px;
}

.route-service-card label span,
.route-stop-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.route-service-card input {
    width: 62px;
    padding: 7px;
}

.small-button {
    padding: 7px 10px;
    font-size: 13px;
    line-height: 1;
}

.route-stop-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 7px;
    background: #fff;
}

.route-stop-card.delivery {
    border-left-color: #16a34a;
}

.route-stop-number {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 13%, #fff);
    color: var(--accent-dark);
    font-weight: 800;
}

.route-stop-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.route-stop-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.route-stop-card p {
    margin: 0;
    overflow-wrap: anywhere;
}

.route-stop-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.courier-service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 390px));
    gap: 12px;
}

.courier-service-card {
    display: grid;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.08);
}

.courier-service-card header {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.courier-service-card > div {
    display: grid;
    gap: 4px;
    padding: 9px;
    border-radius: 5px;
    background: #f7f8fa;
}

.courier-service-card > div span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.courier-service-card footer .button {
    width: 100%;
}

.recommendation-box {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 8%, #fff);
    color: var(--ink);
    font-weight: 700;
}

.check-field > label {
    min-height: 42px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.courier-app-hero {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--nav), color-mix(in srgb, var(--accent) 38%, var(--nav)));
    color: #fff;
}

.courier-app-hero span {
    color: color-mix(in srgb, #fff 72%, var(--accent));
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.courier-app-hero h1,
.courier-app-hero p {
    margin: 0;
}

.courier-app-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.courier-app-summary > div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.courier-app-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.courier-app-summary strong {
    font-size: 24px;
}

.courier-auto-refresh {
    max-width: 720px;
    margin: -4px 0 14px;
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 6%, #fff);
    color: var(--muted);
    font-size: 13px;
}

.app-courier-list {
    grid-template-columns: minmax(0, 1fr);
    max-width: 720px;
}

.app-courier-card {
    border-radius: 12px;
}

.courier-step-card {
    border: 1px solid transparent;
    border-left: 4px solid var(--line);
}

.courier-step-card.is-current {
    border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
    border-left-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, #fff);
}

.courier-step-meta {
    display: block;
    color: var(--accent-dark);
    font-weight: 800;
}

.courier-stage-note {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 7%, #fff);
    color: var(--muted);
}

.courier-stage-note strong {
    color: var(--ink);
    text-transform: capitalize;
}

.courier-card-actions,
.courier-status-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 8px;
}

.courier-message-actions {
    padding: 8px;
    border: 1px dashed color-mix(in srgb, var(--accent) 25%, var(--line));
    border-radius: 9px;
    background: color-mix(in srgb, var(--accent) 4%, #fff);
}

.courier-status-actions form,
.courier-status-actions button,
.courier-status-actions .button {
    width: 100%;
}

.courier-proof-form {
    grid-column: 1 / -1;
    display: grid;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.courier-proof-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.courier-proof-form input,
.courier-proof-form textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.courier-proof-form textarea {
    resize: vertical;
}

.courier-empty-state {
    max-width: 720px;
}

.document-link {
    display: block;
    margin-bottom: 6px;
    color: var(--accent-dark);
}

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

    .logistics-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .courier-service-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .logistics-route-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .route-card dl,
    .logistics-service-card dl,
    .service-route-mini {
        grid-template-columns: minmax(0, 1fr);
    }

    .logistics-route-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .route-service-card,
    .route-stop-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .route-stop-actions {
        justify-content: stretch;
    }

    .route-stop-actions .button,
    .route-service-card .button {
        width: 100%;
        justify-content: center;
    }
}

/* Tareas, cotizaciones y tableros comerciales. */
.page-tareas .summary-grid {
    max-width: 760px;
}

.page-tareas .table-panel {
    width: min(100%, 1180px);
}

.page-tareas .table-panel table {
    width: 100%;
    min-width: 760px;
    table-layout: fixed;
}

.page-tareas .table-panel th,
.page-tareas .table-panel td {
    white-space: normal;
}

.page-tareas .table-panel th:first-child,
.page-tareas .table-panel td:first-child {
    width: 115px;
}

.page-tareas .table-panel th:nth-last-child(2),
.page-tareas .table-panel td:nth-last-child(2) {
    width: 125px;
}

.page-tareas .table-panel th:last-child,
.page-tareas .table-panel td:last-child {
    width: 90px;
}

.page-cotizaciones .table-panel table {
    min-width: 1320px;
    table-layout: fixed;
}

.page-cotizaciones .table-panel th,
.page-cotizaciones .table-panel td {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.page-cotizaciones .table-panel th:nth-child(1),
.page-cotizaciones .table-panel td:nth-child(1) {
    width: 95px;
}

.page-cotizaciones .table-panel th:nth-child(2),
.page-cotizaciones .table-panel td:nth-child(2),
.page-cotizaciones .table-panel th:nth-child(3),
.page-cotizaciones .table-panel td:nth-child(3) {
    width: 220px;
}

.page-cotizaciones .table-panel th:nth-child(4),
.page-cotizaciones .table-panel td:nth-child(4),
.page-cotizaciones .table-panel th:nth-child(5),
.page-cotizaciones .table-panel td:nth-child(5),
.page-cotizaciones .table-panel th:nth-child(7),
.page-cotizaciones .table-panel td:nth-child(7) {
    width: 120px;
    white-space: nowrap;
}

.page-cotizaciones .table-panel th:nth-child(6),
.page-cotizaciones .table-panel td:nth-child(6) {
    width: 145px;
    white-space: nowrap;
}

.page-cotizaciones .table-panel th:nth-child(8),
.page-cotizaciones .table-panel td:nth-child(8) {
    width: 150px;
}

.page-cotizaciones .table-panel th:nth-child(9),
.page-cotizaciones .table-panel td:nth-child(9) {
    width: 145px;
}

.page-cotizaciones .table-panel th:last-child,
.page-cotizaciones .table-panel td:last-child {
    width: 125px;
    min-width: 125px;
}

.quote-view-action {
    text-align: center;
    white-space: nowrap !important;
}

.quote-view-button {
    min-height: 32px;
    padding: 0 11px;
    border-color: #f1a99c;
    background: #fff4f1;
    color: var(--accent-dark);
    font-size: 12px;
    box-shadow: none;
}

.quote-view-button:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.quote-client-create {
    max-width: 1180px;
    border-left: 4px solid var(--accent);
}

.quote-commercial-terms {
    max-width: 1180px;
}

.quote-print-terms {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 8px;
    padding: 2px 0;
    border: 0;
    font-size: 12px;
}

.crm-board {
    display: flex;
    min-width: max-content;
    gap: 12px;
    align-items: flex-start;
    padding: 2px 4px 14px 2px;
}

.crm-column {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 280px;
    min-width: 230px;
    max-width: 520px;
    height: min(620px, calc(100vh - 210px));
    min-height: 220px;
    max-height: calc(100vh - 150px);
    padding: 0;
    gap: 0;
    overflow: hidden;
    background: var(--column-color, #f8fafc);
    box-shadow: 0 2px 7px rgba(16, 24, 40, 0.08);
}

.crm-column-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    flex: 0 0 auto;
    gap: 6px;
    min-height: 46px;
    padding: 8px;
    border-bottom: 1px solid rgba(98, 108, 123, 0.22);
    background: var(--column-color, #f8fafc);
}

.crm-column-head > strong {
    align-self: center;
    min-width: 0;
    padding: 1px 2px 6px;
    border-bottom: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.crm-column-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    gap: 9px;
    padding: 9px;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    scrollbar-color: #9aa4b2 rgba(255, 255, 255, 0.5);
    scrollbar-width: thin;
}

.crm-column-body::-webkit-scrollbar {
    width: 9px;
}

.crm-column-body::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
}

.crm-column-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #9aa4b2;
    background-clip: padding-box;
}

.crm-column-tools {
    display: flex;
    flex-wrap: wrap;
    flex: 0 0 auto;
    gap: 3px;
    align-items: center;
    align-self: start;
    width: 100%;
    padding-top: 1px;
}

.crm-column-tools input[type="color"] {
    width: 26px;
    height: 26px;
    min-height: 26px;
    padding: 2px;
    border-radius: 5px;
}

.crm-column-tools button {
    width: auto;
    min-width: 27px;
    min-height: 26px;
    padding: 0 5px;
    border-color: rgba(98, 108, 123, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: none;
    color: #344054;
    font-size: 12px;
}

.crm-column-tools button:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.crm-column-tools span {
    min-width: 24px;
    height: 24px;
    font-size: 12px;
}

.crm-column.is-collapsed {
    height: auto !important;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}

.master-contactos {
    max-width: 1180px;
}

.master-contactos .master-create-panel,
.master-contactos .master-edit-panel {
    max-width: 980px;
}

.master-contactos .master-table-panel {
    width: fit-content;
    max-width: 100%;
}

.master-contactos .master-table {
    width: auto;
    min-width: 1160px;
    table-layout: fixed;
}

.master-contactos .master-table th,
.master-contactos .master-table td {
    padding: 8px 10px;
    overflow-wrap: normal;
    word-break: normal;
}

.master-contactos .master-table th:nth-child(1),
.master-contactos .master-table td:nth-child(1) {
    width: 150px;
}

.master-contactos .master-table th:nth-child(2),
.master-contactos .master-table td:nth-child(2) {
    width: 245px;
}

.master-contactos .master-table th:nth-child(3),
.master-contactos .master-table td:nth-child(3) {
    width: 210px;
}

.master-contactos .master-table th:nth-child(4),
.master-contactos .master-table td:nth-child(4) {
    width: 150px;
    white-space: nowrap;
}

.master-contactos .master-table th:nth-child(5),
.master-contactos .master-table td:nth-child(5) {
    width: 270px;
}

.master-contactos .master-table th:nth-child(6),
.master-contactos .master-table td:nth-child(6) {
    width: 105px;
    white-space: nowrap;
}

.master-contactos .master-table th:last-child,
.master-contactos .master-table td:last-child {
    width: 210px;
    min-width: 210px;
}

.crm-column.is-collapsed .crm-column-body {
    display: none;
}

.crm-column.is-collapsed .crm-resize-handle {
    display: none;
}

.crm-resize-handle {
    position: absolute;
    z-index: 5;
    transition: background-color 120ms ease;
}

.crm-resize-right {
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    cursor: ew-resize;
}

.crm-resize-bottom {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 7px;
    cursor: ns-resize;
}

.crm-resize-handle:hover,
.crm-resize-handle:active {
    background: color-mix(in srgb, var(--accent) 42%, transparent);
}

body.is-resizing-crm {
    user-select: none;
}

.platform-summary {
    max-width: 820px;
}

.platform-summary .summary-card {
    text-decoration: none;
}

.platform-companies-table {
    min-width: 1180px;
}

.platform-companies-table td:first-child {
    min-width: 240px;
    white-space: normal;
}

.platform-tabs {
    display: flex;
    width: fit-content;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.platform-tabs a {
    padding: 8px 14px;
    border-radius: 5px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.platform-tabs a:hover {
    background: #f2f4f7;
    color: var(--accent-dark);
}

.platform-companies-section {
    margin: 18px 0;
}

.platform-companies-section .section-heading {
    margin-bottom: 10px;
}

.platform-companies-section .section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
}

.platform-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 390px));
    gap: 12px;
}

.platform-company-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.07);
}

.platform-company-card header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
}

.platform-company-card header div {
    display: grid;
    gap: 3px;
}

.platform-company-card header small {
    color: var(--muted);
}

.platform-company-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 0;
}

.platform-company-card dl div {
    display: grid;
    gap: 2px;
}

.platform-company-card dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.platform-company-card dd {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.platform-company-card footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.platform-company-card footer form {
    margin: 0;
}

.owner-company-banner {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 9px 12px;
    border: 1px solid #f3b8ac;
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    background: #fff5f2;
}

.demo-license-banner {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    background: #fff8e6;
    color: #7a4b00;
}

.demo-license-banner div {
    display: grid;
    gap: 2px;
}

.demo-license-banner span,
.demo-license-banner small {
    color: #8a5a08;
}

.demo-plan-note {
    display: grid;
    gap: 3px;
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid #f3c969;
    border-radius: 7px;
    background: #fff8e6;
    color: #704500;
}

.demo-plan-note[hidden] {
    display: none;
}

.company-storage-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
    gap: 18px;
    align-items: start;
}

.company-storage-panel h2,
.company-storage-panel p {
    margin-top: 0;
}

.company-storage-panel dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.company-storage-panel dl div {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--line);
}

.company-storage-panel dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.company-storage-panel dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .company-storage-panel {
        grid-template-columns: 1fr;
    }
}

/* Public BELA site */
.public-site {
    display: block;
    min-height: 100vh;
    margin: 0;
    background: #f6f8fb;
    color: #071d33;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

.public-header {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
    padding: 10px clamp(18px, 5vw, 72px);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #dce4ee;
}

.public-brand img {
    display: block;
    width: clamp(190px, 17vw, 238px);
    height: auto;
    max-height: 66px;
    object-fit: contain;
    object-position: left center;
    overflow: visible;
}

.public-brand {
    display: flex;
    min-width: 190px;
    align-items: center;
    overflow: visible;
}

.public-header nav {
    display: flex;
    gap: 22px;
    align-items: center;
}

.public-header nav a {
    color: #243447;
    font-weight: 700;
    text-decoration: none;
}

.public-header .public-login {
    padding: 10px 17px;
    border-radius: 6px;
    background: #0d6efd;
    color: #fff;
}

.public-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: min(82vh, 780px);
    padding: 120px clamp(20px, 7vw, 110px) 64px;
    background: #071d33 url("imagenes/bela_dashboard.png") center / cover no-repeat;
    overflow: hidden;
}

.public-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(4, 18, 34, 0.52);
}

.public-hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
    color: #fff;
}

.public-eyebrow,
.public-section-heading span,
.public-demo-band > div > span,
.public-contact > div > span {
    display: block;
    margin-bottom: 10px;
    color: #56c7c2;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.public-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(52px, 9vw, 104px);
    line-height: 0.95;
    letter-spacing: 0;
}

.public-hero p {
    max-width: 650px;
    margin: 0;
    color: #e5edf7;
    font-size: clamp(20px, 2.5vw, 30px);
    line-height: 1.35;
}

.public-hero-actions,
.public-demo-actions,
.public-contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.public-hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 26px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.public-hero-points span::before {
    content: "✓";
    margin-right: 7px;
    color: #56c7c2;
}

.public-primary,
.public-secondary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid #0d6efd;
    border-radius: 6px;
    background: #0d6efd;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.public-secondary {
    border-color: #fff;
    background: transparent;
}

.public-secondary.dark {
    border-color: #17324d;
    color: #17324d;
}

.public-band,
.public-demo-band,
.public-contact,
.public-product-tour,
.public-industry-band,
.public-process-band,
.public-plans-band,
.public-trust-band,
.public-faq-band {
    padding: 64px clamp(20px, 7vw, 110px);
}

.public-section-heading {
    max-width: 720px;
    margin-bottom: 30px;
}

.public-section-heading h2,
.public-demo-band h2,
.public-contact h2,
.public-tour-copy h2,
.public-trust-band h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.12;
    letter-spacing: 0;
}

.public-section-heading > p {
    max-width: 720px;
    color: #526477;
    line-height: 1.55;
}

.public-value-band {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 clamp(20px, 7vw, 110px);
    background: #fff;
    border-bottom: 1px solid #cfd9e6;
}

.public-value-band div {
    min-width: 0;
    padding: 25px 20px;
    border-right: 1px solid #cfd9e6;
}

.public-value-band div:last-child {
    border-right: 0;
}

.public-value-band strong,
.public-value-band span {
    display: block;
}

.public-value-band strong {
    margin-bottom: 5px;
    color: #071d33;
    font-size: 17px;
}

.public-value-band span {
    color: #64748b;
    line-height: 1.45;
}

.public-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid #cfd9e6;
    border-bottom: 1px solid #cfd9e6;
}

.public-feature-grid article {
    min-width: 0;
    padding: 24px 22px;
    border-right: 1px solid #cfd9e6;
}

.public-feature-grid article:last-child {
    border-right: 0;
}

.public-feature-grid strong {
    color: #071d33;
    font-size: 19px;
}

.public-feature-grid p,
.public-demo-band p,
.public-contact p,
.public-tour-copy p,
.public-industry-grid p,
.public-process-list p,
.public-plans-grid li,
.public-trust-band li span,
.public-faq-list p {
    color: #526477;
    line-height: 1.55;
}

.public-product-tour {
    display: grid;
    grid-template-columns: minmax(260px, .75fr) minmax(0, 1.5fr);
    gap: clamp(30px, 6vw, 80px);
    align-items: center;
    background: #071d33;
}

.public-tour-copy > span,
.public-industry-band .public-section-heading > span,
.public-process-band .public-section-heading > span,
.public-plans-band .public-section-heading > span,
.public-faq-band .public-section-heading > span,
.public-trust-band > div > span {
    display: block;
    margin-bottom: 10px;
    color: #0d6efd;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.public-tour-copy h2 {
    color: #fff;
}

.public-tour-copy p {
    color: #c6d3e1;
}

.public-tour-copy .public-primary {
    margin-top: 12px;
}

.public-tour-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.public-tour-gallery figure {
    position: relative;
    min-width: 0;
    aspect-ratio: 16 / 10;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 7px;
    background: #fff;
}

.public-tour-gallery .tour-main {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 7;
}

.public-tour-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-tour-gallery figcaption {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 6px 9px;
    border-radius: 4px;
    background: rgba(7, 29, 51, .88);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.public-industry-band {
    background: #fff;
}

.public-industry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid #cfd9e6;
}

.public-industry-grid article {
    min-width: 0;
    padding: 24px 20px;
    border-right: 1px solid #cfd9e6;
}

.public-industry-grid article:last-child {
    border-right: 0;
}

.public-industry-grid article > span {
    display: block;
    margin-bottom: 20px;
    color: #0d6efd;
    font-size: 13px;
    font-weight: 800;
}

.public-industry-grid strong {
    color: #071d33;
    font-size: 19px;
}

.public-process-band {
    background: #eef3f8;
}

.public-process-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #cbd6e2;
}

.public-process-list li {
    display: flex;
    gap: 14px;
    min-width: 0;
    padding: 24px 18px;
    border-right: 1px solid #cbd6e2;
}

.public-process-list li:last-child {
    border-right: 0;
}

.public-process-list b {
    flex: 0 0 auto;
    color: #0d6efd;
    font-size: 22px;
}

.public-process-list strong {
    color: #071d33;
}

.public-process-list p {
    margin-bottom: 0;
}

.public-plans-band {
    background: #f8fafc;
}

.public-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 1100px;
    margin: 0 auto;
}

.public-plans-grid article {
    display: flex;
    min-width: 0;
    min-height: 350px;
    flex-direction: column;
    padding: 26px;
    border: 1px solid #cad5e2;
    border-radius: 7px;
    background: #fff;
}

.public-plans-grid article.is-featured {
    border: 2px solid #0d6efd;
    box-shadow: 0 14px 30px rgba(13, 110, 253, .12);
}

.public-plans-grid article > span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.public-plans-grid h3 {
    margin: 10px 0 8px;
    color: #071d33;
    font-size: 28px;
}

.public-plans-grid ul {
    flex: 1;
    margin: 16px 0 24px;
    padding-left: 20px;
}

.public-plans-grid a {
    align-self: flex-start;
}

.public-trust-band {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
    gap: 50px;
    align-items: start;
    background: #071d33;
}

.public-trust-band h2 {
    color: #fff;
}

.public-trust-band ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, .2);
}

.public-trust-band li {
    min-width: 0;
    padding: 18px;
    border-right: 1px solid rgba(255, 255, 255, .2);
    border-bottom: 1px solid rgba(255, 255, 255, .2);
}

.public-trust-band li:nth-child(2n) {
    border-right: 0;
}

.public-trust-band li strong,
.public-trust-band li span {
    display: block;
}

.public-trust-band li strong {
    margin-bottom: 5px;
    color: #fff;
}

.public-trust-band li span {
    color: #c6d3e1;
}

.public-faq-band {
    display: grid;
    grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr);
    gap: 60px;
    background: #fff;
}

.public-faq-list {
    border-top: 1px solid #cfd9e6;
}

.public-faq-list details {
    border-bottom: 1px solid #cfd9e6;
}

.public-faq-list summary {
    padding: 18px 4px;
    color: #071d33;
    cursor: pointer;
    font-weight: 800;
}

.public-faq-list p {
    margin: 0;
    padding: 0 4px 18px;
}

.public-demo-band {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
    gap: 40px;
    align-items: center;
    background: #e9eef5;
}

.public-demo-actions {
    justify-content: flex-end;
    margin-top: 0;
}

.public-contact {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr);
    gap: clamp(40px, 7vw, 100px);
    align-items: center;
    background:
        linear-gradient(110deg, rgba(7, 29, 51, .98), rgba(13, 66, 116, .94)),
        url("imagenes/bela_automatizacion.png") center / cover no-repeat;
}

.public-contact-copy > span {
    display: block;
    margin-bottom: 10px;
    color: #56c7c2;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.public-contact h2 {
    max-width: 780px;
    color: #fff;
}

.public-contact-copy p,
.public-contact-action p {
    color: #c6d3e1;
}

.public-contact-action {
    padding: 26px 0 26px 28px;
    border-left: 1px solid rgba(255, 255, 255, .24);
}

.public-contact-action > strong {
    display: block;
    color: #fff;
    font-size: 22px;
}

.public-contact-buttons,
.public-contact-data {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.public-contact-data {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .2);
}

.public-contact-data a {
    color: #d8e7f5;
    font-weight: 800;
    text-decoration: none;
}

.public-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 22px clamp(20px, 7vw, 110px);
    background: #071d33;
    color: #d9e4f0;
}

.public-whatsapp-float {
    position: fixed;
    z-index: 40;
    right: 22px;
    bottom: 22px;
    display: grid;
    grid-template-columns: 58px minmax(140px, 1fr) 10px;
    width: 286px;
    min-height: 78px;
    align-items: center;
    gap: 11px;
    padding: 9px 12px 9px 9px;
    border: 1px solid #cbd8e6;
    border-left: 4px solid #19a954;
    border-radius: 8px;
    background: #fff;
    color: #071d33;
    box-shadow: 0 12px 30px rgba(7, 29, 51, .2);
    text-decoration: none;
}

.public-advisor-avatar {
    display: block;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid #dbe8f5;
    background: #eaf3fb;
}

.public-advisor-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-advisor-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.public-advisor-copy small,
.public-advisor-copy strong,
.public-advisor-copy em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-advisor-copy small {
    color: #526477;
    font-size: 11px;
    font-weight: 700;
}

.public-advisor-copy strong {
    color: #0d6efd;
    font-size: 14px;
}

.public-advisor-copy em {
    color: #64748b;
    font-size: 10px;
    font-style: normal;
}

.public-advisor-status {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #19a954;
    box-shadow: 0 0 0 3px rgba(25, 169, 84, .14);
}

.public-whatsapp-float:hover,
.public-whatsapp-float:focus-visible {
    border-color: #8eb4d8;
    background: #f8fbff;
    transform: translateY(-1px);
}

@media (max-width: 820px) {
    .public-brand img {
        width: 188px;
        max-height: 58px;
    }

    .public-header nav a:not(.public-login) {
        display: none;
    }

    .public-hero {
        min-height: 76vh;
        padding-bottom: 44px;
    }

    .public-feature-grid {
        grid-template-columns: 1fr;
    }

    .public-feature-grid article {
        border-right: 0;
        border-bottom: 1px solid #cfd9e6;
    }

    .public-feature-grid article:last-child {
        border-bottom: 0;
    }

    .public-demo-band,
    .public-contact {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
    }

    .public-demo-actions,
    .public-contact-links {
        justify-content: flex-start;
    }

    .public-contact-action {
        padding: 24px 0 0;
        border-top: 1px solid rgba(255, 255, 255, .24);
        border-left: 0;
    }

    .public-footer {
        flex-direction: column;
    }

    .public-value-band,
    .public-industry-grid,
    .public-process-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-value-band div:nth-child(2),
    .public-industry-grid article:nth-child(2),
    .public-process-list li:nth-child(2) {
        border-right: 0;
    }

    .public-value-band div,
    .public-industry-grid article,
    .public-process-list li {
        border-bottom: 1px solid #cfd9e6;
    }

    .public-product-tour,
    .public-trust-band,
    .public-faq-band {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .public-plans-grid {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .public-plans-grid article {
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .public-header {
        min-height: 64px;
        padding: 8px 12px;
    }

    .public-brand,
    .public-brand img {
        min-width: 0;
        width: 156px;
    }

    .public-header .public-login {
        padding: 9px 12px;
    }

    .public-whatsapp-float {
        right: 12px;
        bottom: 12px;
        grid-template-columns: 48px minmax(125px, 1fr) 9px;
        width: min(250px, calc(100vw - 24px));
        min-height: 66px;
    }

    .public-advisor-avatar {
        width: 48px;
        height: 48px;
    }

    .public-advisor-copy em {
        display: none;
    }

    .public-value-band,
    .public-industry-grid,
    .public-process-list,
    .public-trust-band ul,
    .public-tour-gallery {
        grid-template-columns: 1fr;
    }

    .public-value-band div,
    .public-industry-grid article,
    .public-process-list li,
    .public-trust-band li {
        border-right: 0;
    }

    .public-tour-gallery .tour-main {
        grid-column: auto;
        aspect-ratio: 16 / 10;
    }

    .public-hero-points {
        display: grid;
        gap: 8px;
    }
}

.demo-signup-page {
    display: block;
    min-height: 100vh;
    margin: 0;
    background: #eef3f8;
    color: #071d33;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.demo-signup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
    padding: 9px clamp(18px, 5vw, 72px);
    border-bottom: 1px solid #d6e0eb;
    background: #fff;
}

.demo-signup-header img {
    display: block;
    width: 176px;
    height: 54px;
    object-fit: contain;
}

.demo-signup-header > a:last-child {
    color: #0d6efd;
    font-weight: 800;
    text-decoration: none;
}

.demo-signup-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(420px, 0.65fr);
    gap: clamp(32px, 7vw, 100px);
    align-items: center;
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 56px 0;
}

.demo-signup-intro > span {
    color: #0d6efd;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.demo-signup-intro h1 {
    margin: 12px 0 18px;
    font-size: clamp(38px, 5vw, 66px);
    line-height: 1.02;
    letter-spacing: 0;
}

.demo-signup-intro p,
.demo-signup-intro li {
    color: #526477;
    font-size: 17px;
    line-height: 1.5;
}

.demo-signup-form-wrap {
    min-width: 0;
}

.demo-signup-form {
    display: grid;
    gap: 12px;
    padding: 26px;
    border: 1px solid #d5dfeb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(7, 29, 51, 0.1);
}

.demo-signup-form h2 {
    margin: 0 0 4px;
    font-size: 25px;
}

.demo-signup-form label:not(.demo-terms) {
    display: grid;
    gap: 5px;
}

.demo-signup-form label > span {
    color: #43566b;
    font-size: 13px;
    font-weight: 750;
}

.demo-signup-form input:not([type="checkbox"]) {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cbd7e5;
    border-radius: 6px;
    background: #fff;
    color: #071d33;
    font: inherit;
}

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

.demo-signup-form button {
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    background: #0d6efd;
    color: #fff;
    font-weight: 800;
}

.demo-signup-form > small {
    color: #68798b;
    text-align: center;
}

@media (max-width: 820px) {
    .demo-signup-layout {
        grid-template-columns: 1fr;
        padding: 34px 0;
    }

    .demo-signup-form {
        padding: 20px;
    }
}

.owner-company-banner div {
    display: grid;
    gap: 2px;
}

.owner-company-banner span {
    color: var(--muted);
    font-size: 12px;
}

.sidebar-return-button {
    width: 100%;
    min-width: 0;
    border-color: color-mix(in srgb, var(--accent) 24%, #ffffff 76%);
    background: color-mix(in srgb, var(--accent) 10%, #ffffff 90%);
    color: var(--accent-dark);
}

.sidebar nav form {
    margin: 0;
}

.platform-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 9px;
}

.platform-modules-grid label {
    display: flex;
    min-height: 72px;
    gap: 10px;
    align-items: flex-start;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.platform-modules-grid input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.platform-modules-grid span {
    display: grid;
    gap: 4px;
}

.platform-modules-grid small,
.platform-events small {
    color: var(--muted);
}

.platform-events {
    display: grid;
    gap: 0;
}

.platform-events > div {
    display: grid;
    grid-template-columns: 180px 220px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

@media (max-width: 820px) {
    .platform-company-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .platform-events > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }

    .owner-company-banner {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 820px) {
    .page-tareas .table-panel table {
        min-width: 680px;
    }

    .quote-print-terms {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media print {
    .no-print {
        display: none !important;
    }

    .print-body {
        background: #fff;
    }

    .print-page {
        width: 100%;
        margin: 0;
        padding: 0;
    }
}

@media screen and (max-width: 860px) {
    .quote-sheet {
        margin: 8px auto;
        transform: scale(0.9);
        transform-origin: top left;
    }
}

@media screen and (max-width: 700px) {
    .quote-sheet {
        transform: scale(0.76);
    }
}

@media screen and (max-width: 560px) {
    .quote-sheet {
        transform: scale(0.6);
    }
}

@media screen and (max-width: 430px) {
    .quote-sheet {
        transform: scale(0.4);
    }
}

.quote-print-body {
    display: block;
    min-height: auto;
    background: #dfe3e8;
    color: #000;
    font-family: "Times New Roman", Times, serif;
}

.quote-sheet {
    position: relative;
    width: 816px;
    min-height: 1056px;
    margin: 24px auto;
    padding: 64px 58px 70px;
    background: #fff;
    color: #000;
    box-sizing: border-box;
}

.print-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    font-family: Arial, Helvetica, sans-serif;
}

.quote-header,
.quote-meta {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 44px;
}

.quote-logo {
    width: 230px;
    height: auto;
    margin-top: 2px;
}

.quote-company {
    display: grid;
    gap: 4px;
    text-align: center;
    font-size: 14px;
    line-height: 1.2;
}

.quote-meta {
    margin-top: 24px;
    align-items: start;
}

.quote-client-block dl {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 4px 12px;
    font-size: 14px;
    line-height: 1.15;
}

.quote-client-block dt,
.quote-client-block dd {
    margin: 0;
}

.quote-client-block dt {
    font-weight: 700;
    color: #000;
}

.quote-client-block dd {
    font-weight: 400;
}

.quote-info-block {
    padding-top: 2px;
    font-size: 14px;
    line-height: 1.45;
}

.quote-info-block p {
    color: #000;
    margin-bottom: 10px;
}

.quote-intro {
    margin: 18px 0 5px;
    color: #000;
    font-size: 14px;
}

.quote-print-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12.5px;
    line-height: 1.12;
}

.quote-print-table caption {
    caption-side: top;
    padding: 0;
    border: 1px solid #000;
    border-bottom: 0;
    background: #fff;
    font-weight: 700;
}

.quote-print-table th {
    padding: 3px 4px;
    border: 1px solid #000;
    background: #000;
    color: #fff;
    text-align: center;
    font-size: 13px;
}

.quote-print-table td {
    padding: 4px 5px;
    border-left: 1px solid #000;
    border-right: 1px solid #000;
    border-bottom: 0;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.quote-print-table tbody tr:first-child td {
    border-top: 1px solid #000;
}

.quote-print-table tbody tr:last-child td {
    border-bottom: 1px solid #000;
}

.quote-print-table tfoot td {
    border: 1px solid #000;
    padding: 4px 5px;
}

.quote-print-table th:nth-child(1),
.quote-print-table td:nth-child(1) {
    width: 70px;
    text-align: center;
}

.quote-print-table th:nth-child(2),
.quote-print-table td:nth-child(2) {
    width: 200px;
}

.quote-print-table th:nth-child(3),
.quote-print-table td:nth-child(3) {
    width: 42px;
    text-align: center;
    overflow-wrap: normal;
    word-break: keep-all;
}

.quote-print-table th:nth-child(4),
.quote-print-table td:nth-child(4) {
    width: 74px;
    text-align: center;
    font-size: 12px;
}

.quote-print-table th:nth-child(5),
.quote-print-table td:nth-child(5) {
    width: 72px;
    text-align: center;
    font-size: 12px;
}

.quote-print-table th:nth-child(6),
.quote-print-table td:nth-child(6) {
    width: 50px;
    text-align: center;
}

.quote-print-table th:nth-child(7),
.quote-print-table td:nth-child(7),
.quote-print-table th:nth-child(8),
.quote-print-table td:nth-child(8) {
    width: 76px;
    text-align: right;
}

.quote-print-table tfoot .total-label {
    text-align: left !important;
    white-space: nowrap;
    font-weight: 400;
}

.quote-print-table tfoot td:not(.quote-notes):not(.total-label) {
    text-align: right;
    white-space: nowrap;
}

.quote-print-table .blank-row td {
    height: 26px;
}

.quote-notes {
    text-align: left !important;
    line-height: 1.55;
}

.quote-print-table .grand-total td {
    background: #d9d9d9;
    font-weight: 700;
}

.quote-signature {
    margin-top: 22px;
    font-size: 14px;
}

.quote-signature p {
    color: #000;
    margin-bottom: 34px;
}

.quote-footer {
    position: absolute;
    left: 82px;
    right: 82px;
    bottom: 48px;
    display: grid;
    gap: 2px;
    text-align: center;
    font-size: 13px;
}

@media print {
    @page {
        size: letter;
        margin: 0;
    }

    .quote-print-body {
        background: #fff;
    }

    .quote-sheet {
        width: 8.5in;
        min-height: 11in;
        margin: 0;
        padding: 0.66in 0.58in 0.65in;
        box-shadow: none;
    }

    .quote-footer {
        left: 0.58in;
        right: 0.58in;
        bottom: 0.45in;
    }
}

/* Responsive general del ERP: conserva el orden en portatiles y pantallas pequenas. */
.main > *,
.toolbar > *,
.toolbar-actions > *,
.panel > *,
.summary-card,
.visual-card,
.detail-grid > *,
.entry-form > *,
.permissions-grid > * {
    min-width: 0;
    max-width: 100%;
}

.panel,
.table-panel {
    overflow-wrap: anywhere;
}

.table-panel {
    scrollbar-gutter: stable;
}

.table-panel table {
    min-width: max-content;
}

.table-panel th,
.table-panel td {
    max-width: 360px;
}

.table-panel input,
.table-panel select,
.table-panel textarea {
    min-width: 0;
    max-width: 100%;
}

/* Maestros: el ancho responde a la cantidad real de informacion. */
.master-page {
    min-width: 0;
}

.master-page .master-create-panel,
.master-page .master-edit-panel {
    width: 100%;
}

.master-page .actions {
    display: flex;
    width: auto;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

.master-page .actions form {
    display: inline-flex;
}

.master-ciudades,
.master-trabajadores {
    max-width: 1050px;
}

.master-ciudades .master-create-panel,
.master-ciudades .master-edit-panel {
    max-width: 720px;
}

.master-ciudades .entry-form {
    grid-template-columns: 110px minmax(180px, 1fr) 150px auto;
}

.master-ciudades .master-table-panel {
    width: fit-content;
    max-width: 100%;
}

.master-ciudades .master-table {
    width: auto;
    min-width: 620px;
}

.master-ciudades .master-table th:nth-child(1),
.master-ciudades .master-table td:nth-child(1) {
    width: 110px;
}

.master-ciudades .master-table th:nth-child(2),
.master-ciudades .master-table td:nth-child(2) {
    width: 260px;
}

.master-ciudades .master-table th:nth-child(3),
.master-ciudades .master-table td:nth-child(3) {
    width: 130px;
}

.master-trabajadores .master-create-panel,
.master-trabajadores .master-edit-panel {
    max-width: 940px;
}

.master-trabajadores .master-table {
    min-width: 850px;
}

.master-contactos .master-create-panel,
.master-contactos .master-edit-panel {
    max-width: 1180px;
}

.master-clientes .master-create-panel,
.master-clientes .master-edit-panel {
    max-width: 1040px;
}

.master-clientes .master-create-panel .entry-form {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
}

.client-card-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    max-width: 1120px;
}

.client-master-card {
    display: grid;
    gap: 11px;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.client-master-card header {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    justify-content: space-between;
}

.client-master-card header div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.client-master-card strong,
.client-master-card dd {
    overflow-wrap: anywhere;
}

.client-master-card small {
    color: var(--muted);
}

.client-master-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.client-master-card dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.client-master-card dd {
    margin: 0;
}

.client-master-card footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.empty-state-panel {
    max-width: 520px;
}

.master-page:not(.master-productos) .master-table th:first-child,
.master-page:not(.master-productos) .master-table td:first-child {
    width: 105px;
}

.master-page:not(.master-productos) .master-table td {
    white-space: normal;
}

.toolbar h1,
.toolbar h2,
.toolbar p {
    overflow-wrap: anywhere;
}

@media (max-width: 1440px) {
    .main {
        padding: 16px;
    }

    .toolbar,
    .summary-grid,
    .visual-grid,
    .detail-grid {
        gap: 10px;
    }

    .panel {
        padding: 13px;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .entry-form {
        grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
        gap: 8px;
    }

    .detail-grid {
        grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
    }

    .operation-cost-form {
        grid-template-columns: minmax(150px, 1fr) 120px 120px minmax(180px, 1.2fr) 70px auto;
    }
}

@media (max-width: 820px) {
    .master-clientes .master-create-panel .entry-form,
    .client-master-card dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-master-card footer .button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 1180px) and (min-width: 821px) {
    .main {
        padding: 12px;
    }

    .toolbar-actions > form:not(.search),
    .toolbar-actions > div {
        max-width: 100%;
    }

    .summary-grid,
    .visual-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .entry-form {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .permissions-grid {
        grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    }

    .price-row-form,
    .operation-cost-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .master-ciudades .entry-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 30;
        max-height: 34vh;
        box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
    }

    .brand {
        display: grid;
        margin-bottom: 8px;
    }

    .brand-logo {
        width: 100%;
        height: 94px;
    }

    .nav-trigger {
        margin-top: 5px;
    }

    .main {
        width: 100%;
        padding: 10px;
    }

    .toolbar h1 {
        font-size: 22px;
    }

    .toolbar-actions > *,
    .toolbar-actions form,
    .form-actions > * {
        min-width: 0;
        max-width: 100%;
    }

    .form-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-panel {
        width: 100%;
        border-radius: 6px;
    }

    .table-panel table {
        min-width: 680px;
    }

    .table-panel th,
    .table-panel td {
        padding: 7px 8px;
        font-size: 12px;
    }

    .quote-lines-wrap,
    .compact-expenses,
    .crm-board-wrap,
    .calendar-wrap {
        max-width: 100%;
        overflow-x: auto;
    }

    .master-ciudades,
    .master-trabajadores {
        max-width: none;
    }

    .master-ciudades .entry-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .master-ciudades .master-table {
        min-width: 560px;
    }
}

@media (max-width: 560px) {
    .sidebar {
        max-height: 30vh;
        padding: 8px;
    }

    .sidebar nav {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .sidebar nav a {
        min-height: 34px;
        display: flex;
        align-items: center;
    }

    .main {
        padding: 8px;
    }

    .panel,
    .summary-card,
    .visual-card {
        padding: 10px;
    }

    .global-search button,
    .search button,
    .toolbar-actions .button,
    .toolbar-actions button,
    .form-actions .button,
    .form-actions button {
        width: 100%;
    }

    .permissions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .price-row-form,
    .operation-cost-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .master-ciudades .entry-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Densidad por pantalla: las listas cortas no ocupan el ancho de una tabla operativa. */
.table-panel:has(> table > thead > tr > th:nth-child(2):last-child),
.table-panel:has(> table > thead > tr > th:nth-child(3):last-child),
.table-panel:has(> table > thead > tr > th:nth-child(4):last-child) {
    width: fit-content;
    max-width: 100%;
}

.table-panel:has(> table > thead > tr > th:nth-child(2):last-child) > table {
    width: auto;
    min-width: min(100%, 460px);
}

.table-panel:has(> table > thead > tr > th:nth-child(3):last-child) > table {
    width: auto;
    min-width: min(100%, 620px);
}

.table-panel:has(> table > thead > tr > th:nth-child(4):last-child) > table {
    width: auto;
    min-width: min(100%, 780px);
}

.table-panel:has(> table > thead > tr > th:nth-child(5):last-child) > table {
    table-layout: auto;
}

.table-panel:has(> table > thead > tr > th:nth-child(5):last-child) th,
.table-panel:has(> table > thead > tr > th:nth-child(5):last-child) td {
    white-space: normal;
}

.entry-form {
    grid-template-columns: repeat(auto-fit, minmax(170px, 280px));
    justify-content: start;
}

.entry-form > label,
.entry-form > button,
.entry-form > .button {
    min-width: 0;
    max-width: 100%;
}

.panel > form.entry-form + *,
.panel > .entry-form + * {
    max-width: 100%;
}

.entry-form .full-field {
    grid-column: 1 / -1;
    width: min(100%, 850px);
    margin-top: 0;
}

.panel:has(> table),
.panel:has(> .table-panel) {
    min-width: 0;
    overflow-x: auto;
}

.detail-grid .panel table {
    width: max-content;
    min-width: 100%;
}

.detail-grid .panel th,
.detail-grid .panel td {
    max-width: 320px;
    white-space: normal;
}

.table-panel > table th:last-child:empty,
.table-panel > table td.actions {
    width: 1%;
}

@media (max-width: 1280px) {
    .table-panel th,
    .table-panel td {
        padding: 7px 8px;
    }

    .entry-form {
        grid-template-columns: repeat(auto-fit, minmax(155px, 250px));
    }

    .panel h2 {
        margin-bottom: 10px;
    }
}

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

    .table-panel:has(> table > thead > tr > th:nth-child(2):last-child),
    .table-panel:has(> table > thead > tr > th:nth-child(3):last-child),
    .table-panel:has(> table > thead > tr > th:nth-child(4):last-child) {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .entry-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Revision modulo por modulo: superficies compactas y columnas proporcionadas. */
.module-hero,
.compact-hero {
    min-height: 138px;
    padding: 20px;
}

.module-hero h1 {
    font-size: 28px;
}

.table-panel > h2 {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.page-usuarios .users-table-panel {
    max-width: 1180px;
}

.page-usuarios .users-table {
    width: 100%;
    min-width: 860px;
    table-layout: fixed;
}

.page-usuarios .users-table th,
.page-usuarios .users-table td {
    padding: 9px 10px;
    vertical-align: middle;
    white-space: normal;
}

.page-usuarios .users-table th:nth-child(1),
.page-usuarios .users-table td:nth-child(1) {
    width: 130px;
}

.page-usuarios .users-table th:nth-child(2),
.page-usuarios .users-table td:nth-child(2) {
    width: 230px;
}

.page-usuarios .users-table th:nth-child(3),
.page-usuarios .users-table td:nth-child(3) {
    width: 125px;
}

.page-usuarios .users-table th:nth-last-child(3),
.page-usuarios .users-table td:nth-last-child(3) {
    width: 125px;
}

.page-usuarios .users-table th:nth-last-child(2),
.page-usuarios .users-table td:nth-last-child(2) {
    width: 80px;
}

.page-usuarios .users-table th:last-child,
.page-usuarios .users-table td:last-child {
    width: 155px;
}

.muted-line {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.role-chip,
.permission-summary {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 10%, #ffffff 90%);
    color: color-mix(in srgb, var(--accent) 74%, #0f172a 26%);
    font-size: 12px;
    font-weight: 700;
}

.page-usuarios .table-panel td:last-child {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-usuarios .table-panel td:last-child form {
    margin: 0;
}

.page-auditoria .table-panel td:last-child,
.page-documentos_control .table-panel td:last-child {
    max-width: 520px;
    white-space: normal;
}

.page-proveedores .panel,
.page-documentos_control .panel,
.page-costos_operacion .panel,
.page-despachos .panel {
    max-width: 1200px;
}

.page-proveedores .table-panel,
.page-documentos_control .table-panel,
.page-costos_operacion .table-panel {
    max-width: 1280px;
}

.page-inventario .table-panel td:nth-child(2),
.page-inventario_movimientos .table-panel td:nth-child(4),
.page-produccion .table-panel td:nth-child(4),
.page-produccion .table-panel td:nth-child(5),
.page-produccion .table-panel td:nth-child(7),
.page-cotizaciones .table-panel td:nth-child(3),
.page-crm_lista .table-panel td:nth-child(2),
.page-crm_lista .table-panel td:nth-child(3),
.page-crm_lista .table-panel td:nth-child(10),
.page-renting .table-panel td:nth-child(3),
.page-renting .table-panel td:nth-child(5) {
    max-width: 260px;
    white-space: normal;
}

.page-produccion .table-panel td:nth-child(7),
.page-crm_lista .table-panel td:nth-child(10) {
    min-width: 210px;
}

.page-cotizaciones .table-panel th:first-child,
.page-cotizaciones .table-panel td:first-child,
.page-produccion .table-panel th:first-child,
.page-produccion .table-panel td:first-child,
.page-inventario .table-panel th:first-child,
.page-inventario .table-panel td:first-child {
    width: 105px;
}

.page-pagos .inline-form,
.page-despachos .inline-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    min-width: 300px;
}

.page-pagos .inline-form input,
.page-pagos .inline-form select,
.page-despachos .inline-form input,
.page-despachos .inline-form select {
    width: 100%;
}

.page-pagos .inline-form button,
.page-despachos .inline-form button {
    grid-column: 1 / -1;
}

.page-tareas .table-panel {
    margin-bottom: 14px;
}

.page-tareas .table-panel td:nth-child(2),
.page-tareas .table-panel td:nth-child(3) {
    min-width: 180px;
    max-width: 360px;
    white-space: normal;
}

.page-costos_operacion .compact-cost-table {
    max-width: 1180px;
}

.page-costos_operacion .operation-cost-form {
    grid-template-columns: minmax(160px, 1fr) 130px 130px minmax(200px, 1.4fr) 75px auto;
}

.page-maestros .master-page {
    max-width: 1400px;
}

@media (max-width: 1280px) {
    .module-hero,
    .compact-hero {
        min-height: 112px;
        padding: 16px;
    }

    .module-hero h1 {
        font-size: 24px;
    }

    .module-hero p {
        font-size: 13px;
    }

    .page-pagos .inline-form,
    .page-despachos .inline-form,
    .page-costos_operacion .operation-cost-form {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }
}

@media (max-width: 820px) {
    .module-hero,
    .compact-hero {
        min-height: 96px;
        padding: 13px;
    }

    .module-hero span {
        margin-bottom: 4px;
    }

    .module-hero h1 {
        font-size: 21px;
    }

    .module-hero p {
        display: none;
    }

    .page-pagos .inline-form,
    .page-despachos .inline-form,
    .page-costos_operacion .operation-cost-form {
        grid-template-columns: minmax(0, 1fr);
        min-width: 240px;
    }
}

/* Sistema visual de botones y acciones. */
button,
.button {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #c8ced7;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

button:hover,
.button:hover {
    border-color: #929ba8;
    background: #f5f7f9;
    color: var(--ink);
    box-shadow: 0 2px 5px rgba(16, 24, 40, 0.12);
}

button:focus-visible,
.button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
    outline-offset: 2px;
}

button:disabled,
.button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

button.primary,
.primary-link {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #60a5fa 28%));
    color: #fff;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 24%, transparent);
}

button.primary:hover,
.primary-link:hover {
    border-color: var(--accent-dark);
    background: var(--accent-dark);
    color: #fff;
}

button.danger {
    min-height: 34px;
    border-color: #e7aaa2;
    background: #fff4f2;
    color: #a72d20;
}

button.danger:hover {
    border-color: #c94b3c;
    background: #b42318;
    color: #fff;
}

.actions,
.master-page .actions,
.table-panel td.actions {
    display: flex;
    width: auto;
    min-width: 170px;
    max-width: none;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

.actions > *,
.actions form,
.actions button,
.actions .button,
.table-panel td.actions > * {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    max-width: none;
}

.table-panel td.actions {
    padding-left: 10px;
    padding-right: 10px;
}

.master-ciudades .master-table {
    min-width: 720px;
}

.master-ciudades .master-table th:last-child,
.master-ciudades .master-table td:last-child {
    width: 190px;
    min-width: 190px;
}

.toolbar-actions > button,
.toolbar-actions > .button,
.toolbar-actions > form > button,
.form-actions > button,
.form-actions > .button,
.inline-form button {
    flex-shrink: 0;
}

.global-search button {
    min-width: 110px;
    justify-self: start;
}

.search button {
    min-width: 82px;
}

@media (max-width: 820px) {
    .actions,
    .master-page .actions,
    .table-panel td.actions {
        min-width: 160px;
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .toolbar-actions > button,
    .toolbar-actions > .button,
    .form-actions > button,
    .form-actions > .button,
    .global-search button,
    .search button {
        width: 100%;
        min-width: 0;
    }
}
