:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #1f6feb;
    --primary-dark: #174ea6;
    --danger: #dc2626;
    --warning: #f59e0b;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    background: #111827;
    color: white;
    padding: 18px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
}

.topbar p {
    margin: 4px 0 0;
    color: #d1d5db;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar a {
    color: white;
    text-decoration: none;
}

.user-pill {
    background: rgba(255,255,255,0.12);
    color: white;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.container {
    width: min(1600px, calc(100% - 40px));
    margin: 24px auto;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.cards-five {
    grid-template-columns: repeat(5, 1fr);
}

.card,
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.card {
    padding: 18px;
}

.card span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.card strong {
    display: block;
    margin-top: 10px;
    font-size: 32px;
}

.card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.card-link {
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.card-link:hover {
    transform: translateY(-2px);
    border-color: var(--warning);
}

.card-warning strong {
    color: #b45309;
}

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

.title-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.title-panel h2 {
    margin: 0 0 4px;
}

.title-panel p {
    margin: 0;
    color: var(--muted);
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: white;
}

input[readonly] {
    background: #f3f4f6;
    font-weight: bold;
}

small {
    display: block;
    color: var(--muted);
    margin-top: 5px;
}

.filters input {
    flex: 1;
    min-width: 260px;
}

.filters select {
    width: 220px;
}

button,
.btn-primary,
.btn-secondary {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button,
.btn-primary {
    background: var(--primary);
    color: white;
}

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

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1600px;
}

th,
td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td strong {
    font-size: 13px;
}

.status {
    background: #e0ecff;
    color: #174ea6;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
}

.badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.actions {
    white-space: nowrap;
}

.actions a {
    color: var(--primary);
    font-weight: bold;
    text-decoration: none;
    margin-right: 10px;
    font-size: 13px;
}

.actions form {
    display: inline;
}

button.danger {
    background: transparent;
    color: var(--danger);
    padding: 0;
    font-weight: bold;
    font-size: 13px;
}

button.danger:hover {
    background: transparent;
    text-decoration: underline;
}

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

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

.field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: bold;
    font-size: 14px;
}

.full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.messages {
    margin-bottom: 18px;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.login-card {
    width: min(430px, 100%);
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.login-card h2 {
    margin-top: 0;
}

.login-card .field {
    margin-bottom: 16px;
}

.login-card button {
    width: 100%;
}

.help-box {
    margin-top: 18px;
    padding: 12px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
}

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

.invite-box input {
    font-size: 13px;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-right: 8px;
}

.inline-form select {
    width: auto;
    min-width: 150px;
}

.admin-table {
    min-width: 1200px;
}

table td:first-child,
table th:first-child {
    min-width: 320px;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

table td:nth-child(2),
table th:nth-child(2),
table td:nth-child(3),
table th:nth-child(3) {
    min-width: 170px;
}

table td:nth-child(4),
table th:nth-child(4) {
    min-width: 120px;
}

table td:nth-child(5),
table th:nth-child(5) {
    min-width: 110px;
}

table td:nth-child(6),
table th:nth-child(6),
table td:nth-child(7),
table th:nth-child(7),
table td:nth-child(8),
table th:nth-child(8),
table td:nth-child(9),
table th:nth-child(9) {
    min-width: 120px;
}

table td:nth-child(10),
table th:nth-child(10),
table td:nth-child(11),
table th:nth-child(11) {
    min-width: 90px;
}

table td:nth-child(12),
table th:nth-child(12) {
    min-width: 120px;
}

@media (max-width: 1150px) {
    .cards-five {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .cards,
    .cards-five {
        grid-template-columns: 1fr;
    }

    .container {
        width: min(100% - 24px, 1600px);
    }

    .title-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

.email-actions {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.invite-box textarea {
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.45;
    white-space: pre-wrap;
}


/* ===== VERSION 10 - ESPECIALIDADES CON TICKS ===== */

.checkbox-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.checkbox-group {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: #f9fafb;
}

.checkbox-group h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #111827;
}

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

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    line-height: 1.2;
}

.check-item input {
    width: auto;
    min-width: 16px;
    height: 16px;
    cursor: pointer;
}

.check-item span {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .checkbox-groups {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== VERSION 12 - NUEVOS CAMPOS FACTURACION ===== */

table {
    min-width: 1720px;
}

.form-grid textarea {
    resize: vertical;
}


/* ===== VERSION 13 - FORMULARIO VISUAL POR BLOQUES ===== */

.contract-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-section {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.section-number {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.section-header h3 {
    margin: 0;
    font-size: 19px;
    color: #111827;
}

.section-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.form-section .form-grid {
    gap: 18px 22px;
}

.form-section input,
.form-section select,
.form-section textarea {
    min-height: 42px;
}

.visual-specialties {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.visual-specialties .checkbox-group {
    background: #f9fafb;
    border: 1px solid #dbe3ee;
    min-height: 128px;
}

.visual-specialties .checkbox-group h4 {
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
    color: #174ea6;
}

.visual-specialties .checkbox-grid {
    grid-template-columns: 1fr;
}

.check-item {
    padding: 6px 7px;
    border-radius: 8px;
}

.check-item:hover {
    background: #eef6ff;
}

.check-item input:checked + span {
    font-weight: bold;
    color: #174ea6;
}

.calculated-field input {
    background: #eef2f7;
    border-color: #d1d5db;
    font-weight: bold;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: rgba(244, 246, 248, 0.95);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
}

.panel > h2 {
    font-size: 26px;
    margin-bottom: 20px;
}

@media (max-width: 1300px) {
    .visual-specialties {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .visual-specialties {
        grid-template-columns: 1fr;
    }

    .sticky-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .sticky-actions button,
    .sticky-actions a {
        width: 100%;
    }
}


/* ===== VERSION 15 - CONTRATOS AUTORRENOVABLES ===== */

.auto-renew-box {
    border: 1px solid #bfdbfe;
    background: #eef6ff;
    border-radius: 14px;
    padding: 14px;
}

.switch-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.switch-row input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.switch-row strong {
    display: block;
    color: #174ea6;
    font-size: 15px;
}

.switch-row small {
    margin-top: 4px;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}


/* ===== VERSION 16 - TARJETAS CLICABLES ===== */

.card-link {
    cursor: pointer;
}

.card-active {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(31, 111, 235, 0.18);
}

.card-info strong {
    color: #1d4ed8;
}

.card-info:hover {
    border-color: #1d4ed8;
}


/* ===== VERSION 17 - CONDICIONES ECONOMICAS ===== */

.guardia-box {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    border-radius: 14px;
    padding: 14px;
}

.guardia-box .switch-row strong {
    color: #c2410c;
}

.input-suffix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    overflow: hidden;
}

.input-suffix input {
    border: 0;
    border-radius: 0;
}

.input-suffix span {
    min-width: 56px;
    padding: 0 12px;
    color: var(--muted);
    font-weight: bold;
    border-left: 1px solid var(--border);
    text-align: center;
}

.subsection-title {
    margin: 4px 0 0;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    color: #111827;
    font-size: 16px;
}

.discount-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1300px) {
    .discount-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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


/* ===== VERSION 20 - PDF CONTRATO ===== */

.actions a {
    margin-right: 10px;
}


/* ===== VERSION 36 - CABECERA PRO + VERSION ===== */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 16px 20px;
}

.brand h1 {
    margin-bottom: 2px;
}

.brand p {
    margin: 0;
}

.app-version {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.topbar-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-nav a,
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 12px;
    color: #e5edf7;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover,
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.nav-btn-primary {
    color: #ffffff !important;
    background: #0b7be7 !important;
    border-color: #0b7be7 !important;
}

.nav-btn-primary:hover {
    background: #0868c6 !important;
}

.nav-btn-danger {
    color: #ffffff !important;
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

.nav-btn-danger:hover {
    background: rgba(239, 68, 68, 0.32) !important;
}

.login-info {
    color: #cbd5e1;
    font-size: 12px;
    text-align: right;
}

.login-info strong {
    color: #ffffff;
}

.login-info span {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 700;
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
    }

    .topbar-right,
    .main-nav {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .login-info {
        text-align: left;
    }
}


/* ===== VERSION 37 - TARJETA FACTURACION ANUAL ===== */

.cards-six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.card-money strong {
    color: #047857;
    font-size: 26px;
    white-space: nowrap;
}

.card-money {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

@media (max-width: 1400px) {
    .cards-six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .cards-six {
        grid-template-columns: 1fr;
    }
}


/* ===== VERSION 39 - CONTABILIDAD ===== */

.text-right {
    text-align: right !important;
}

.money-cell {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-right: 18px !important;
}


/* ===== VERSION 40 - FIX CONTABILIDAD ===== */

table th.text-right,
table td.text-right,
.money-cell {
    text-align: right !important;
}

.money-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-right: 24px !important;
    font-feature-settings: "tnum";
}


/* ===== VERSION 41 - PRECIO ANUAL CONTABILIDAD REAL ===== */

table th.money-head {
    text-align: right !important;
    padding-right: 26px !important;
}

table td.money-cell {
    text-align: right !important;
    padding-right: 26px !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}


/* ===== VERSION 42 - TABLA COMPACTA PROFESIONAL ===== */

.contracts-table.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: auto;
}

.contracts-table.compact-table th {
    padding: 10px 10px;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #475569;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #dbe3ec;
}

.contracts-table.compact-table td {
    padding: 9px 10px;
    line-height: 1.2;
    vertical-align: middle;
    border-bottom: 1px solid #e5eaf0;
    color: #0f172a;
}

.contracts-table.compact-table tbody tr {
    height: 42px;
}

.contracts-table.compact-table tbody tr:hover {
    background: #f8fbff;
}

.contracts-table .nowrap {
    white-space: nowrap;
}

.contracts-table td.nowrap {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contracts-table small {
    display: block;
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.contracts-table .money-head,
.contracts-table .money-cell,
.contracts-table .days-cell {
    text-align: right !important;
}

.contracts-table .money-cell {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    font-weight: 700;
    white-space: nowrap;
    padding-right: 18px !important;
}

.contracts-table .days-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    padding-right: 14px !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-ok {
    background: #dcfce7;
    color: #166534;
}

.badge-muted {
    background: #e5e7eb;
    color: #374151;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.actions-compact {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.actions-compact form {
    margin: 0;
}

.action-btn {
    min-height: 26px;
    padding: 5px 8px;
    border-radius: 7px;
    border: 1px solid #d5dde7;
    background: #ffffff;
    color: #0f172a;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.action-pdf {
    color: #0f4c81;
}

.action-edit {
    color: #075ed8;
}

.action-delete {
    color: #dc2626;
}

.action-btn:hover {
    background: #f1f5f9;
}

@media (max-width: 1400px) {
    .contracts-table.compact-table {
        font-size: 11px;
    }

    .contracts-table.compact-table th {
        font-size: 10px;
        padding: 8px 8px;
    }

    .contracts-table.compact-table td {
        padding: 8px 8px;
    }
}


/* ===== VERSION 45 - GESTION COMPLETA DE USUARIOS ===== */

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.users-table th,
.users-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e5eaf0;
    vertical-align: middle;
}

.table-input {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #d9e1ea;
    border-radius: 8px;
    font-size: 13px;
    background: #ffffff;
}

.users-table select {
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid #d9e1ea;
    padding: 6px 10px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.user-actions form {
    margin: 0;
}

.btn-small-primary,
.btn-small-secondary,
.btn-small-danger {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 0;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-small-primary {
    background: #0b7be7;
    color: white;
}

.btn-small-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-small-danger {
    background: #fee2e2;
    color: #b91c1c;
}


/* ===== VERSION 46 - PLANIFICACION FACTURACION ===== */

.monthly-plan-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
}

.month-field label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    margin-bottom: 5px;
}

.month-field input {
    width: 100%;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.facturacion-mes[readonly] {
    background: #eef2f7;
    color: #475569;
}

#total_planificado_visible,
#gap_facturacion_visible {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

#gap_facturacion_visible.gap-ok {
    background: #dcfce7;
    color: #166534;
}

#gap_facturacion_visible.gap-warning {
    background: #fef9c3;
    color: #854d0e;
}

#gap_facturacion_visible.gap-danger {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 1200px) {
    .monthly-plan-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .monthly-plan-grid {
        grid-template-columns: 1fr;
    }
}

/* V49 - Backups automáticos y restauración */
.backup-latest {
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 12px 0 14px;
    background: #f8fafc;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.latest-backup-row td {
    font-weight: 700;
    background: #f8fafc;
}
.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e8f1ff;
    color: #1f4f8f;
    font-size: 11px;
    font-weight: 700;
}


/* ===== V51 - PANEL DE FACTURACION MENSUAL ===== */
.nav-btn-facturacion {
    background: #0f766e;
    color: #ffffff !important;
}

.nav-btn-facturacion:hover {
    background: #115e59;
}

.facturacion-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
}

.section-kicker {
    display: inline-block;
    color: #0f766e;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
    margin-bottom: 6px;
}

.facturacion-hero h2 {
    margin: 0 0 6px;
    font-size: 26px;
}

.facturacion-hero p {
    margin: 0;
    color: var(--muted);
}

.facturacion-selector {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.facturacion-selector label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
}

.facturacion-selector select {
    width: 170px;
}

.facturacion-selector input {
    min-width: 260px;
}

.cards-four {
    grid-template-columns: repeat(4, 1fr);
}

.facturacion-cards .card strong {
    font-size: 26px;
}

.card-gap-positive strong,
.gap-positive {
    color: #047857;
    font-weight: 800;
}

.card-gap-negative strong,
.gap-negative {
    color: #b91c1c;
    font-weight: 800;
}

.facturacion-table {
    min-width: 1350px;
}

.facturacion-table .facturacion-importe {
    font-size: 15px;
    font-weight: 900;
    color: #0f766e;
}

@media (max-width: 1100px) {
    .facturacion-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .facturacion-selector {
        justify-content: flex-start;
    }

    .cards-four {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 620px) {
    .cards-four {
        grid-template-columns: 1fr;
    }

    .facturacion-selector select,
    .facturacion-selector input,
    .facturacion-selector button,
    .facturacion-selector .btn-secondary {
        width: 100%;
    }
}

/* V52 - permisos y edición compacta en Facturación */
.role-note {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}
.role-note-ok {
    background: #e0f2fe;
    color: #075985;
}
.inline-billing-form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
}
.inline-billing-form input {
    width: 92px;
    min-width: 92px;
    padding: 7px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-align: right;
    font-weight: 800;
    color: #0f172a;
    background: #ffffff;
}
.inline-billing-form button {
    padding: 7px 9px;
    border: 0;
    border-radius: 8px;
    background: #0f172a;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}
.inline-billing-form button:hover {
    filter: brightness(1.12);
}
.readonly-pill {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid #e2e8f0;
}

/* V54 - Portal modular */
.portal-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: stretch;
    padding: 28px;
    margin-bottom: 22px;
    border-radius: 22px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.20);
}

.portal-hero h2 {
    margin: 8px 0 8px;
    font-size: 32px;
    letter-spacing: -0.04em;
}

.portal-hero p {
    max-width: 820px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.45;
}

.portal-eyebrow {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-hero-badge {
    min-width: 170px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.portal-hero-badge strong {
    font-size: 28px;
    line-height: 1;
}

.portal-hero-badge span {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.85;
    font-weight: 700;
}

.portal-hero-logo {
    min-width: 260px;
    max-width: 360px;
    padding: 16px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-hero-logo img {
    display: block;
    max-width: 100%;
    max-height: 112px;
    width: auto;
    height: auto;
    object-fit: contain;
}

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

.module-card {
    min-height: 190px;
    padding: 22px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.module-card-active:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    border-color: #2563eb;
}

.module-card-disabled {
    opacity: 0.68;
}

.module-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #f1f5f9;
    font-size: 24px;
    margin-bottom: 18px;
}

.module-content h3 {
    margin: 8px 0 8px;
    color: #0f172a;
    font-size: 20px;
}

.module-content p {
    margin: 0;
    color: #64748b;
    line-height: 1.4;
    font-size: 14px;
}

.module-status {
    display: inline-flex;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.module-status.active {
    background: #dcfce7;
    color: #166534;
}

.module-status.soon {
    background: #f1f5f9;
    color: #475569;
}

.module-arrow {
    margin-top: 18px;
    font-weight: 900;
    color: #2563eb;
}

@media (max-width: 760px) {
    .portal-hero {
        flex-direction: column;
        padding: 22px;
    }
    .portal-hero h2 {
        font-size: 26px;
    }

    .portal-hero-logo {
        max-width: 100%;
        min-width: 0;
    }

    .portal-hero-logo img {
        max-height: 78px;
    }
}

/* V55 - Módulo Presupuestos */
.compact-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.presupuesto-status-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.active-filter {
    border-color: #2563eb !important;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .16);
}
.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-card h3 {
    margin: 0 0 12px 0;
}
.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: #eef2ff;
    color: #3730a3;
}
.status-por_hacer { background: #f1f5f9; color: #334155; }
.status-pendiente_enviar { background: #fef3c7; color: #92400e; }
.status-enviado { background: #dbeafe; color: #1d4ed8; }
.status-aceptado { background: #dcfce7; color: #166534; }
.status-finalizado { background: #ede9fe; color: #6d28d9; }
.status-pendiente_facturar { background: #ffedd5; color: #c2410c; }
.status-facturado { background: #ccfbf1; color: #0f766e; }
.progress-cell {
    min-width: 130px;
}
.progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin-bottom: 4px;
}
.progress-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #2563eb;
}
.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.actions-cell form {
    margin: 0;
}
.btn-small {
    padding: 7px 9px;
    font-size: 12px;
}
.empty-state {
    text-align: center;
    padding: 24px;
    color: #64748b;
    font-weight: 700;
}
.money-input {
    text-align: right;
}
@media (max-width: 900px) {
    .compact-header { flex-direction: column; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .header-actions { justify-content: flex-start; }
}

/* V56 - Presupuestos: tarjetas visuales y estructura tipo dashboard */
.page-header,
.compact-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
.page-header h2,
.compact-header h2 {
    margin: 4px 0 6px;
    font-size: 28px;
    letter-spacing: -0.02em;
}
.page-header p,
.compact-header p {
    margin: 0;
    color: var(--muted);
}
.portal-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.summary-grid,
.presupuesto-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.summary-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 102px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    color: var(--text);
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.summary-card span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.summary-card strong {
    margin-top: 8px;
    font-size: 34px;
    line-height: 1;
}
.summary-card.clickable:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 16px 32px rgba(31, 111, 235, 0.15);
}
.summary-card.active-filter {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.kpi-card span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.kpi-card strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    color: #0f172a;
}
.filters-card,
.form-card,
.table-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.form-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: 210px minmax(280px, 1fr) auto; align-items: end; }
.form-card label,
.filters-card label {
    font-weight: 800;
    color: #334155;
}
.form-card input,
.form-card select,
.form-card textarea,
.filters-card input,
.filters-card select {
    margin-top: 6px;
}
.filter-actions,
.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.table-responsive {
    overflow-x: auto;
}
.erp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.erp-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
.erp-table td {
    padding: 12px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}
.erp-table tbody tr:hover {
    background: #f8fafc;
}
.erp-table .num,
.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* V57 - Semáforo de consumo de horas en presupuestos */
.progress-cell.progress-ok .progress-bar span {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}
.progress-cell.progress-warning .progress-bar span {
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
}
.progress-cell.progress-danger .progress-bar span {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}
.hour-progress-card {
    padding: 16px 18px;
}
.large-progress {
    min-width: 100%;
}
.large-progress .progress-bar {
    height: 16px;
    margin: 10px 0 8px 0;
}
.progress-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #0f172a;
}
.progress-label-row span {
    font-weight: 900;
    color: #334155;
}
.large-progress small {
    color: #64748b;
    font-weight: 700;
}

/* V58 - Presupuestos: tabla compacta sin scroll horizontal */
.table-responsive:has(.presupuestos-table-compact) {
    overflow-x: visible;
}
.presupuestos-table-compact {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
    font-size: 11px;
}
.presupuestos-table-compact th,
.presupuestos-table-compact td {
    padding: 7px 8px;
    line-height: 1.15;
    white-space: nowrap;
    vertical-align: middle;
}
.presupuestos-table-compact th {
    font-size: 10px;
    letter-spacing: .055em;
}
.presupuestos-table-compact th:nth-child(1),
.presupuestos-table-compact td:nth-child(1) { width: 9%; }
.presupuestos-table-compact th:nth-child(2),
.presupuestos-table-compact td:nth-child(2) { width: 18%; }
.presupuestos-table-compact th:nth-child(3),
.presupuestos-table-compact td:nth-child(3) { width: 15%; }
.presupuestos-table-compact th:nth-child(4),
.presupuestos-table-compact td:nth-child(4) { width: 8%; }
.presupuestos-table-compact th:nth-child(5),
.presupuestos-table-compact td:nth-child(5) { width: 10%; }
.presupuestos-table-compact th:nth-child(6),
.presupuestos-table-compact td:nth-child(6) { width: 8%; }
.presupuestos-table-compact th:nth-child(7),
.presupuestos-table-compact td:nth-child(7) { width: 9%; }
.presupuestos-table-compact th:nth-child(8),
.presupuestos-table-compact td:nth-child(8) { width: 10%; }
.presupuestos-table-compact th:nth-child(9),
.presupuestos-table-compact td:nth-child(9) { width: 13%; }
.presupuestos-table-compact .cell-truncate,
.presupuestos-table-compact .status-pill {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.presupuestos-table-compact .status-pill {
    padding: 3px 7px;
    font-size: 10.5px;
}
.presupuestos-table-compact .progress-cell {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(45px, 1fr) auto;
    align-items: center;
    gap: 6px;
}
.presupuestos-table-compact .progress-bar {
    height: 7px;
    margin: 0;
}
.presupuestos-table-compact .progress-cell strong {
    font-size: 10.5px;
    white-space: nowrap;
}
.presupuestos-table-compact .actions-cell {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
}
.presupuestos-table-compact .actions-cell form {
    margin: 0;
    display: inline-flex;
}
.presupuestos-table-compact .btn-small,
.presupuestos-table-compact .btn-inline {
    padding: 4px 6px;
    min-height: 24px;
    height: 24px;
    font-size: 10.5px;
    line-height: 1;
    border-radius: 7px;
    white-space: nowrap;
}
.presupuestos-table-compact td strong {
    font-size: 11px;
}
@media (max-width: 1200px) {
    .presupuestos-table-compact {
        font-size: 10px;
    }
    .presupuestos-table-compact th,
    .presupuestos-table-compact td {
        padding: 6px 5px;
    }
    .presupuestos-table-compact .btn-small,
    .presupuestos-table-compact .btn-inline {
        padding: 3px 5px;
        font-size: 9.5px;
    }
}

/* V59 - Presupuestos: resumen compacto dividido */
.presupuestos-resumen-split {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(360px, .9fr);
    gap: 22px;
    align-items: center;
    margin-bottom: 18px;
}
.presupuestos-status-compact {
    display: grid;
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    gap: 8px;
    align-items: stretch;
}
.status-mini-card {
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .055);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.status-mini-card:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    box-shadow: 0 12px 22px rgba(31, 111, 235, .13);
}
.status-mini-card.active-filter {
    border-color: var(--primary) !important;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .14);
}
.status-mini-card span {
    color: #64748b;
    font-size: 10px;
    line-height: 1.05;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.status-mini-card strong {
    color: #020617;
    font-size: 22px;
    line-height: 1;
    font-weight: 950;
}
.presupuestos-kpi-list {
    background: #fff;
    border-radius: 18px;
    padding: 8px 16px;
    border: 1px solid transparent;
    box-shadow: none;
}
.kpi-list-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}
.kpi-list-row:last-child {
    border-bottom: 0;
}
.kpi-list-row span {
    color: #334155;
    font-weight: 700;
}
.kpi-list-row strong {
    color: #020617;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.kpi-progress-row {
    grid-template-columns: minmax(150px, 1fr) auto minmax(110px, 170px);
}
.kpi-progress-row .progress-bar {
    margin: 0;
    height: 8px;
}
.presupuestos-kpi-list.progress-ok .kpi-progress-row strong { color: #16a34a; }
.presupuestos-kpi-list.progress-warning .kpi-progress-row strong { color: #f59e0b; }
.presupuestos-kpi-list.progress-danger .kpi-progress-row strong { color: #dc2626; }

@media (max-width: 1350px) {
    .presupuestos-resumen-split {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .presupuestos-kpi-list {
        padding: 8px 14px;
    }
}
@media (max-width: 900px) {
    .presupuestos-status-compact {
        grid-template-columns: repeat(2, minmax(110px, 1fr));
    }
    .kpi-progress-row {
        grid-template-columns: 1fr auto;
    }
    .kpi-progress-row .progress-bar {
        grid-column: 1 / -1;
    }
}

/* V60 - Clientes y horas: diseño compacto sin scroll horizontal */
.compact-module-card {
    overflow: hidden;
}

.no-horizontal-scroll,
.table-responsive:has(.compact-no-scroll-table) {
    overflow-x: hidden !important;
    width: 100%;
}

.compact-no-scroll-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.compact-no-scroll-table th,
.compact-no-scroll-table td {
    padding: 8px 10px;
    line-height: 1.15;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clientes-compact-table th:nth-child(1),
.clientes-compact-table td:nth-child(1) { width: 38%; }
.clientes-compact-table th:nth-child(2),
.clientes-compact-table td:nth-child(2) { width: 14%; }
.clientes-compact-table th:nth-child(3),
.clientes-compact-table td:nth-child(3) { width: 22%; }
.clientes-compact-table th:nth-child(4),
.clientes-compact-table td:nth-child(4) { width: 13%; }
.clientes-compact-table th:nth-child(5),
.clientes-compact-table td:nth-child(5) { width: 13%; }

.horas-compact-table th:nth-child(1),
.horas-compact-table td:nth-child(1) { width: 13%; }
.horas-compact-table th:nth-child(2),
.horas-compact-table td:nth-child(2) { width: 12%; }
.horas-compact-table th:nth-child(3),
.horas-compact-table td:nth-child(3) { width: 42%; }
.horas-compact-table th:nth-child(4),
.horas-compact-table td:nth-child(4) { width: 18%; }
.horas-compact-table th:nth-child(5),
.horas-compact-table td:nth-child(5) { width: 15%; }

.compact-actions-cell,
.compact-no-scroll-table .actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.compact-actions-cell form,
.compact-no-scroll-table .actions-cell form {
    display: inline-flex;
    margin: 0;
}

.compact-actions-cell .btn,
.compact-no-scroll-table .btn-small {
    min-height: 26px;
    height: 26px;
    padding: 0 9px;
    font-size: 0.72rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ultra-compact-header {
    padding-top: 14px;
    padding-bottom: 14px;
}

.compact-kpi-row {
    gap: 10px;
}

.compact-kpi-row .kpi-card {
    min-height: 68px;
    padding: 12px 14px;
}

.compact-hours-form {
    padding: 14px 16px;
}

.compact-hours-form .form-grid {
    gap: 12px;
}

.compact-hours-form input {
    min-height: 34px;
    height: 34px;
}

.compact-hours-form .form-actions {
    margin-top: 10px;
}

@media (max-width: 1200px) {
    .compact-no-scroll-table {
        font-size: 0.72rem;
    }
    .compact-no-scroll-table th,
    .compact-no-scroll-table td {
        padding: 7px 7px;
    }
    .compact-actions-cell .btn,
    .compact-no-scroll-table .btn-small {
        padding: 0 7px;
        font-size: 0.68rem;
    }
}


/* V61 - Compactación real clientes/horas sin scroll horizontal */
.compact-module-card .table-responsive.no-horizontal-scroll {
    overflow-x: hidden !important;
    max-width: 100%;
}

.compact-module-card .compact-no-scroll-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    font-size: 0.72rem;
}

.compact-module-card .compact-no-scroll-table thead th,
.compact-module-card .compact-no-scroll-table tbody td {
    padding: 6px 8px !important;
    height: 34px;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.clientes-compact-table th:nth-child(1),
.clientes-compact-table td:nth-child(1) { width: 36% !important; }
.clientes-compact-table th:nth-child(2),
.clientes-compact-table td:nth-child(2) { width: 13% !important; }
.clientes-compact-table th:nth-child(3),
.clientes-compact-table td:nth-child(3) { width: 23% !important; }
.clientes-compact-table th:nth-child(4),
.clientes-compact-table td:nth-child(4) { width: 13% !important; }
.clientes-compact-table th:nth-child(5),
.clientes-compact-table td:nth-child(5) { width: 15% !important; }

.horas-compact-table th:nth-child(1),
.horas-compact-table td:nth-child(1) { width: 14% !important; }
.horas-compact-table th:nth-child(2),
.horas-compact-table td:nth-child(2) { width: 12% !important; }
.horas-compact-table th:nth-child(3),
.horas-compact-table td:nth-child(3) { width: 43% !important; }
.horas-compact-table th:nth-child(4),
.horas-compact-table td:nth-child(4) { width: 16% !important; }
.horas-compact-table th:nth-child(5),
.horas-compact-table td:nth-child(5) { width: 15% !important; }

.compact-module-card td.actions-cell {
    overflow: visible !important;
    text-overflow: clip !important;
}

.compact-actions-cell {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    white-space: nowrap !important;
    width: 100%;
}

.compact-actions-cell form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
}

.compact-actions-cell .btn,
.compact-actions-cell .btn-small,
.compact-actions-cell button {
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 7px !important;
    font-size: 0.66rem !important;
    border-radius: 7px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.compact-module-card .erp-table tbody tr {
    min-height: 34px !important;
}

.compact-hours-form .form-grid {
    grid-template-columns: 180px minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
    align-items: end;
}
.compact-hours-form .form-actions {
    margin-top: 0 !important;
    display: flex;
    align-items: end;
}
.compact-hours-form .form-actions .btn {
    height: 34px;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .compact-module-card .compact-no-scroll-table {
        font-size: 0.66rem;
    }
    .compact-module-card .compact-no-scroll-table thead th,
    .compact-module-card .compact-no-scroll-table tbody td {
        padding: 5px 5px !important;
    }
    .compact-actions-cell {
        gap: 3px !important;
    }
    .compact-actions-cell .btn,
    .compact-actions-cell .btn-small,
    .compact-actions-cell button {
        padding: 0 5px !important;
        font-size: 0.62rem !important;
    }
}

/* V63 - Base datos artículos y materiales en presupuestos */
.articulos-compact-table th:nth-child(1),
.articulos-compact-table td:nth-child(1) { width: 10% !important; }
.articulos-compact-table th:nth-child(2),
.articulos-compact-table td:nth-child(2) { width: 28% !important; }
.articulos-compact-table th:nth-child(3),
.articulos-compact-table td:nth-child(3) { width: 16% !important; }
.articulos-compact-table th:nth-child(4),
.articulos-compact-table td:nth-child(4) { width: 10% !important; }
.articulos-compact-table th:nth-child(5),
.articulos-compact-table td:nth-child(5) { width: 8% !important; }
.articulos-compact-table th:nth-child(6),
.articulos-compact-table td:nth-child(6) { width: 10% !important; }
.articulos-compact-table th:nth-child(7),
.articulos-compact-table td:nth-child(7) { width: 12% !important; }
.articulos-compact-table th:nth-child(8),
.articulos-compact-table td:nth-child(8) { width: 14% !important; }

.info-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 18px;
    color: var(--text);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
.info-card p { margin: 6px 0 0; color: var(--muted); }

.table-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.table-header-inline h3 { margin: 0; }
.table-header-inline p { margin: 3px 0 0; color: var(--muted); font-size: 0.84rem; }
.table-header-inline span { color: var(--muted); font-size: 0.84rem; }

.presupuesto-materiales-section { margin-top: 18px; }
.inline-material-form {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr 1fr 72px 95px 75px 1fr auto auto;
    gap: 8px;
    align-items: end;
    padding: 10px;
    margin-bottom: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.inline-material-form label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
}
.inline-material-form input,
.inline-material-form select {
    height: 32px;
    min-height: 32px;
    padding: 6px 8px;
    font-size: 0.74rem;
    border-radius: 8px;
}
.inline-material-form .btn {
    height: 32px;
    white-space: nowrap;
}
.material-check {
    display: flex !important;
    align-items: center;
    gap: 5px;
    height: 32px;
    white-space: nowrap;
}
.material-check input { width: auto; height: auto; }

.materiales-compact-table { font-size: 0.68rem !important; }
.materiales-compact-table th,
.materiales-compact-table td { padding: 4px 5px !important; height: 30px !important; }
.materiales-compact-table th:nth-child(1),
.materiales-compact-table td:nth-child(1) { width: 20% !important; }
.materiales-compact-table th:nth-child(2),
.materiales-compact-table td:nth-child(2) { width: 12% !important; }
.materiales-compact-table th:nth-child(3),
.materiales-compact-table td:nth-child(3) { width: 7% !important; }
.materiales-compact-table th:nth-child(4),
.materiales-compact-table td:nth-child(4) { width: 9% !important; }
.materiales-compact-table th:nth-child(5),
.materiales-compact-table td:nth-child(5) { width: 7% !important; }
.materiales-compact-table th:nth-child(6),
.materiales-compact-table td:nth-child(6) { width: 9% !important; }
.materiales-compact-table th:nth-child(7),
.materiales-compact-table td:nth-child(7) { width: 9% !important; }
.materiales-compact-table th:nth-child(8),
.materiales-compact-table td:nth-child(8) { width: 6% !important; }
.materiales-compact-table th:nth-child(9),
.materiales-compact-table td:nth-child(9) { width: 12% !important; }
.materiales-compact-table th:nth-child(10),
.materiales-compact-table td:nth-child(10) { width: 12% !important; }
.table-input {
    height: 24px !important;
    min-height: 24px !important;
    padding: 3px 5px !important;
    border-radius: 6px !important;
    font-size: 0.66rem !important;
}
.center { text-align: center; }

@media (max-width: 1300px) {
    .inline-material-form {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }
}

/* V64 - Compactar edición de presupuesto + mayúsculas visuales globales */
body,
body * {
    text-transform: uppercase;
}

/* Evita que datos técnicos o textos largos rompan la maqueta */
input,
select,
textarea,
button,
.btn,
.btn-primary,
.btn-secondary,
.nav-btn {
    text-transform: uppercase;
}

.presupuesto-edit-header {
    padding: 14px 18px !important;
    margin-bottom: 12px !important;
}
.presupuesto-edit-header h2 {
    margin: 2px 0 3px !important;
    font-size: 1.45rem !important;
    line-height: 1.05 !important;
}
.presupuesto-edit-header p {
    margin: 0 !important;
    font-size: 0.82rem !important;
}
.presupuesto-edit-header .header-actions .btn {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 12px !important;
    font-size: 0.78rem !important;
}

.presupuesto-form-compact {
    padding: 14px 16px !important;
    margin-bottom: 12px !important;
}
.presupuesto-main-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.35fr 1.25fr 0.9fr;
    gap: 10px 12px;
    align-items: end;
}
.presupuesto-main-grid label,
.presupuesto-form-compact label {
    margin: 0 !important;
    font-size: 0.86rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
}
.presupuesto-form-compact input,
.presupuesto-form-compact select,
.presupuesto-form-compact textarea {
    height: 34px !important;
    min-height: 34px !important;
    padding: 7px 10px !important;
    font-size: 0.86rem !important;
    border-radius: 9px !important;
    margin-top: 5px !important;
}
.presupuesto-form-compact small {
    margin-top: 4px !important;
    font-size: 0.72rem !important;
    line-height: 1.1 !important;
}
.presupuesto-observaciones {
    grid-column: span 2;
}
.presupuesto-form-actions {
    margin-top: 0 !important;
    align-self: end;
    display: flex !important;
    gap: 8px !important;
    white-space: nowrap !important;
}
.presupuesto-form-actions .btn,
.presupuesto-form-actions button {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 13px !important;
    font-size: 0.82rem !important;
    border-radius: 9px !important;
}

.presupuesto-materiales-section {
    margin-top: 12px !important;
    padding: 14px 16px !important;
}
.presupuesto-materiales-section .table-header-inline {
    margin-bottom: 8px !important;
}
.presupuesto-materiales-section .table-header-inline h3 {
    font-size: 1.05rem !important;
    line-height: 1.1 !important;
}
.presupuesto-materiales-section .table-header-inline p {
    font-size: 0.78rem !important;
    margin-top: 2px !important;
}
.presupuesto-materiales-section .table-header-inline .btn {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 12px !important;
    font-size: 0.76rem !important;
}
.inline-material-form {
    grid-template-columns: 1.05fr 1.35fr 0.9fr 64px 82px 66px 0.95fr auto auto !important;
    gap: 6px !important;
    padding: 8px !important;
    margin-bottom: 8px !important;
}
.inline-material-form label {
    font-size: 0.68rem !important;
    line-height: 1.05 !important;
}
.inline-material-form input,
.inline-material-form select,
.inline-material-form .btn,
.material-check {
    height: 29px !important;
    min-height: 29px !important;
    font-size: 0.70rem !important;
    padding: 4px 7px !important;
    border-radius: 7px !important;
}
.inline-material-form .btn {
    padding: 0 10px !important;
}
.materiales-compact-table th,
.materiales-compact-table td {
    height: 27px !important;
    padding: 3px 5px !important;
}

@media (max-width: 1350px) {
    .presupuesto-main-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .presupuesto-observaciones {
        grid-column: span 2;
    }
}
@media (max-width: 980px) {
    .presupuesto-main-grid {
        grid-template-columns: 1fr 1fr;
    }
    .presupuesto-observaciones,
    .presupuesto-form-actions {
        grid-column: 1 / -1;
    }
}


/* V66 - Jerarquía visual global manteniendo mayúsculas */
body,
body * {
    text-transform: uppercase;
}

/* Títulos principales: más protagonistas */
h1,
.topbar h1 {
    font-size: 1.35rem !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
    letter-spacing: -0.025em !important;
}

h2,
.title-panel h2,
.portal-hero h2,
.presupuesto-edit-header h2 {
    font-size: clamp(1.35rem, 1.9vw, 2.05rem) !important;
    line-height: 1.08 !important;
    font-weight: 900 !important;
    letter-spacing: -0.045em !important;
}

h3,
.module-content h3,
.table-header-inline h3,
.presupuesto-materiales-section .table-header-inline h3 {
    font-size: clamp(1.02rem, 1.15vw, 1.28rem) !important;
    line-height: 1.12 !important;
    font-weight: 900 !important;
    letter-spacing: -0.025em !important;
}

h4,
.card-title,
.section-title {
    font-size: 0.95rem !important;
    line-height: 1.15 !important;
    font-weight: 850 !important;
    letter-spacing: 0.01em !important;
}

/* Subtítulos y textos descriptivos: más pequeños y ligeros */
p,
.title-panel p,
.portal-hero p,
.module-content p,
.presupuesto-edit-header p,
.presupuesto-materiales-section .table-header-inline p {
    font-size: 0.82rem !important;
    line-height: 1.42 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

small,
.muted,
.help-text,
.field-help,
.presupuesto-form-compact small {
    font-size: 0.70rem !important;
    line-height: 1.25 !important;
    font-style: italic !important;
    font-weight: 600 !important;
    color: #64748b !important;
    letter-spacing: 0.01em !important;
}

/* Etiquetas, chips y navegación */
label,
.field label,
.presupuesto-main-grid label,
.presupuesto-form-compact label,
.inline-material-form label {
    font-size: 0.76rem !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em !important;
}

.nav-btn,
.topbar nav a,
button,
.btn,
.btn-primary,
.btn-secondary,
.user-pill {
    font-size: 0.76rem !important;
    font-weight: 850 !important;
    letter-spacing: 0.01em !important;
}

.portal-eyebrow,
.module-status,
.status,
.badge {
    font-size: 0.64rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.075em !important;
}

/* Tarjetas del portal: diferencia clara entre estado, título y descripción */
.module-card {
    padding: 20px !important;
}
.module-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 1.25rem !important;
    margin-bottom: 14px !important;
}
.module-content h3 {
    margin: 7px 0 6px !important;
}
.module-content p {
    color: #64748b !important;
    font-size: 0.78rem !important;
}
.module-arrow {
    font-size: 0.82rem !important;
    letter-spacing: 0.02em !important;
}

/* Banner principal */
.portal-hero {
    padding: 24px 28px !important;
}
.portal-hero p {
    max-width: 840px !important;
    font-size: 0.84rem !important;
}
.portal-hero-logo {
    min-width: 250px !important;
}
.portal-hero-logo img {
    max-height: 105px !important;
}

/* Formularios: valores legibles sin que todo parezca título */
input,
select,
textarea {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

textarea {
    line-height: 1.35 !important;
}

/* Tablas: cabeceras diferenciadas y datos compactos */
th {
    font-size: 0.66rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.055em !important;
    color: #475569 !important;
}

td,
td strong,
.erp-table td,
.compact-no-scroll-table td,
.materiales-compact-table td {
    font-size: 0.72rem !important;
    line-height: 1.12 !important;
    font-weight: 650 !important;
}

td strong,
.module-card strong,
.card strong {
    font-weight: 900 !important;
}

/* Métricas y números */
.card strong,
.summary-value,
.kpi-value,
.metric-value {
    font-size: clamp(1.35rem, 1.6vw, 1.9rem) !important;
    font-weight: 950 !important;
    letter-spacing: -0.035em !important;
}

.card span,
.summary-label,
.kpi-label,
.metric-label {
    font-size: 0.68rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.055em !important;
    color: #475569 !important;
}

/* Botones de acciones de tabla más discretos */
.actions a,
.actions button,
.actions-cell a,
.actions-cell button,
button.danger {
    font-size: 0.68rem !important;
    font-weight: 850 !important;
}

/* La zona de versión superior ya actúa como referencia; evitar competir visualmente */
.version-pill,
.topbar .version-pill {
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
}


/* =========================================================
   V1.72 - FASE 4: FORMULARIOS PREMIUM
   Mejora visual sin cambiar la operativa ni nombres de campos.
   ========================================================= */
.premium-form-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.10), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef5ff 100%) !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08) !important;
}
.premium-form-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    top: -90px;
    width: 230px;
    height: 230px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    pointer-events: none;
}
.premium-form-hero h2 {
    letter-spacing: -0.045em !important;
    color: #0f2f63 !important;
}
.premium-form-hero p {
    max-width: 900px;
    color: #50627a !important;
    line-height: 1.45 !important;
}
.premium-form-panel {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.premium-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.premium-section,
.premium-form-card {
    position: relative;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.075) !important;
    padding: 22px !important;
    overflow: hidden;
}
.premium-section::before,
.premium-form-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #2563eb, #60a5fa);
}
.premium-section:hover,
.premium-form-card:hover {
    border-color: rgba(37, 99, 235, 0.20) !important;
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.095) !important;
}
.premium-section .section-header {
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
    padding-bottom: 16px !important;
    margin-bottom: 18px !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28) !important;
}
.premium-section .section-number {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #0b5ee7, #2f7df3) !important;
    color: #fff !important;
    font-size: 0.78rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.02em !important;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25) !important;
}
.premium-section .section-header h3 {
    margin: 0 !important;
    font-size: 1.05rem !important;
    color: #102a55 !important;
    letter-spacing: -0.02em !important;
}
.premium-section .section-header p {
    margin: 5px 0 0 0 !important;
    color: #64748b !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}
.premium-grid,
.premium-form-card .form-grid,
.premium-form-card .presupuesto-main-grid {
    gap: 16px !important;
}
.premium-form .field,
.premium-form-card label,
.premium-form-card .field {
    position: relative;
}
.premium-form label,
.premium-form-card label,
.premium-form .field > label {
    color: #1e3354 !important;
    font-size: 0.72rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.025em !important;
    margin-bottom: 7px !important;
}
.premium-form input,
.premium-form select,
.premium-form textarea,
.premium-form-card input,
.premium-form-card select,
.premium-form-card textarea {
    min-height: 42px !important;
    border-radius: 13px !important;
    border: 1px solid #d8e0ea !important;
    background: #fff !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(15, 23, 42, 0.03) !important;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, transform .16s ease !important;
}
.premium-form textarea,
.premium-form-card textarea {
    min-height: 96px !important;
    padding-top: 12px !important;
}
.premium-form input:focus,
.premium-form select:focus,
.premium-form textarea:focus,
.premium-form-card input:focus,
.premium-form-card select:focus,
.premium-form-card textarea:focus {
    outline: none !important;
    border-color: #2563eb !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
}
.premium-form small,
.premium-form-card small {
    display: block;
    margin-top: 6px;
    color: #7b8aa0 !important;
    font-size: 0.68rem !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
}
.input-suffix {
    display: flex !important;
    align-items: stretch !important;
    border-radius: 13px !important;
}
.input-suffix input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.input-suffix span {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0 13px !important;
    border: 1px solid #d8e0ea !important;
    border-left: 0 !important;
    border-radius: 0 13px 13px 0 !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 0.74rem !important;
    font-weight: 900 !important;
}
.premium-form .calculated-field input {
    background: linear-gradient(180deg, #eef6ff, #f8fbff) !important;
    color: #0b4ba8 !important;
    font-weight: 950 !important;
}
.monthly-plan-grid {
    background: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    border-radius: 18px !important;
    padding: 14px !important;
}
.month-field {
    background: #ffffff !important;
    border-radius: 14px !important;
    padding: 10px !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
}
.visual-specialties .checkbox-group,
.guardia-box,
.auto-renew-box {
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
    border-radius: 18px !important;
    padding: 15px !important;
}
.visual-specialties h4,
.subsection-title {
    color: #102a55 !important;
    font-weight: 950 !important;
    letter-spacing: 0.015em !important;
}
.check-item {
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    border-radius: 12px !important;
    background: #fff !important;
    padding: 9px 10px !important;
    transition: border-color .16s ease, background-color .16s ease, transform .16s ease !important;
}
.check-item:hover {
    border-color: rgba(37, 99, 235, 0.35) !important;
    background: #f4f8ff !important;
    transform: translateY(-1px);
}
.check-item input:checked + span {
    color: #0b5ee7 !important;
    font-weight: 950 !important;
}
.switch-row {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
}
.switch-row input[type="checkbox"] {
    width: 48px !important;
    min-width: 48px !important;
    height: 26px !important;
    appearance: none !important;
    border-radius: 999px !important;
    border: 0 !important;
    background: #cbd5e1 !important;
    position: relative !important;
    cursor: pointer !important;
}
.switch-row input[type="checkbox"]::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 3px;
    left: 3px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(15,23,42,0.25);
    transition: transform .18s ease;
}
.switch-row input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #0b5ee7, #22c55e) !important;
}
.switch-row input[type="checkbox"]:checked::after {
    transform: translateX(22px);
}
.switch-row strong {
    color: #102a55 !important;
    font-size: 0.84rem !important;
    font-weight: 950 !important;
}
.premium-sticky-actions,
.premium-form-actions,
.premium-form-card .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin-top: 18px !important;
    padding: 14px !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.08) !important;
}
.premium-sticky-actions button,
.premium-form-actions button,
.premium-form-card .form-actions button,
.premium-sticky-actions .btn-secondary,
.premium-form-card .form-actions .btn-secondary {
    min-height: 40px !important;
    border-radius: 12px !important;
}
@media (max-width: 900px) {
    .premium-section,
    .premium-form-card {
        padding: 16px !important;
        border-radius: 18px !important;
    }
    .premium-section .section-header {
        gap: 10px !important;
    }
    .premium-section .section-number {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
    }
}


/* =========================================================
   V1.73 - REPARACION VISUAL PRESUPUESTOS
   ========================================================= */
.budget-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 26px 28px;
    margin-bottom: 18px;
    border: 1px solid #dbe4f0;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .16), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 18px 38px rgba(15, 23, 42, .08);
}
.budget-hero-main h2 {
    margin: 8px 0 8px;
    color: #071f4a;
    font-size: clamp(30px, 3vw, 44px);
    line-height: 1;
    letter-spacing: -.04em;
}
.budget-hero-main p {
    max-width: 920px;
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.55;
}
.budget-hero-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 280px;
}
.budget-command-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(350px, .82fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}
.budget-status-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 12px;
}
.budget-status-card {
    position: relative;
    overflow: hidden;
    min-height: 102px;
    padding: 16px;
    border: 1px solid #dfe7f2;
    border-radius: 18px;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .065);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.budget-status-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: #dbeafe;
}
.budget-status-card.total::before,
.budget-status-card.active-filter::before { background: #2563eb; }
.budget-status-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 18px 34px rgba(37, 99, 235, .14);
}
.budget-status-card.active-filter {
    border-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}
.budget-status-card span {
    display: block;
    color: #52627a;
    font-size: 10.5px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .065em;
}
.budget-status-card strong {
    display: block;
    margin-top: 8px;
    color: #020617;
    font-size: 32px;
    line-height: 1;
    font-weight: 950;
}
.budget-status-card small {
    margin-top: 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}
.budget-summary-panel {
    border-radius: 20px;
    padding: 18px;
    border: 1px solid #dbeafe;
    background: linear-gradient(160deg, #07265c 0%, #0b3b82 100%);
    color: #ffffff;
    box-shadow: 0 18px 38px rgba(7, 38, 92, .22);
}
.budget-summary-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,.18);
}
.budget-summary-header span,
.budget-summary-lines span,
.budget-global-progress span {
    color: rgba(255,255,255,.76);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .055em;
}
.budget-summary-header strong {
    display: block;
    margin-top: 5px;
    font-size: 34px;
    line-height: 1;
}
.budget-summary-money {
    padding: 9px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    font-weight: 950;
    font-size: 18px;
    white-space: nowrap;
}
.budget-summary-lines {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}
.budget-summary-lines div {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.10);
}
.budget-summary-lines strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}
.budget-global-progress .progress-label-row strong { color: #ffffff; }
.budget-global-progress .progress-bar {
    height: 10px;
    margin-top: 10px;
    background: rgba(255,255,255,.20);
}
.budget-filter-bar {
    display: grid;
    grid-template-columns: 210px minmax(280px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 16px 18px;
    margin-bottom: 18px;
    border: 1px solid #dfe7f2;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .055);
}
.budget-filter-bar label {
    color: #334155;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.budget-filter-bar input,
.budget-filter-bar select {
    margin-top: 7px;
    height: 40px;
    border-color: #d5dfec;
    border-radius: 12px;
    background: #f8fafc;
}
.budget-filter-bar input:focus,
.budget-filter-bar select:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.budget-table-card {
    overflow: hidden;
    border: 1px solid #dbe4f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}
.budget-table-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.budget-table-title h3 {
    margin: 5px 0 0;
    color: #071f4a;
    font-size: 20px;
}
.budget-table-counter {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef6ff;
    color: #174ea6;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}
.budget-table-wrap {
    max-height: 58vh;
    overflow: auto;
}
.budget-erp-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}
.budget-erp-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 12px 12px;
    background: #eef3f9;
    color: #263852;
    border-bottom: 1px solid #cbd5e1;
    border-right: 1px solid #dbe4f0;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-size: 10.5px;
    white-space: nowrap;
}
.budget-erp-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid #edf2f7;
    border-right: 1px solid #edf2f7;
    background: #ffffff;
    vertical-align: middle;
}
.budget-erp-table tbody tr:nth-child(even) td { background: #fbfdff; }
.budget-erp-table tbody tr:hover td { background: #eff6ff; }
.budget-code strong {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 950;
    letter-spacing: .03em;
}
.budget-client-cell strong,
.budget-client-cell span {
    display: block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.budget-client-cell strong {
    color: #0f172a;
    font-weight: 950;
}
.budget-client-cell span {
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}
.budget-money {
    color: #0f172a;
    font-weight: 950;
}
.budget-progress-cell {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 155px;
}
.budget-progress-cell .progress-bar {
    height: 8px;
    margin: 0;
}
.budget-progress-cell strong {
    min-width: 52px;
    text-align: right;
    font-size: 11px;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}
.budget-progress-cell.progress-ok strong { color: #16a34a; }
.budget-progress-cell.progress-warning strong { color: #f59e0b; }
.budget-progress-cell.progress-danger strong { color: #dc2626; }
.budget-actions-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.budget-actions-cell form { margin: 0; display: inline-flex; }
.budget-actions-cell .btn-small,
.budget-actions-cell .btn-inline {
    min-height: 26px;
    height: 26px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 950;
    line-height: 1;
}
.btn-light-action {
    background: #f1f5f9;
    color: #174ea6;
    border: 1px solid #dbe4f0;
}
.btn-light-action:hover { background: #e0edff; }
@media (max-width: 1350px) {
    .budget-command-grid { grid-template-columns: 1fr; }
    .budget-status-board { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}
@media (max-width: 900px) {
    .budget-hero { flex-direction: column; }
    .budget-hero-actions { justify-content: flex-start; min-width: 0; }
    .budget-status-board { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .budget-filter-bar { grid-template-columns: 1fr; }
}

   V1.71 - ARTÍCULOS VISUAL PREMIUM / ERP
   ============================================================ */
.module-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 26px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 55%, #eef6ff 100%);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.07);
}
.module-hero-content p {
    max-width: 820px;
    color: #526174;
    letter-spacing: .01em;
}
.module-hero-actions {
    align-items: center;
    white-space: nowrap;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.articulos-search-card {
    padding: 22px 24px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}
.articulos-search-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #0f2342;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.section-icon {
    color: #2563eb;
    font-weight: 900;
}
.articulos-search-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    align-items: center;
    gap: 16px;
}
.articulos-search-row input {
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid #d7dee8;
    padding: 0 16px;
    font-size: 14px;
    background: #fbfdff;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.articulos-search-row input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    background: #fff;
    outline: none;
}
.articulos-kpi-card {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 22px 20px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
    margin-bottom: 22px;
}
.articulo-kpi-item {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 86px;
    padding: 0 22px;
    border-right: 1px solid #e5eaf1;
}
.articulo-kpi-item:last-child { border-right: 0; }
.kpi-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
}
.kpi-blue { color: #1d4ed8; background: #eaf2ff; }
.kpi-green { color: #059669; background: #e8fbf3; }
.kpi-orange { color: #d97706; background: #fff3df; }
.kpi-purple { color: #7c3aed; background: #f0eaff; }
.kpi-mint { color: #0f9f73; background: #e5fbf3; }
.articulo-kpi-item span {
    display: block;
    color: #526174;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.articulo-kpi-item strong {
    display: block;
    margin-top: 5px;
    color: #06162d;
    font-size: 24px;
    line-height: 1.1;
}
.articulo-kpi-item small {
    display: block;
    margin-top: 5px;
    color: #75849a;
    font-size: 12px;
}
.articulos-list-card {
    padding: 18px;
    background: #fff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
}
.articulos-table-header {
    align-items: flex-start;
    margin-bottom: 16px;
    border-bottom: 0;
}
.articulos-table-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #0f2342;
}
.articulos-table-header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
}
.table-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: #f4f7fb;
    color: #526174;
    border: 1px solid #e5eaf1;
    font-weight: 800;
    font-size: 12px;
}
.articulos-table-wrap {
    border: 1px solid #e5eaf1;
    border-radius: 14px;
    overflow: auto;
    background: #fff;
}
.articulos-premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 980px;
}
.articulos-premium-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: #164074;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 13px 16px;
    border-bottom: 1px solid #d7e0ec;
}
.articulos-premium-table tbody td {
    padding: 15px 16px;
    border-bottom: 1px solid #eef2f7;
    color: #0f2342;
    vertical-align: middle;
}
.articulos-premium-table tbody tr:nth-child(even) td { background: #fbfdff; }
.articulos-premium-table tbody tr:hover td {
    background: #f3f8ff;
}
.article-ref-cell strong {
    color: #1d4ed8;
    font-size: 13px;
}
.article-main-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 260px;
}
.article-main-cell strong {
    color: #0f2342;
    font-size: 13px;
}
.article-main-cell small {
    color: #64748b;
    font-size: 12px;
    text-transform: none;
}
.supplier-pill, .location-pill, .discount-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.supplier-pill { background: #eef4ff; color: #1e3a8a; }
.location-pill { background: #f4f7fb; color: #334155; }
.discount-pill { background: #dcfce7; color: #047857; }
.article-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.article-actions form { margin: 0; }
.table-footer-line {
    padding: 14px 8px 2px;
    color: #64748b;
    font-size: 13px;
}
@media (max-width: 1100px) {
    .articulos-kpi-card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .articulo-kpi-item { border-right: 0; border-bottom: 1px solid #e5eaf1; padding: 14px; }
    .module-hero { flex-direction: column; align-items: flex-start; }
    .articulos-search-row { grid-template-columns: 1fr; }
}

/* V1.89 - Ajuste exclusivo tabla Artículos: compacta, sin scroll horizontal y acciones en una línea */
.articulos-table-wrap {
    overflow-x: hidden;
}

.articulos-premium-table {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
}

.articulos-premium-table thead th {
    padding: 9px 10px;
}

.articulos-premium-table tbody td {
    padding: 8px 10px;
    height: 42px;
    line-height: 1.15;
}

.articulos-premium-table th:nth-child(1),
.articulos-premium-table td:nth-child(1) {
    width: 130px;
}

.articulos-premium-table th:nth-child(2),
.articulos-premium-table td:nth-child(2) {
    width: auto;
}

.articulos-premium-table th:nth-child(3),
.articulos-premium-table td:nth-child(3) {
    width: 120px;
}

.articulos-premium-table th:nth-child(4),
.articulos-premium-table td:nth-child(4),
.articulos-premium-table th:nth-child(5),
.articulos-premium-table td:nth-child(5),
.articulos-premium-table th:nth-child(6),
.articulos-premium-table td:nth-child(6) {
    width: 92px;
}

.articulos-premium-table th:nth-child(7),
.articulos-premium-table td:nth-child(7) {
    width: 90px;
}

.articulos-premium-table th:nth-child(8),
.articulos-premium-table td:nth-child(8) {
    width: 155px;
}

.articulos-premium-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-main-cell,
.article-ref-cell {
    min-width: 0;
    overflow: hidden;
}

.article-main-cell {
    display: block;
}

.article-main-cell strong,
.article-ref-cell strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-main-cell small {
    display: none;
}

.article-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
    overflow: visible;
}

.article-actions form {
    display: inline-flex;
    margin: 0;
}

.article-actions .btn,
.article-actions button.btn {
    min-height: 26px;
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 1;
    border-radius: 7px;
    white-space: nowrap;
}

.supplier-pill,
.location-pill,
.discount-pill {
    min-height: 21px;
    padding: 0 8px;
    font-size: 11px;
}

/* ============================================================
   V2.00 - PRESUPUESTOS: TABLA SIN SCROLL HORIZONTAL
   Ajuste exclusivo del listado operativo de presupuestos.
   ============================================================ */
.budget-table-wrap {
    overflow-x: hidden !important;
}

.budget-erp-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.budget-erp-table thead th,
.budget-erp-table tbody td {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.budget-erp-table thead th:nth-child(1),
.budget-erp-table tbody td:nth-child(1) {
    width: 9% !important;
}

.budget-erp-table thead th:nth-child(2),
.budget-erp-table tbody td:nth-child(2) {
    width: 25% !important;
}

.budget-erp-table thead th:nth-child(3),
.budget-erp-table tbody td:nth-child(3) {
    width: 10% !important;
}

.budget-erp-table thead th:nth-child(4),
.budget-erp-table tbody td:nth-child(4) {
    width: 8% !important;
}

.budget-erp-table thead th:nth-child(5),
.budget-erp-table tbody td:nth-child(5) {
    width: 8% !important;
}

.budget-erp-table thead th:nth-child(6),
.budget-erp-table tbody td:nth-child(6) {
    width: 10% !important;
}

.budget-erp-table thead th:nth-child(7),
.budget-erp-table tbody td:nth-child(7) {
    width: 14% !important;
}

.budget-erp-table thead th:nth-child(8),
.budget-erp-table tbody td:nth-child(8) {
    width: 16% !important;
}

.budget-code strong {
    padding: 4px 7px !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.budget-client-cell strong,
.budget-client-cell span {
    max-width: 100% !important;
}

.budget-progress-cell {
    min-width: 0 !important;
    grid-template-columns: minmax(48px, 1fr) auto !important;
    gap: 6px !important;
}

.budget-progress-cell strong {
    min-width: 44px !important;
}

.budget-actions-cell {
    gap: 4px !important;
    justify-content: flex-start;
    overflow: hidden;
}

.budget-actions-cell .btn-small,
.budget-actions-cell .btn-inline {
    padding: 5px 6px !important;
    font-size: 10px !important;
}


/* ============================================================
   V2.01 - PRESUPUESTOS: ACCIONES VISIBLES SIN SCROLL HORIZONTAL
   Ajuste exclusivo del listado operativo de presupuestos.
   - Reduce la columna Nº presupuesto.
   - Da más ancho a Acciones.
   - Compacta botones para que se vean completos.
   ============================================================ */
.budget-table-wrap {
    overflow-x: hidden !important;
}

.budget-erp-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.budget-erp-table thead th,
.budget-erp-table tbody td {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.budget-erp-table thead th:nth-child(1),
.budget-erp-table tbody td:nth-child(1) {
    width: 7% !important;
}

.budget-erp-table thead th:nth-child(2),
.budget-erp-table tbody td:nth-child(2) {
    width: 24% !important;
}

.budget-erp-table thead th:nth-child(3),
.budget-erp-table tbody td:nth-child(3) {
    width: 9% !important;
}

.budget-erp-table thead th:nth-child(4),
.budget-erp-table tbody td:nth-child(4) {
    width: 8% !important;
}

.budget-erp-table thead th:nth-child(5),
.budget-erp-table tbody td:nth-child(5) {
    width: 8% !important;
}

.budget-erp-table thead th:nth-child(6),
.budget-erp-table tbody td:nth-child(6) {
    width: 9% !important;
}

.budget-erp-table thead th:nth-child(7),
.budget-erp-table tbody td:nth-child(7) {
    width: 12% !important;
}

.budget-erp-table thead th:nth-child(8),
.budget-erp-table tbody td:nth-child(8) {
    width: 23% !important;
}

.budget-code strong {
    padding: 3px 6px !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.budget-progress-cell {
    min-width: 0 !important;
    grid-template-columns: minmax(44px, 1fr) auto !important;
    gap: 5px !important;
}

.budget-progress-cell strong {
    min-width: 42px !important;
    font-size: 10px !important;
}

.budget-actions-cell {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.budget-actions-cell form {
    margin: 0 !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
}

.budget-actions-cell .btn-small,
.budget-actions-cell .btn-inline {
    min-height: 24px !important;
    height: 24px !important;
    padding: 4px 6px !important;
    border-radius: 7px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
}

/* ============================================================
   V2.02 - CONTRATOS: ACCIONES VISIBLES SIN SCROLL HORIZONTAL
   Ajuste exclusivo de la tabla Cartera de Contratos.
   - Mantiene la tabla dentro del ancho disponible.
   - Da ancho suficiente a la columna Acciones.
   - Compacta botones para que se vean completos.
   ============================================================ */
.table-wrapper:has(.contracts-table.compact-table) {
    overflow-x: hidden !important;
}

.contracts-table.compact-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.contracts-table.compact-table thead th,
.contracts-table.compact-table tbody td {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.contracts-table.compact-table thead th:nth-child(1),
.contracts-table.compact-table tbody td:nth-child(1) {
    width: 17% !important;
}

.contracts-table.compact-table thead th:nth-child(2),
.contracts-table.compact-table tbody td:nth-child(2) {
    width: 8% !important;
}

.contracts-table.compact-table thead th:nth-child(3),
.contracts-table.compact-table tbody td:nth-child(3) {
    width: 8% !important;
}

.contracts-table.compact-table thead th:nth-child(4),
.contracts-table.compact-table tbody td:nth-child(4) {
    width: 7% !important;
}

.contracts-table.compact-table thead th:nth-child(5),
.contracts-table.compact-table tbody td:nth-child(5) {
    width: 5% !important;
}

.contracts-table.compact-table thead th:nth-child(6),
.contracts-table.compact-table tbody td:nth-child(6) {
    width: 4% !important;
}

.contracts-table.compact-table thead th:nth-child(7),
.contracts-table.compact-table tbody td:nth-child(7) {
    width: 7% !important;
}

.contracts-table.compact-table thead th:nth-child(8),
.contracts-table.compact-table tbody td:nth-child(8) {
    width: 8% !important;
}

.contracts-table.compact-table thead th:nth-child(9),
.contracts-table.compact-table tbody td:nth-child(9) {
    width: 12% !important;
}

.contracts-table.compact-table thead th:nth-child(10),
.contracts-table.compact-table tbody td:nth-child(10) {
    width: 4% !important;
}

.contracts-table.compact-table thead th:nth-child(11),
.contracts-table.compact-table tbody td:nth-child(11) {
    width: 6% !important;
}

.contracts-table.compact-table thead th:nth-child(12),
.contracts-table.compact-table tbody td:nth-child(12) {
    width: 14% !important;
}

.contracts-table.compact-table td.nowrap,
.contracts-table.compact-table .nowrap {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.contracts-table.compact-table .actions-compact {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.contracts-table.compact-table .actions-compact form {
    margin: 0 !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
}

.contracts-table.compact-table .actions-compact .action-btn {
    min-height: 24px !important;
    height: 24px !important;
    padding: 4px 6px !important;
    border-radius: 7px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    flex: 0 0 auto !important;
}



/* v2.17 - Ajustes visuales generales y Control de Horas */
body, input, select, textarea, button {
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
    letter-spacing: -0.01em;
}

.horas-resumen-dia {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 12px;
    margin: 14px 0 18px;
}

.horas-resumen-dia div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
}

.horas-resumen-dia span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.horas-resumen-dia strong {
    color: #0f172a;
    font-size: 20px;
}

.horas-filtros-dia {
    margin-top: 12px;
    margin-bottom: 0;
}

.horas-dia-table th:nth-child(2),
.horas-dia-table td:nth-child(2) {
    min-width: 280px;
}

.empleados-horas-table {
    table-layout: fixed;
    min-width: 1180px;
}

.empleados-horas-table .col-nombre,
.empleados-horas-table th:nth-child(1) {
    width: 45%;
}

.empleados-horas-table .col-movil,
.empleados-horas-table th:nth-child(2) {
    width: 18%;
}

.empleados-horas-table .col-delegacion,
.empleados-horas-table th:nth-child(3) {
    width: 12%;
}

.empleados-horas-table .col-jornada,
.empleados-horas-table th:nth-child(4) {
    width: 10%;
}

.empleados-horas-table .col-acciones,
.empleados-horas-table th:nth-child(5) {
    width: 15%;
    min-width: 170px;
}

.empleados-horas-table td {
    vertical-align: middle;
}

.empleados-horas-table input,
.empleados-horas-table select {
    width: 100%;
}

.empleados-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    min-width: 170px;
    white-space: nowrap;
}

.empleados-actions form {
    margin: 0;
}

.empleados-actions .btn {
    min-width: 78px;
}

.badge-dark {
    background: #111827;
    color: #ffffff;
}

.badge-warning {
    background: #fff7ed;
    color: #c2410c;
}

@media (max-width: 1200px) {
    .horas-resumen-dia {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

/* v2.18 - Reestructuración visual Control de Horas sin cambios de lógica */
.control-hours-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.control-hours-kpi-stack {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.control-hours-kpi-stack .articulos-kpi-card {
    margin-bottom: 0;
    padding: 6px 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-hours-kpi-stack .articulo-kpi-item {
    min-height: 54px;
    padding: 8px 12px;
    gap: 11px;
}
.control-hours-kpi-stack .articulo-kpi-item:nth-child(3n) { border-right: 0; }
.control-hours-kpi-stack .articulo-kpi-item:nth-child(-n+3) { border-bottom: 1px solid #e5eaf1; }

.control-hours-kpi-stack .kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 15px;
}
.control-hours-kpi-stack .articulo-kpi-item span { font-size: 10px; }
.control-hours-kpi-stack .articulo-kpi-item strong { font-size: 17px; margin-top: 2px; }
.control-hours-kpi-stack .articulo-kpi-item small { font-size: 10px; margin-top: 2px; }

.control-import-card {
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px 16px !important;
}

.control-import-card .articulos-table-header {
    margin-bottom: 8px;
}
.control-import-card .articulos-table-header h3 { font-size: 14px; }
.control-import-card .articulos-table-header p { font-size: 11px; margin-top: 3px; line-height: 1.35; }

.control-import-card .form-grid,
.control-import-card .form-grid-4 {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 8px;
}

.control-import-card input[type="file"] {
    min-height: 38px !important;
    padding: 8px 12px;
}

.control-excel-config-card {
    margin-bottom: 18px;
}

.control-excel-config-card .form-grid-4 {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 12px;
}

.horas-panel-dia {
    margin-bottom: 18px;
}

.horas-panel-dia .articulos-search-row {
    grid-template-columns: 160px minmax(180px, 1fr) 180px 170px auto;
    gap: 10px;
}

.horas-resumen-dia {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 14px;
}

.horas-resumen-dia div {
    padding: 10px 12px;
}

.horas-resumen-dia strong {
    font-size: 18px;
}

.control-hours-employee-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.control-add-employee-card,
.control-employee-search-card {
    margin: 0 !important;
    height: 100%;
}

.control-add-employee-card .form-grid-4 {
    grid-template-columns: minmax(220px, 1.6fr) minmax(130px, .8fr) minmax(130px, .7fr) minmax(105px, .5fr);
    gap: 12px;
}

.control-employee-search-card {
    padding: 18px;
}

.control-employee-search-card .articulos-search-row {
    grid-template-columns: 1fr;
    gap: 10px;
}

.control-employee-search-card .filter-actions {
    justify-content: flex-start;
}

.control-employees-list-card {
    margin-top: 0;
}

/* Evitar scroll horizontal en Control de Horas: tablas compactas y ancho real 100% */
.control-employees-list-card .articulos-table-wrap,
.horas-panel-dia .articulos-table-wrap,
.control-hours-employee-grid + .control-employees-list-card .articulos-table-wrap {
    overflow-x: hidden;
}

.horas-panel-dia .articulos-premium-table,
.control-employees-list-card .articulos-premium-table,
.empleados-horas-table {
    width: 100% !important;
    min-width: 0 !important;
    display: table !important;
    table-layout: fixed;
}

.horas-dia-table th,
.horas-dia-table td,
.empleados-horas-table th,
.empleados-horas-table td,
.articulos-premium-table th,
.articulos-premium-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.horas-dia-table th:nth-child(1),
.horas-dia-table td:nth-child(1) { width: 105px; }
.horas-dia-table th:nth-child(2),
.horas-dia-table td:nth-child(2) { width: auto; min-width: 0; }
.horas-dia-table th:nth-child(3),
.horas-dia-table td:nth-child(3) { width: 100px; }
.horas-dia-table th:nth-child(4),
.horas-dia-table td:nth-child(4),
.horas-dia-table th:nth-child(5),
.horas-dia-table td:nth-child(5),
.horas-dia-table th:nth-child(6),
.horas-dia-table td:nth-child(6) { width: 92px; }
.horas-dia-table th:nth-child(7),
.horas-dia-table td:nth-child(7) { width: 120px; }

.empleados-horas-table .col-nombre,
.empleados-horas-table th:nth-child(1) { width: 43%; }
.empleados-horas-table .col-movil,
.empleados-horas-table th:nth-child(2) { width: 16%; }
.empleados-horas-table .col-delegacion,
.empleados-horas-table th:nth-child(3) { width: 13%; }
.empleados-horas-table .col-jornada,
.empleados-horas-table th:nth-child(4) { width: 11%; }
.empleados-horas-table .col-acciones,
.empleados-horas-table th:nth-child(5) { width: 17%; min-width: 0; }

.empleados-actions {
    min-width: 0 !important;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.empleados-actions .btn {
    min-width: 68px;
    padding-left: 8px;
    padding-right: 8px;
}

@media (max-width: 1400px) {
    .control-hours-top-grid {
        grid-template-columns: minmax(0, 1fr) 330px;
    }
    .control-excel-config-card .form-grid-4 {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 1180px) {
    .control-hours-top-grid,
    .control-hours-employee-grid {
        grid-template-columns: 1fr;
    }
    .horas-panel-dia .articulos-search-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .horas-resumen-dia {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .control-hours-kpi-stack .articulos-kpi-card,
    .control-excel-config-card .form-grid-4,
    .control-add-employee-card .form-grid-4,
    .horas-panel-dia .articulos-search-row,
    .horas-resumen-dia {
        grid-template-columns: 1fr;
    }
}

/* v2.19 - Control de horas: baja laboral y agrupación visual */
.badge-purple {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}
.empleados-horas-table .col-baja,
.empleados-horas-table .col-motivo-baja {
    white-space: nowrap;
}
.empleados-horas-table td:nth-child(5) select {
    min-width: 100px;
}
.empleados-horas-table td:nth-child(6) input {
    min-width: 160px;
}
.horas-dia-table tbody tr:has(.badge-purple) {
    background: rgba(237, 233, 254, 0.35);
}
@media (max-width: 1200px) {
    .empleados-horas-table td:nth-child(6) input {
        min-width: 120px;
    }
}

/* v2.20 - Configuración WhatsApp Control de Horas */
.control-whatsapp-config-card textarea {
    width: 100%;
    resize: vertical;
    min-height: 74px;
}
.control-whatsapp-config-card .span-2 { grid-column: span 2; }
.control-whatsapp-config-card .span-4 { grid-column: 1 / -1; }
@media (max-width: 900px) {
    .control-whatsapp-config-card .span-2,
    .control-whatsapp-config-card .span-4 { grid-column: 1 / -1; }
}

/* v2.22 - Cola de revisión WhatsApp */
.whatsapp-review-summary {
    margin: 14px 0 16px;
}
.whatsapp-review-table th:nth-child(7),
.whatsapp-review-table td:nth-child(7) {
    min-width: 320px;
}
.whatsapp-message-preview {
    display: block;
    line-height: 1.35;
    white-space: normal;
    max-width: 520px;
}
.control-whatsapp-history-card .header-actions {
    gap: 8px;
    flex-wrap: wrap;
}
@media (max-width: 1100px) {
    .whatsapp-review-table th:nth-child(7),
    .whatsapp-review-table td:nth-child(7) {
        min-width: 240px;
    }
}

/* v2.23 - Centro de envíos WhatsApp */
.control-whatsapp-center-card {
    border-left: 4px solid var(--primary, #2563eb);
}
.whatsapp-center-summary div {
    min-width: 120px;
}
.empleados-horas-table .col-whatsapp {
    width: 110px;
}
.empleados-horas-table .col-motivo-baja {
    min-width: 180px;
}

/* v2.26 - Diagnóstico Meta WhatsApp */
.whatsapp-meta-cell {
    max-width: 280px;
    white-space: normal;
    font-size: 0.78rem;
}
.whatsapp-meta-cell details {
    margin-top: 4px;
}
.whatsapp-meta-cell summary {
    cursor: pointer;
    font-weight: 800;
    color: #1f6feb;
}
.whatsapp-meta-cell pre {
    margin: 6px 0 0;
    padding: 8px;
    border-radius: 8px;
    background: #0f172a;
    color: #e5e7eb;
    max-width: 520px;
    max-height: 180px;
    overflow: auto;
    font-size: 0.72rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}
.badge-success {
    background: #dcfce7;
    color: #166534;
}

/* =========================================================
   CONTROL DE HORAS v2.32 - ESPACIO DE TRABAJO ORGANIZADO
   Solo presentación: pestañas, jerarquía y distribución.
   ========================================================= */
.control-workspace-nav {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 10px;
    border: 1px solid var(--border-color, #dfe5ec);
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 10px 30px rgba(23,38,61,.08);
    backdrop-filter: blur(12px);
}
.control-tab {
    min-width: 0;
    min-height: 66px;
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: #526173;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}
.control-tab:hover { background: #f5f8fb; color: #17263a; }
.control-tab.is-active {
    border-color: #d6e3f2;
    background: linear-gradient(135deg,#edf5ff,#f8fbff);
    color: #0f3b68;
    box-shadow: inset 0 0 0 1px rgba(39,105,169,.04);
}
.control-tab-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #edf1f5;
    font-size: 17px;
}
.control-tab.is-active .control-tab-icon { background: #dcecff; }
.control-tab strong, .control-tab small { display: block; }
.control-tab strong { font-size: 13px; line-height: 1.2; }
.control-tab small { margin-top: 3px; font-size: 10px; color: #8390a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.control-tab em {
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #e8edf3;
    color: #415164;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}
.control-panel { animation: controlPanelIn .18s ease; }
.control-panel[hidden] { display: none !important; }
@keyframes controlPanelIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }
.control-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2px 0 10px;
    padding: 0 3px;
}
.control-section-heading > div {
    display: grid;
    grid-template-columns: 30px minmax(0,1fr);
    column-gap: 10px;
    align-items: center;
}
.control-section-heading span {
    grid-row: 1 / span 2;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #172a41;
    color: white;
    font-size: 10px;
    font-weight: 800;
}
.control-section-heading h3 { margin:0; font-size:16px; color:#17263a; }
.control-section-heading p { margin:2px 0 0; color:#718093; font-size:11px; }

.control-panel .table-card,
.control-panel .form-card,
.control-panel .filters-card,
.control-panel .articulos-kpi-card {
    margin-bottom: 14px;
}
.control-hours-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
    gap: 12px;
    align-items: stretch;
    margin-bottom: 4px;
}
.control-hours-kpi-stack { display:grid; gap:12px; }
.control-hours-top-grid .articulos-kpi-card { margin:0; }
.control-import-card { margin:0 !important; height:100%; }
.control-import-card form { display:flex; flex-direction:column; height:calc(100% - 55px); }
.control-import-card .premium-form-actions { margin-top:auto; }

.control-whatsapp-layout { display:grid; grid-template-columns:minmax(0, .72fr) minmax(0, 1.55fr); gap:14px; align-items:start; }
.control-whatsapp-layout .control-whatsapp-center-card { position:sticky; top:100px; }
.control-whatsapp-layout .control-whatsapp-history-card { min-width:0; }
.control-whatsapp-layout .whatsapp-center-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }

.control-collapse {
    display:block;
    margin: 14px 0;
    border:1px solid #dde4ec;
    border-radius:16px;
    background:#fff;
    overflow:hidden;
    box-shadow:0 8px 24px rgba(29,43,64,.05);
}
.control-collapse > summary {
    list-style:none;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
    padding:15px 18px;
    background:#f7f9fc;
    cursor:pointer;
}
.control-collapse > summary::-webkit-details-marker { display:none; }
.control-collapse > summary strong, .control-collapse > summary small { display:block; }
.control-collapse > summary strong { color:#1b2a3d; font-size:14px; }
.control-collapse > summary small { margin-top:3px; color:#7d8999; font-size:11px; }
.control-collapse .collapse-chevron { font-size:20px; transition:transform .18s ease; }
.control-collapse[open] .collapse-chevron { transform:rotate(180deg); }
.control-collapse > .form-card { margin:0 !important; border:0; border-radius:0; box-shadow:none; }

.control-history-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; align-items:start; }
.control-history-grid > .table-card { min-width:0; }
.control-hours-employee-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr); gap:14px; align-items:start; }
.control-employee-search-card { margin:0 !important; }
.control-add-employee-card { margin:0 !important; }

/* Tablas sin desbordamiento horizontal: contenido flexible y acciones apiladas */
.control-panel .table-responsive { overflow-x:visible; }
.control-panel .erp-table { width:100%; table-layout:fixed; }
.control-panel .erp-table th,
.control-panel .erp-table td { white-space:normal; overflow-wrap:anywhere; word-break:normal; vertical-align:middle; }
.control-panel .erp-table input,
.control-panel .erp-table select { min-width:0; width:100%; }
.control-panel .compact-actions-cell { display:flex; flex-wrap:wrap; gap:5px; }
.control-panel .compact-actions-cell .btn { width:100%; justify-content:center; }
.whatsapp-review-table th:nth-child(1) { width:8%; }
.whatsapp-review-table th:nth-child(2) { width:13%; }
.whatsapp-review-table th:nth-child(3) { width:9%; }
.whatsapp-review-table th:nth-child(4) { width:8%; }
.whatsapp-review-table th:nth-child(5) { width:6%; }
.whatsapp-review-table th:nth-child(6) { width:9%; }
.whatsapp-review-table th:nth-child(7) { width:16%; }
.whatsapp-review-table th:nth-child(8) { width:23%; }
.whatsapp-review-table th:nth-child(9) { width:8%; }
.whatsapp-meta-cell pre, .whatsapp-diagnostic-raw { max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere; }
.empleados-horas-table .col-nombre { width:22%; }
.empleados-horas-table .col-movil { width:12%; }
.empleados-horas-table .col-delegacion { width:11%; }
.empleados-horas-table .col-jornada { width:9%; }
.empleados-horas-table .col-baja { width:9%; }
.empleados-horas-table .col-whatsapp { width:9%; }
.empleados-horas-table .col-motivo-baja { width:16%; }
.empleados-horas-table .col-acciones { width:12%; }

@media (max-width: 1100px) {
    .control-workspace-nav { grid-template-columns:repeat(3,minmax(0,1fr)); position:static; }
    .control-hours-top-grid,
    .control-whatsapp-layout,
    .control-history-grid,
    .control-hours-employee-grid { grid-template-columns:1fr; }
    .control-whatsapp-layout .control-whatsapp-center-card { position:static; }
}
@media (max-width: 760px) {
    .control-workspace-nav { grid-template-columns:1fr 1fr; }
    .control-tab { min-height:58px; padding:8px; grid-template-columns:30px minmax(0,1fr) auto; }
    .control-tab-icon { width:30px; height:30px; }
    .control-section-heading p { display:none; }
    .control-panel .erp-table,
    .control-panel .erp-table thead,
    .control-panel .erp-table tbody,
    .control-panel .erp-table tr,
    .control-panel .erp-table th,
    .control-panel .erp-table td { display:block; width:100% !important; }
    .control-panel .erp-table thead { display:none; }
    .control-panel .erp-table tr { margin:0 0 10px; padding:10px; border:1px solid #e1e7ee; border-radius:12px; background:#fff; }
    .control-panel .erp-table td { border:0; padding:5px 0; }
    .control-panel .compact-actions-cell { display:grid; grid-template-columns:1fr 1fr; }
}

/* v2.33 · Organigrama operativo */
.org-page { display: grid; gap: 20px; }
.org-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:26px 28px; background:linear-gradient(135deg,#0e2d4d 0%,#174c76 100%); border-radius:20px; color:#fff; box-shadow:0 14px 34px rgba(10,37,64,.18); }
.org-header h2 { margin:5px 0 8px; font-size:clamp(1.7rem,3vw,2.45rem); letter-spacing:-.035em; }
.org-header p { margin:0; max-width:790px; color:rgba(255,255,255,.82); line-height:1.65; }
.org-header .portal-eyebrow { color:#8fd7ff; }
.org-new-btn { white-space:nowrap; align-self:center; }
.org-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.org-kpis article { background:#fff; border:1px solid #dbe5ee; border-radius:16px; padding:18px 20px; box-shadow:0 7px 20px rgba(27,55,82,.07); }
.org-kpis strong { display:block; font-size:1.85rem; color:#143d61; line-height:1; margin-bottom:8px; }
.org-kpis span { color:#617386; font-size:.9rem; }
.org-kpis .org-kpi-alert { border-color:#f4c7c7; background:#fff8f8; }
.org-kpis .org-kpi-alert strong { color:#bb3535; }
.org-toolbar { display:grid; grid-template-columns:minmax(260px,1fr) 220px 200px; gap:12px; padding:14px; border:1px solid #dce6ee; border-radius:16px; background:#fff; }
.org-toolbar input,.org-toolbar select { width:100%; min-height:44px; border:1px solid #cbd8e3; border-radius:11px; background:#f9fbfc; padding:0 13px; color:#23384a; }
.org-search { position:relative; display:flex; align-items:center; }
.org-search span { position:absolute; left:14px; font-size:1.25rem; color:#6f8497; }
.org-search input { padding-left:42px; }
.org-board { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; align-items:stretch; }
.org-task-card { position:relative; display:flex; flex-direction:column; min-width:0; min-height:245px; padding:19px; background:#fff; border:1px solid #d9e4ec; border-radius:18px; box-shadow:0 8px 24px rgba(28,59,87,.08); cursor:pointer; transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; overflow:hidden; }
.org-task-card:before { content:""; position:absolute; inset:0 auto 0 0; width:5px; background:#2c80b9; }
.org-task-card:hover { transform:translateY(-3px); border-color:#a9c9df; box-shadow:0 15px 32px rgba(22,61,91,.14); }
.org-task-card.is-unassigned:before { background:#dc5a5a; }
.org-task-card.is-inactive { opacity:.68; filter:saturate(.65); }
.org-task-card[hidden] { display:none; }
.org-card-top { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.org-area { max-width:70%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#316a91; font-weight:700; font-size:.78rem; text-transform:uppercase; letter-spacing:.055em; }
.org-status { padding:5px 9px; border-radius:999px; font-size:.73rem; font-weight:700; }
.org-status.active { color:#166d45; background:#e5f7ef; }
.org-status.inactive { color:#6c7580; background:#edf0f2; }
.org-task-card h3 { margin:17px 0 7px; color:#163a59; font-size:1.2rem; line-height:1.25; }
.org-card-description { margin:0 0 16px; color:#687a8b; font-size:.9rem; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.org-people-block { margin-top:auto; padding-top:14px; border-top:1px solid #e7edf2; }
.org-people-label { display:block; margin-bottom:8px; color:#7b8b98; font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.org-avatars { display:flex; flex-wrap:wrap; gap:7px; }
.org-person-chip { display:inline-flex; align-items:center; max-width:100%; gap:6px; padding:5px 9px 5px 5px; border-radius:999px; background:#edf6fc; color:#234c69; font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.org-person-chip b { display:grid; place-items:center; flex:0 0 24px; height:24px; border-radius:50%; background:#2779ae; color:#fff; }
.org-person-chip.is-away { background:#fff0f0; color:#9f3838; }
.org-person-chip.is-away b { background:#c74b4b; }
.org-empty-person { color:#bb3f3f; font-size:.86rem; font-weight:700; }
.org-card-footer { display:flex; justify-content:space-between; gap:10px; margin-top:15px; color:#788a99; font-size:.78rem; }
.org-card-footer span:last-child { color:#2676aa; font-weight:700; }
.org-empty-state,.org-no-results { padding:48px 24px; text-align:center; border:1px dashed #bfd0dc; border-radius:18px; background:#f9fbfc; color:#667b8d; }
.org-empty-state div { font-size:3rem; }
.org-empty-state h3 { color:#193d5c; margin:10px 0 7px; }
.org-modal { position:fixed; inset:0; z-index:3000; display:none; align-items:center; justify-content:center; padding:22px; }
.org-modal.is-open { display:flex; }
.org-modal-backdrop { position:absolute; inset:0; background:rgba(8,25,40,.63); backdrop-filter:blur(3px); }
.org-modal-panel { position:relative; z-index:1; width:min(800px,96vw); max-height:90vh; overflow:auto; background:#fff; border-radius:20px; padding:28px; box-shadow:0 28px 80px rgba(0,0,0,.32); }
.org-form-panel { width:min(940px,96vw); }
.org-modal-close { position:absolute; top:14px; right:16px; width:36px; height:36px; border:0; border-radius:50%; background:#eef3f6; color:#40566a; font-size:1.6rem; cursor:pointer; }
.org-modal-area { display:inline-block; margin-bottom:8px; color:#2a78a9; font-size:.8rem; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.org-modal-panel h2 { margin:0 42px 8px 0; color:#153a59; font-size:1.65rem; }
.org-detail-description { color:#65788a; line-height:1.58; }
.org-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:24px; }
.org-detail-grid section { padding:17px; border:1px solid #dce6ee; border-radius:15px; background:#fbfcfd; }
.org-detail-grid h4 { margin:0 0 12px; color:#234b69; }
.org-detail-person { display:flex; gap:11px; align-items:center; padding:10px 0; border-bottom:1px solid #e8eef2; }
.org-detail-person:last-child { border-bottom:0; }
.org-detail-avatar { display:grid; place-items:center; flex:0 0 38px; height:38px; border-radius:50%; background:#267aae; color:#fff; font-weight:800; }
.org-detail-person div { min-width:0; }
.org-detail-person strong,.org-detail-person small,.org-detail-person em { display:block; }
.org-detail-person strong { color:#203c53; }
.org-detail-person small { color:#768897; margin-top:2px; }
.org-detail-person em { color:#b84141; margin-top:3px; font-size:.78rem; font-style:normal; font-weight:700; }
.org-detail-person.is-away .org-detail-avatar { background:#c64d4d; }
.org-detail-empty { margin:0; color:#8796a3; font-style:italic; }
.org-modal-actions,.org-form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:24px; }
.org-modal-actions form { margin:0; }
.org-form-main { margin-top:18px; }
.org-active-field { align-self:start; }
.org-assignment-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:18px; }
.org-assignment-grid .field { padding:15px; border:1px solid #dce6ee; border-radius:14px; background:#f9fbfc; }
.org-assignment-grid small { display:block; min-height:34px; margin:4px 0 8px; color:#728597; line-height:1.35; }
.org-assignment-grid select[multiple] { min-height:210px; padding:7px; }
.org-assignment-grid select[multiple] option { padding:7px; border-radius:6px; }
body.modal-open { overflow:hidden; }

@media (max-width:1100px) {
  .org-board { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .org-toolbar { grid-template-columns:1fr 180px 180px; }
}
@media (max-width:760px) {
  .org-header { flex-direction:column; padding:22px; }
  .org-new-btn { align-self:stretch; }
  .org-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .org-toolbar,.org-board,.org-detail-grid,.org-assignment-grid { grid-template-columns:1fr; }
  .org-task-card { min-height:auto; }
  .org-modal { padding:10px; }
  .org-modal-panel { padding:22px 17px; max-height:94vh; }
}

/* v2.34 · Organigrama visual por áreas */
.org-v234 { gap:18px; }
.org-hero { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:24px; align-items:center; padding:30px; border-radius:22px; color:#fff; background:radial-gradient(circle at 85% 20%,rgba(89,193,255,.22),transparent 28%),linear-gradient(135deg,#102d49,#174f78 70%,#1d628e); box-shadow:0 18px 38px rgba(13,43,69,.2); }
.org-hero h2 { margin:6px 0 9px; font-size:clamp(1.85rem,3vw,2.65rem); letter-spacing:-.04em; }
.org-hero p { margin:0; max-width:780px; color:rgba(255,255,255,.82); line-height:1.65; }
.org-hero-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; }
.org-view-btn { border:1px solid rgba(255,255,255,.25); background:rgba(255,255,255,.08); color:#eaf6fd; }
.org-view-btn:hover,.org-view-btn.is-active { background:#fff; color:#174c73; }
.org-overview { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; }
.org-overview-card { display:flex; align-items:center; gap:13px; padding:16px 18px; border:1px solid #dce6ee; border-radius:16px; background:#fff; box-shadow:0 7px 18px rgba(24,54,80,.06); }
.org-overview-icon { display:grid; place-items:center; flex:0 0 42px; height:42px; border-radius:13px; background:#e9f4fb; color:#2777aa; font-weight:900; font-size:1.15rem; }
.org-overview-card strong,.org-overview-card small { display:block; }
.org-overview-card strong { color:#173e5f; font-size:1.6rem; line-height:1; }
.org-overview-card small { margin-top:5px; color:#6d7f8e; }
.org-overview-card.is-alert { border-color:#efc0c0; background:#fff8f8; }
.org-overview-card.is-alert .org-overview-icon { background:#ffe8e8; color:#b63838; }
.org-controlbar { display:grid; grid-template-columns:minmax(280px,1fr) 210px 190px; gap:11px; padding:13px; border:1px solid #dce6ee; border-radius:16px; background:#fff; }
.org-controlbar input,.org-controlbar select { width:100%; min-height:44px; padding:0 13px; border:1px solid #cbd8e3; border-radius:11px; background:#f9fbfc; color:#23384a; }
.org-area-nav { display:flex; gap:8px; overflow-x:auto; padding:2px 0 5px; scrollbar-width:thin; }
.org-area-nav button { flex:0 0 auto; min-height:38px; padding:0 15px; border:1px solid #d5e1ea; border-radius:999px; background:#fff; color:#486275; font-weight:700; cursor:pointer; }
.org-area-nav button:hover,.org-area-nav button.is-active { border-color:#2679ad; background:#2679ad; color:#fff; }
.org-visual-map { display:grid; gap:18px; }
.org-area-section { padding:18px; border:1px solid #dce6ee; border-radius:20px; background:linear-gradient(180deg,#fbfdfe,#f6f9fb); }
.org-area-heading { display:flex; justify-content:space-between; gap:14px; align-items:center; margin-bottom:14px; }
.org-area-heading>div { display:flex; align-items:center; gap:10px; }
.org-area-heading h3 { margin:0; color:#183f60; font-size:1.18rem; }
.org-area-heading>span { color:#768897; font-size:.82rem; }
.org-area-dot { width:12px; height:12px; border-radius:50%; box-shadow:0 0 0 5px rgba(49,128,180,.1); }
.org-color-0{background:#267bb0}.org-color-1{background:#3a9d72}.org-color-2{background:#d98731}.org-color-3{background:#7d67b5}.org-color-4{background:#c95656}.org-color-5{background:#b59b2f}.org-color-6{background:#2d9698}.org-color-7{background:#6d7c88}
.org-area-flow,.org-flat-board { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.org-task-card { min-height:270px; padding:18px; border-radius:17px; }
.org-task-card .org-card-ribbon { position:absolute; inset:0 auto 0 0; width:5px; background:#2e80b5; }
.org-task-card.is-favorite { border-color:#e6c869; box-shadow:0 9px 25px rgba(163,128,28,.12); }
.org-task-card.is-favorite .org-card-ribbon { background:#d5a82b; }
.org-card-badges { display:flex; align-items:center; gap:6px; }
.org-favorite { color:#d19f13; font-size:1rem; }
.org-primary-person { margin-top:auto; padding-top:14px; border-top:1px solid #e7edf2; }
.org-primary-label { display:block; margin-bottom:9px; color:#7a8b99; font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.055em; }
.org-primary-row { display:flex; gap:10px; align-items:center; }
.org-primary-avatar { display:grid; place-items:center; flex:0 0 38px; height:38px; border-radius:13px; background:#267caf; color:#fff; font-weight:800; }
.org-primary-row strong,.org-primary-row small { display:block; }
.org-primary-row strong { color:#1b405e; font-size:.91rem; }
.org-primary-row small { margin-top:2px; color:#798a98; font-size:.77rem; }
.org-primary-row.is-away .org-primary-avatar { background:#c34e4e; }
.org-primary-row.is-away strong { color:#a43d3d; }
.org-more-people { display:inline-block; margin:8px 0 0 48px; color:#347aa8; font-size:.75rem; font-weight:700; }
.org-substitute-row { display:flex; align-items:center; gap:6px; margin-top:12px; padding:8px 10px; border-radius:10px; background:#f1f6f9; color:#587083; font-size:.76rem; }
.org-substitute-row em { margin-left:auto; color:#2b7d58; font-style:normal; font-weight:700; }
.org-card-footer { padding-top:12px; border-top:1px solid #edf1f4; font-weight:700; }
.org-modal-heading { display:flex; align-items:center; gap:9px; margin-bottom:8px; }
.org-modal-state { padding:4px 8px; border-radius:999px; font-size:.72rem; font-weight:800; }
.org-modal-state.is-active { background:#e4f5ed; color:#167049; }
.org-modal-state.is-inactive { background:#edf0f2; color:#6c7580; }
.org-procedure-panel { margin-top:18px; padding:18px; border:1px solid #d6e3ec; border-radius:16px; background:#f7fafc; }
.org-procedure-panel h4 { margin:0 0 12px; color:#204967; }
.org-procedure-step { display:grid; grid-template-columns:30px minmax(0,1fr); gap:10px; align-items:start; padding:8px 0; border-bottom:1px solid #e1e9ef; }
.org-procedure-step:last-child { border-bottom:0; }
.org-procedure-step b { display:grid; place-items:center; width:27px; height:27px; border-radius:50%; background:#2679ad; color:#fff; font-size:.78rem; }
.org-procedure-step span { color:#526b7e; line-height:1.48; }
@media(max-width:1100px){.org-hero{grid-template-columns:1fr}.org-hero-actions{justify-content:flex-start}.org-area-flow,.org-flat-board{grid-template-columns:repeat(2,minmax(0,1fr))}.org-controlbar{grid-template-columns:1fr 180px 180px}}
@media(max-width:760px){.org-overview{grid-template-columns:repeat(2,minmax(0,1fr))}.org-controlbar,.org-area-flow,.org-flat-board{grid-template-columns:1fr}.org-hero{padding:22px}.org-hero-actions{display:grid;grid-template-columns:1fr}.org-area-heading{align-items:flex-start}.org-substitute-row{flex-wrap:wrap}.org-substitute-row em{width:100%;margin-left:22px}}

/* V2.35 - Organigrama compacto y escalable */
.org-v234 .org-visual-map,.org-v234 .org-flat-board{display:block}
.org-compact-map{display:grid;gap:12px}
.org-area-accordion{border:1px solid #d9e5ed;border-radius:16px;background:#fff;box-shadow:0 5px 18px rgba(28,59,87,.06);overflow:hidden}
.org-area-accordion[hidden]{display:none}
.org-area-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;cursor:pointer;list-style:none;background:linear-gradient(180deg,#fff,#f8fbfd)}
.org-area-summary::-webkit-details-marker{display:none}
.org-area-summary:hover{background:#f3f8fb}
.org-area-summary-main,.org-area-summary-meta{display:flex;align-items:center;gap:12px;min-width:0}
.org-area-summary-main h3{margin:0;color:#173d5b;font-size:1.05rem}
.org-area-summary-main small{display:block;margin-top:2px;color:#728493}
.org-area-alert{padding:5px 9px;border-radius:999px;background:#fff0f0;color:#b44242;font-size:.76rem;font-weight:700}
.org-chevron{font-size:1.25rem;color:#5c7487;transition:transform .2s ease}
.org-area-accordion[open] .org-chevron{transform:rotate(180deg)}
.org-task-list{border-top:1px solid #e5edf2}
.org-task-list-head,.org-management-head{display:grid;grid-template-columns:minmax(230px,2.1fr) minmax(190px,1.45fr) 115px 90px 38px;gap:12px;padding:9px 16px;background:#f4f7f9;color:#6e8190;font-size:.71rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.org-task-row{display:grid;grid-template-columns:minmax(230px,2.1fr) minmax(190px,1.45fr) 115px 90px 38px;gap:12px;align-items:center;min-height:58px;padding:8px 16px;border-bottom:1px solid #edf2f5;background:#fff;cursor:pointer;transition:background .15s ease}
.org-task-row:last-child{border-bottom:0}
.org-task-row:hover{background:#f4f9fc}
.org-task-row[hidden]{display:none}
.org-task-row.is-inactive{opacity:.62}
.org-task-row.is-unassigned{background:#fffafa}
.org-task-row.is-favorite{background:#fffdf5}
.org-row-task{display:flex;align-items:center;gap:10px;min-width:0}
.org-row-indicator{width:4px;height:34px;border-radius:4px;background:#2f82b8;flex:none}
.org-task-row.is-unassigned .org-row-indicator{background:#dc5a5a}
.org-task-row.is-inactive .org-row-indicator{background:#99a8b2}
.org-task-row.is-favorite .org-row-indicator{background:#d5a82b}
.org-row-task>div,.org-row-owner>div{min-width:0}
.org-row-task strong,.org-row-owner strong{display:block;color:#183d5b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.org-row-task small,.org-row-owner small{display:block;color:#7a8c99;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.77rem}
.org-row-star{margin-right:5px;color:#d5a82b}
.org-row-area{display:none;color:#4f6678;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.org-row-owner{display:flex;align-items:center;gap:8px;min-width:0}
.org-row-avatar{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#e4f1f8;color:#21668f;font-weight:800;flex:none}
.org-row-owner em{margin-left:auto;padding:2px 6px;border-radius:999px;background:#edf4f8;color:#527083;font-style:normal;font-size:.72rem}
.org-row-empty{color:#c24747;font-weight:750}
.org-row-cover{display:flex;align-items:center;gap:4px;color:#496276}
.org-row-cover strong{font-size:1rem;color:#183d5b}
.org-row-cover small{font-size:.75rem}
.org-row-cover span{margin-left:4px}
.org-row-state{text-align:left}
.org-row-open{border:0;background:transparent;color:#47738f;font-size:1.55rem;cursor:pointer}
.org-management-list{border:1px solid #d9e5ed;border-radius:16px;background:#fff;overflow:hidden}
.org-management-list .org-management-head,.org-management-list .org-task-row{grid-template-columns:minmax(250px,2fr) minmax(130px,1fr) minmax(180px,1.4fr) 100px 90px}
.org-management-list .org-row-area{display:block}
.org-management-list .org-row-open{display:none}
@media(max-width:900px){.org-task-list-head,.org-management-head{display:none}.org-task-row,.org-management-list .org-task-row{grid-template-columns:minmax(0,1fr) auto auto;padding:10px 12px}.org-row-area,.org-row-state{display:none!important}.org-row-cover small{display:none}.org-row-open{display:block!important}.org-management-list{border:0;background:transparent}.org-management-list .org-task-row{margin-bottom:8px;border:1px solid #e1e9ef;border-radius:12px}.org-area-summary{padding:13px 14px}}
@media(max-width:600px){.org-task-row,.org-management-list .org-task-row{grid-template-columns:minmax(0,1fr) auto}.org-row-cover{display:none}.org-row-owner{justify-self:end;max-width:150px}.org-row-owner small,.org-row-owner em{display:none}.org-area-alert{display:none}}

/* V2.36 - Organigrama profesional en tres paneles */
.org36-page{display:grid;gap:16px}.org36-header{display:flex;justify-content:space-between;gap:24px;align-items:flex-end;padding:24px 26px;border:1px solid #dce5ee;border-radius:20px;background:linear-gradient(135deg,#fff,#f4f8fc);box-shadow:0 12px 32px rgba(30,55,82,.07)}.org36-header h2{margin:5px 0 7px;color:#122a43;font-size:1.65rem}.org36-header p{margin:0;max-width:780px;color:#687b8d}.org36-new{white-space:nowrap}.org36-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.org36-stats article{display:flex;align-items:center;gap:12px;padding:13px 16px;border:1px solid #dde6ee;border-radius:15px;background:#fff}.org36-stats article>span{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#eaf2fb;color:#236fac;font-weight:900}.org36-stats strong,.org36-stats small{display:block}.org36-stats strong{font-size:1.35rem;color:#173654}.org36-stats small{color:#718293}.org36-stats .is-alert{border-color:#efcaca;background:#fffafa}.org36-workspace{display:grid;grid-template-columns:minmax(230px,.72fr) minmax(350px,1.15fr) minmax(390px,1.25fr);gap:12px;min-height:650px}.org36-panel{display:flex;flex-direction:column;min-width:0;border:1px solid #dce5ee;border-radius:18px;background:#fff;box-shadow:0 9px 26px rgba(25,52,78,.06);overflow:hidden}.org36-panel-title{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;padding:0 17px;border-bottom:1px solid #e5ebf1}.org36-panel-title>div{display:flex;align-items:center;gap:9px}.org36-panel-title h3{margin:0;color:#182d43;font-size:.88rem;text-transform:uppercase;letter-spacing:.045em}.org36-panel-title small{display:grid;place-items:center;min-width:27px;height:27px;padding:0 7px;border-radius:999px;background:#edf3f8;color:#49657d;font-weight:800}.org36-title-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:#e8f1fb;color:#236fac;font-weight:900}.org36-search{display:flex;align-items:center;gap:8px;margin:12px 14px;padding:0 11px;border:1px solid #d5e0ea;border-radius:11px;background:#fafcfe}.org36-search span{color:#71869a;font-size:1.1rem}.org36-search input{width:100%;min-width:0;height:40px;border:0;outline:0;background:transparent;color:#24394d}.org36-dept-list{display:grid;gap:4px;padding:0 10px 12px;overflow:auto}.org36-dept{display:grid;grid-template-columns:26px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:45px;padding:7px 10px;border:1px solid transparent;border-radius:10px;background:transparent;color:#31485d;text-align:left}.org36-dept:hover{background:#f4f8fc}.org36-dept.is-active{border-color:#d7e5f5;background:linear-gradient(90deg,#eaf3ff,#f7fbff);color:#174f85}.org36-dept strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.org36-dept em{display:grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:999px;background:#edf2f6;color:#687d90;font-style:normal;font-size:.72rem;font-weight:800}.org36-folder{color:#317bd0}.org36-panel footer{display:flex;justify-content:space-between;margin-top:auto;padding:12px 16px;border-top:1px solid #e8edf2;color:#7a8a99;font-size:.77rem}.org36-list-tools{display:grid;grid-template-columns:minmax(0,1fr) 105px;gap:8px;align-items:center;padding-right:13px}.org36-list-tools .org36-search{margin-right:0}.org36-list-tools select{height:42px;border:1px solid #d5e0ea;border-radius:10px;background:#fff;color:#40576b}.org36-task-list{overflow:auto}.org36-task{position:relative;display:grid;grid-template-columns:24px minmax(0,1fr) auto 18px;align-items:center;gap:10px;width:100%;min-height:66px;padding:10px 12px;border:0;border-bottom:1px solid #edf1f4;border-radius:0;background:#fff;color:#263e53;text-align:left}.org36-task:hover{background:#f7fafe}.org36-task.is-selected{background:linear-gradient(90deg,#e8f2ff,#f4f8ff)}.org36-task.is-selected:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:#2d76e5}.org36-task.is-inactive{opacity:.63}.org36-check{display:grid;place-items:center;width:19px;height:19px;border:1.5px solid #4a86e8;border-radius:5px;color:#2d76e5;font-size:.72rem;font-weight:900}.org36-task-copy{min-width:0}.org36-task-copy strong,.org36-task-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.org36-task-copy strong{color:#20364b}.org36-task-copy small{margin-top:4px;color:#4b7ac0;font-size:.76rem}.org36-status{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#edf0f3;color:#6b7680;font-size:.69rem;font-weight:800}.org36-status.is-active{background:#e2f5e8;color:#2d7a48}.org36-dots{color:#51697c;font-size:1.2rem}.org36-empty{padding:30px;text-align:center;color:#718393}.org36-expand{border:0;background:transparent;color:#60768a;font-size:1.1rem}.org36-detail-content{display:grid;gap:12px;padding:16px;overflow:auto}.org36-detail-head{display:grid;grid-template-columns:50px minmax(0,1fr) auto;gap:12px;align-items:center;padding:4px 2px 8px}.org36-detail-icon{display:grid;place-items:center;width:50px;height:50px;border-radius:15px;background:linear-gradient(145deg,#397ff0,#225ed4);color:#fff;font-size:1.3rem}.org36-detail-head h2{margin:0;color:#172e45;font-size:1.2rem}.org36-detail-head p{margin:4px 0 0;color:#3a75c5;font-size:.8rem}.org36-detail-card{padding:15px;border:1px solid #dfe7ef;border-radius:14px;background:#fff}.org36-detail-card h4{margin:0 0 12px;color:#263d52;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em}.org36-people-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.org36-person{display:grid;grid-template-columns:36px minmax(0,1fr);gap:9px;align-items:center}.org36-person>span{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#edf3fb;color:#34679a;font-weight:900}.org36-person small,.org36-person strong,.org36-person em{display:block}.org36-person small{color:#81909d;font-size:.68rem}.org36-person strong{margin-top:2px;color:#223b51;font-size:.84rem}.org36-person em{margin-top:2px;color:#718394;font-size:.68rem;font-style:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.org36-detail-muted,.org36-detail-warning{margin:0;padding:10px;border-radius:10px;background:#f5f7f9;color:#738391;font-size:.79rem}.org36-detail-warning{background:#fff4f4;color:#b34848}.org36-detail-card>p{margin:0;color:#566d80;line-height:1.5;white-space:pre-wrap}.org36-procedure{display:grid;gap:8px}.org36-procedure>div{display:grid;grid-template-columns:25px minmax(0,1fr);gap:9px;align-items:start}.org36-procedure b{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#e7f0fc;color:#2d6db4;font-size:.7rem}.org36-procedure span{color:#536a7e;font-size:.82rem;line-height:1.45}.org36-detail-actions{display:flex;justify-content:flex-end;gap:8px}.org36-detail-actions form{margin:0}.org36-detail-placeholder{padding:45px 20px;text-align:center;color:#7c8b98}.org-form-panel{max-width:920px!important}.org-form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}@media(max-width:1250px){.org36-workspace{grid-template-columns:220px minmax(330px,1fr) minmax(350px,1fr)}}@media(max-width:980px){.org36-workspace{grid-template-columns:220px minmax(0,1fr)}.org36-detail{grid-column:1/-1;min-height:420px}.org36-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.org36-header{align-items:flex-start;flex-direction:column}.org36-new{width:100%}.org36-workspace{grid-template-columns:1fr}.org36-departments,.org36-responsibilities,.org36-detail{grid-column:auto;min-height:auto}.org36-dept-list{max-height:230px}.org36-task-list{max-height:430px}.org36-people-grid{grid-template-columns:1fr}.org36-stats{grid-template-columns:1fr 1fr}.org36-detail-head{grid-template-columns:44px minmax(0,1fr)}.org36-detail-head .org36-status{grid-column:2}.org36-detail-icon{width:44px;height:44px}}

/* v2.38 - Separación visual entre responsable y sustitutos */
.org36-people-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0;padding:0;overflow:hidden}
.org36-people-column{display:grid;align-content:start;gap:12px;min-width:0;padding:15px}
.org36-people-column+ .org36-people-column{border-left:1px solid #dfe7ef}
.org36-people-column h4{margin:0 0 2px;color:#263d52;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em}
.org36-responsible-column{background:#fff}
.org36-substitutes-column{background:#fbfdff}
.org36-substitutes-column .org36-person+.org36-person{padding-top:12px;border-top:1px solid #e6edf3}
@media(max-width:700px){.org36-people-columns{grid-template-columns:1fr}.org36-people-column+ .org36-people-column{border-left:0;border-top:1px solid #dfe7ef}}

/* =========================================================
   V2.39 · MENÚ LATERAL AUTOOCULTABLE
   ========================================================= */
:root {
  --side-nav-collapsed: 72px;
  --side-nav-expanded: 286px;
}

body.has-side-nav {
  padding-left: var(--side-nav-collapsed);
}

body.has-side-nav .topbar {
  min-height: 82px;
}

body.has-side-nav .topbar-right.topbar-session-only {
  margin-left: auto;
}

.side-nav {
  position: fixed;
  z-index: 1200;
  inset: 0 auto 0 0;
  width: var(--side-nav-collapsed);
  overflow: hidden;
  background: linear-gradient(180deg, #111b2a 0%, #0c1522 100%);
  border-right: 1px solid rgba(255,255,255,.08);
  box-shadow: 8px 0 25px rgba(4,15,28,.16);
  transition: width .24s ease, box-shadow .24s ease;
}

.side-nav:hover,
.side-nav:focus-within {
  width: var(--side-nav-expanded);
  box-shadow: 14px 0 34px rgba(4,15,28,.28);
}

.side-nav-inner {
  display: flex;
  flex-direction: column;
  width: var(--side-nav-expanded);
  height: 100%;
  padding: 12px 10px;
  box-sizing: border-box;
}

.side-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 12px;
  padding: 4px 7px;
  color: #fff;
  white-space: nowrap;
}

.side-nav-logo {
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg,#2f81f7,#1557be);
  box-shadow: 0 7px 18px rgba(35,111,224,.35);
  font-size: .76rem;
  font-weight: 900;
}

.side-nav-brand div {
  opacity: 0;
  transform: translateX(-7px);
  transition: opacity .18s ease .04s, transform .18s ease .04s;
}

.side-nav:hover .side-nav-brand div,
.side-nav:focus-within .side-nav-brand div {
  opacity: 1;
  transform: translateX(0);
}

.side-nav-brand strong,
.side-nav-brand small { display: block; }
.side-nav-brand strong { font-size: 1rem; letter-spacing: .04em; }
.side-nav-brand small { margin-top: 1px; color: #8fa4bb; font-size: .66rem; letter-spacing: .12em; }

.side-nav-menu {
  display: grid;
  gap: 5px;
}

.side-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #c8d4e2;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.side-nav-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.07);
}

.side-nav-link.is-active {
  color: #fff;
  border-color: rgba(74,142,255,.34);
  background: linear-gradient(90deg,rgba(37,105,224,.92),rgba(33,91,187,.72));
  box-shadow: 0 7px 17px rgba(22,83,184,.25);
}

.side-nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #82b6ff;
}

.side-nav-icon {
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 1.08rem;
  font-weight: 800;
}

.side-nav-label {
  overflow: hidden;
  opacity: 0;
  transform: translateX(-8px);
  font-size: .84rem;
  font-weight: 750;
  letter-spacing: .01em;
  transition: opacity .17s ease .04s, transform .17s ease .04s;
}

.side-nav:hover .side-nav-label,
.side-nav:focus-within .side-nav-label {
  opacity: 1;
  transform: translateX(0);
}

.side-nav-bottom {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.side-nav-new { color: #cfe1ff; }
.side-nav-new:hover { background: rgba(44,119,237,.18); }
.side-nav-exit { color: #f0b7bd; }
.side-nav-exit:hover { background: rgba(195,55,70,.18); color: #ffdce0; }

@media (max-width: 760px) {
  :root { --side-nav-collapsed: 58px; --side-nav-expanded: 260px; }
  body.has-side-nav { padding-left: var(--side-nav-collapsed); }
  .side-nav-inner { padding-left: 6px; padding-right: 6px; }
  .side-nav-brand { padding-left: 4px; }
  .side-nav-logo { flex-basis: 34px; width: 34px; height: 34px; }
  .side-nav-link { padding-left: 4px; }
  .side-nav-icon { flex-basis: 36px; }
  body.has-side-nav .topbar .brand-pro p { display: none; }
}

/* =========================================================
   V2.42 · REDISEÑO TIPOGRÁFICO GLOBAL
   Fuente más fina, compacta y elegante en toda la aplicación
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --app-font: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea,
table {
  font-family: var(--app-font) !important;
  font-weight: 400;
  letter-spacing: -0.008em;
}

body {
  font-size: .94rem;
  line-height: 1.45;
}

/* Títulos: más contenidos y menos pesados */
h1,
h2,
h3,
h4,
h5,
h6,
.topbar h1,
.panel h2,
.panel h3 {
  font-family: var(--app-font) !important;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.topbar h1 {
  font-size: 1.35rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.42rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: .96rem; }
h5,
h6 { font-size: .88rem; }

/* Controles y navegación */
button,
.btn,
.button,
input,
select,
textarea,
label,
nav a,
.side-nav-link {
  font-size: .88rem;
}

button,
.btn,
.button,
.side-nav-link {
  font-weight: 500;
}

input,
select,
textarea {
  line-height: 1.35;
}

/* Tablas y datos: compactos pero legibles */
table,
th,
td {
  font-size: .87rem;
}

th {
  font-weight: 600;
  letter-spacing: .005em;
}

/* Tarjetas e indicadores */
.card span,
.card small,
.panel small,
.muted,
.help,
.hint {
  font-size: .82rem;
}

.card strong {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -.035em;
}

/* Menú lateral */
.side-nav-brand strong {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.side-nav-brand small {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .09em;
}

.side-nav-link {
  letter-spacing: -.005em;
}

/* Organigrama: elimina el aspecto excesivamente contundente */
.org36-header h2 {
  font-size: 1.45rem;
  font-weight: 600;
}

.org36-panel-title h3,
.org36-detail-card h4,
.org36-people-column h4 {
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .035em;
}

.org36-task-copy strong,
.org36-person strong,
.org36-dept strong,
.org36-detail-head h2 {
  font-weight: 600;
}

.org36-stats strong {
  font-size: 1.18rem;
  font-weight: 600;
}

.org36-status,
.org36-panel-title small,
.org36-dept em {
  font-weight: 600;
}

/* Evita negritas visualmente excesivas heredadas */
strong,
b {
  font-weight: 600;
}

/* Mantiene suficiente contraste en acciones críticas */
.btn-primary,
.btn-danger,
button[type='submit'] {
  font-weight: 600;
}

/* =========================================================
   V2.43 · TARJETAS DE SUBPROGRAMAS MÁS ELEGANTES
   ========================================================= */
.module-grid-pro .module-card {
  align-items: center;
  text-align: center;
  padding: 28px 24px 24px !important;
}

.module-grid-pro .module-icon {
  width: 78px !important;
  height: 78px !important;
  margin: 0 auto 14px !important;
  border-radius: 50% !important;
  font-size: 2.35rem !important;
  line-height: 1 !important;
  flex: 0 0 78px;
  background: #f1f5f9 !important;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

.module-grid-pro .module-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.module-grid-pro .module-status {
  margin: 0 auto 10px;
}

.module-grid-pro .module-content h3 {
  margin: 0 0 16px !important;
  font-size: 1rem !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  text-transform: uppercase;
  color: #0f172a !important;
}

.module-grid-pro .module-content h3::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: #22c55e;
  opacity: 0.8;
}

.module-grid-pro .module-content p {
  max-width: 290px;
  margin: 0 auto !important;
  font-size: 0.74rem !important;
  line-height: 1.55 !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #64748b !important;
}

.module-grid-pro .module-arrow {
  margin-top: 18px;
  align-self: center;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
}

@media (max-width: 720px) {
  .module-grid-pro .module-card {
    padding: 24px 20px 22px !important;
  }

  .module-grid-pro .module-icon {
    width: 68px !important;
    height: 68px !important;
    flex-basis: 68px;
    font-size: 2rem !important;
  }
}

/* v2.44 · PLANILLA */
.planilla-shell{display:grid;gap:18px}.planilla-head{display:flex;justify-content:space-between;gap:24px;align-items:flex-start}.planilla-head h2{margin:4px 0 6px;font-size:28px}.planilla-head p{margin:0;max-width:760px;color:#64748b}.planilla-actions{display:flex;gap:10px;flex-wrap:wrap}.planilla-tabs{display:flex;gap:6px;padding:6px;background:#eaf0f6;border-radius:14px;overflow:auto}.planilla-tabs a{white-space:nowrap;padding:10px 15px;border-radius:10px;color:#475569;text-decoration:none;font-weight:600}.planilla-tabs a.active{background:#fff;color:#12345b;box-shadow:0 4px 15px #12345b12}.planilla-toolbar{display:flex;align-items:center;justify-content:center;gap:18px}.planilla-toolbar input{padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px}.nav-date{color:#1f6fb2;text-decoration:none;font-weight:600}.planilla-board-wrap{overflow:auto;border:1px solid #dbe4ee;border-radius:16px;background:#fff;box-shadow:0 10px 30px #1e293b0b}.planilla-board{display:grid;grid-template-columns:190px repeat(var(--days),minmax(180px,1fr));min-width:1500px}.planilla-corner,.planilla-day-head,.planilla-person,.planilla-cell{border-right:1px solid #e5edf4;border-bottom:1px solid #e5edf4}.planilla-corner,.planilla-day-head{position:sticky;top:0;z-index:4;background:#12345b;color:#fff;padding:12px}.planilla-corner{left:0;z-index:5}.planilla-day-head{text-align:center}.planilla-day-head small,.planilla-day-head strong{display:block}.planilla-day-head.today{background:#166b76}.planilla-person{position:sticky;left:0;z-index:3;background:#f8fafc;padding:14px}.planilla-person strong,.planilla-person small{display:block}.planilla-person small{margin-top:4px;color:#64748b}.planilla-cell{padding:8px;min-height:132px;background:#fff;transition:.15s}.planilla-cell.drag-over{background:#dbeafe;outline:2px dashed #2563eb;outline-offset:-4px}.planilla-cell.copy-over{background:#dcfce7;outline:2px dashed #16a34a;outline-offset:-4px}.planilla-task{border:1px solid #cbd5e1;border-left:5px solid #5b8fb9;border-radius:10px;padding:9px;margin-bottom:7px;background:#fff;box-shadow:0 3px 10px #0f172a0d;cursor:grab}.planilla-task.dragging{opacity:.35}.planilla-task.priority-alta{border-left-color:#f59e0b}.planilla-task.priority-urgente{border-left-color:#dc2626}.planilla-task.priority-baja{border-left-color:#16a34a}.planilla-task strong,.planilla-task small{display:block}.planilla-task small{font-size:11px;color:#64748b;margin-top:4px}.task-top{display:flex;justify-content:space-between;gap:6px;font-size:11px;color:#475569}.task-status{background:#edf4f9;border-radius:999px;padding:1px 6px}.panel-card{background:#fff;border:1px solid #dbe4ee;border-radius:16px;padding:18px;box-shadow:0 10px 30px #1e293b0b}.table-scroll{overflow:auto}.data-table.elegant{width:100%;border-collapse:collapse}.data-table.elegant th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:#64748b;background:#f8fafc}.data-table.elegant th,.data-table.elegant td{padding:11px 12px;border-bottom:1px solid #e8eef4;text-align:left;vertical-align:top}.data-table.elegant small{color:#64748b}.row-actions{display:flex;gap:6px}.row-actions form{margin:0}.icon-btn{border:0;background:#edf4f9;color:#17496f;border-radius:7px;padding:6px 9px;cursor:pointer}.icon-btn.danger{background:#fee2e2;color:#b91c1c}.filter-row{margin-bottom:14px}.filter-row input{width:min(520px,100%);padding:11px;border:1px solid #cbd5e1;border-radius:10px}.manage-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(280px,1fr);gap:18px;align-items:start}.compact-form{display:grid;gap:12px;margin-bottom:18px}.compact-form label,.task-form>label{display:grid;gap:6px;font-weight:600;color:#334155}.compact-form input,.compact-form select,.task-form input,.task-form select,.task-form textarea,#whatsappText{width:100%;box-sizing:border-box;padding:10px;border:1px solid #cbd5e1;border-radius:9px;font:inherit}.compact-form .check{display:flex}.modal-backdrop{display:none;position:fixed;inset:0;z-index:1000;background:#0f172a99;padding:28px;overflow:auto}.modal-backdrop.open{display:flex;align-items:flex-start;justify-content:center}.modal-card{position:relative;background:#fff;width:min(650px,100%);border-radius:18px;padding:24px;box-shadow:0 30px 70px #0005}.modal-card.wide{width:min(980px,100%)}.modal-close{position:absolute;right:14px;top:10px;border:0;background:transparent;font-size:28px;cursor:pointer}.form-grid{display:grid;gap:12px}.form-grid.four{grid-template-columns:repeat(4,1fr)}.form-grid.two{grid-template-columns:repeat(2,1fr)}.task-form{display:grid;gap:14px}.task-form fieldset{border:1px solid #dbe4ee;border-radius:12px}.check-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.modal-actions{display:flex;justify-content:flex-end;gap:10px}.empty-state{padding:30px;text-align:center;color:#64748b}.span-all{grid-column:1/-1}.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:9px;padding:10px 14px;font-weight:650;text-decoration:none;cursor:pointer}.btn.primary{background:#12345b;color:#fff}.btn.secondary{background:#eaf0f6;color:#12345b}
@media(max-width:900px){.planilla-head{display:grid}.manage-grid{grid-template-columns:1fr}.form-grid.four,.form-grid.two,.check-grid{grid-template-columns:1fr 1fr}.planilla-toolbar{flex-wrap:wrap}.modal-backdrop{padding:12px}}

/* v2.45 · PLANILLA estilo operativo tipo Excel */
.planilla-board-wrap{
  border:2px solid #111827;
  border-radius:4px;
  background:#fff;
  box-shadow:none;
}
.planilla-board{
  grid-template-columns:150px repeat(var(--days),minmax(315px,1fr));
  min-width:2355px;
  font-family:Inter,"Segoe UI",Arial,sans-serif;
}
.planilla-corner,.planilla-day-head,.planilla-person,.planilla-cell{
  border-right:1px solid #111827;
  border-bottom:1px solid #111827;
}
.planilla-corner,.planilla-day-head{
  background:#f1c3a8;
  color:#111827;
  padding:5px 7px;
  min-height:42px;
}
.planilla-corner{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  font-weight:800;
  text-align:center;
}
.planilla-day-head strong{
  font-size:11px;
  font-weight:800;
  line-height:1.15;
}
.planilla-day-head small{
  margin-top:4px;
  font-size:9px;
  font-weight:800;
  color:#111827;
}
.planilla-day-head.today{background:#eab28f;color:#111827}
.planilla-person{
  background:#ffd500;
  color:#111827;
  padding:8px 7px;
  min-height:88px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.planilla-person strong{
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  line-height:1.15;
}
.planilla-person small{
  margin-top:5px;
  color:#2f3a45;
  font-size:8px;
  font-weight:700;
  line-height:1.15;
}
.planilla-cell{
  background:#dcefd3;
  min-height:88px;
  padding:5px 7px;
  transition:.12s;
}
.planilla-cell.drag-over{background:#c9e2ff;outline:3px dashed #2563eb;outline-offset:-4px}
.planilla-cell.copy-over{background:#c9f4d2;outline:3px dashed #16a34a;outline-offset:-4px}
.planilla-task{
  display:block;
  border:0;
  border-radius:0;
  padding:1px 0;
  margin:0;
  background:transparent;
  box-shadow:none;
  cursor:grab;
  line-height:1.25;
  min-width:0;
}
.planilla-task:hover{background:rgba(255,255,255,.48)}
.planilla-task.dragging{opacity:.32}
.planilla-task-line{
  display:flex;
  align-items:baseline;
  gap:4px;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:9px;
  color:#111827;
}
.planilla-task-line>span{flex:0 0 auto}
.planilla-task-line .task-description{
  flex:0 1 auto;
  min-width:30px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.task-time{color:#d40000;font-weight:850}
.task-aviso{color:#075985;font-weight:800}
.task-ot{color:#6b21a8;font-weight:800}
.task-code{color:#111827;font-weight:900}
.task-client{color:#111827;font-weight:750}
.task-description{color:#1f2937;font-weight:500}
.task-note{color:#d40000;font-weight:800;overflow:hidden;text-overflow:ellipsis}
.task-state{font-weight:900;text-transform:uppercase}
.status-en-curso .task-state{color:#b45309}
.status-finalizada .task-state{color:#15803d}
.status-cancelada .task-state{color:#b91c1c}
.planilla-task.priority-urgente .task-description,
.planilla-task.priority-urgente .task-client{color:#b91c1c;font-weight:800}
.planilla-task.priority-alta .task-description{font-weight:750}
@media(max-width:900px){
  .planilla-board{grid-template-columns:125px repeat(var(--days),minmax(280px,1fr));min-width:2085px}
}


/* v2.46 · orden manual de operarios */
.panel-help{margin:-4px 0 14px;color:#64748b;font-size:13px}
.worker-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}
.worker-actions form{display:inline-flex;gap:4px;margin:0}
.worker-actions .icon-btn{min-width:30px;padding:6px 8px}

/* V2.47 · Gestión de operarios de PLANILLA */
.workers-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;align-items:start}
.workers-panel{min-width:0;padding:18px}
.workers-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.workers-heading h3,.worker-form-card h3,.workers-info-card h3{margin:0 0 6px}
.workers-heading .panel-help{margin:0}
.workers-count{flex:0 0 auto;padding:6px 10px;border-radius:999px;background:#edf4f9;color:#17496f;font-size:12px;font-weight:700}
.workers-table-wrap{border:1px solid #dbe4ee;border-radius:12px;overflow:auto}
.workers-table{table-layout:fixed;min-width:760px}
.workers-table .col-order{width:72px}.workers-table .col-name{width:29%}.workers-table .col-phone{width:23%}.workers-table .col-status{width:105px}.workers-table .col-actions{width:250px}
.workers-table th,.workers-table td{vertical-align:middle!important}
.workers-table th:last-child,.workers-table td:last-child{text-align:right}
.worker-order{color:#17496f}.worker-name{font-size:14px}.worker-phone{color:#64748b}
.status-pill{display:inline-flex;align-items:center;justify-content:center;min-width:68px;padding:4px 9px;border-radius:999px;font-size:12px;font-weight:700}
.status-pill.is-active{background:#dcfce7;color:#15803d}.status-pill.is-inactive{background:#f1f5f9;color:#64748b}
.worker-actions{justify-content:flex-end}.worker-actions form{flex:0 0 auto}.worker-actions .edit-worker{padding-inline:11px}
.workers-sidebar{display:grid;gap:18px;position:sticky;top:18px;min-width:0}
.worker-form-card{margin:0}.worker-form-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.form-kicker{display:block;margin-bottom:4px;color:#64748b;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.worker-form-reset{border:0;background:transparent;color:#1f6fb2;font:inherit;font-size:12px;font-weight:700;cursor:pointer;padding:4px 0}
.worker-active-check{align-items:center;gap:8px!important}.worker-active-check input{width:auto!important}
.workers-info-card{padding:18px}.workers-info-card p{margin:0 0 12px;color:#64748b;font-size:13px;line-height:1.5}.workers-info-card p:last-child{margin-bottom:0}
@media(max-width:1100px){.workers-layout{grid-template-columns:1fr}.workers-sidebar{position:static;grid-template-columns:minmax(280px,420px) minmax(0,1fr)} }
@media(max-width:720px){.workers-sidebar{grid-template-columns:1fr}.workers-heading{display:grid}.workers-table .col-actions{width:225px}}


/* V2.48 · PLANILLA semanal completa sin desplazamiento horizontal */
.planilla-board-wrap{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}
.planilla-board{
  width:100%;
  min-width:0;
  grid-template-columns:minmax(105px,125px) repeat(var(--days),minmax(0,1fr));
}
.planilla-corner,.planilla-day-head,.planilla-person,.planilla-cell{min-width:0}
.planilla-day-head{padding-left:3px;padding-right:3px}
.planilla-person{padding-left:4px;padding-right:4px}
.planilla-cell{padding-left:4px;padding-right:4px;overflow:hidden}
.planilla-task-line{gap:3px;font-size:clamp(7px,.52vw,9px)}
@media(max-width:1100px){
  .planilla-board{grid-template-columns:92px repeat(var(--days),minmax(0,1fr));min-width:0}
  .planilla-day-head strong{font-size:9px}
  .planilla-day-head small{font-size:7px}
  .planilla-person strong{font-size:9px}
  .planilla-person small{font-size:7px}
}


/* V2.49 · PLANILLA de lunes a viernes y tareas en tarjetas compactas */
.planilla-board{
  grid-template-columns:minmax(110px,132px) repeat(5,minmax(0,1fr));
}
.planilla-task{
  border:1px solid rgba(15,23,42,.38);
  border-left:3px solid #2563eb;
  border-radius:4px;
  padding:3px 5px;
  margin:0 0 4px;
  background:rgba(255,255,255,.58);
  box-shadow:0 1px 2px rgba(15,23,42,.08);
}
.planilla-task:last-child{margin-bottom:0}
.planilla-task:hover{
  background:#fff;
  border-color:#2563eb;
  box-shadow:0 3px 10px rgba(15,23,42,.16);
  position:relative;
  z-index:2;
}
.planilla-task.priority-alta{border-left-color:#f59e0b}
.planilla-task.priority-urgente{border-left-color:#dc2626}
.planilla-task.priority-baja{border-left-color:#16a34a}
.planilla-task-line{
  font-size:clamp(8px,.62vw,10px);
  line-height:1.25;
}
@media(max-width:1100px){
  .planilla-board{grid-template-columns:92px repeat(5,minmax(0,1fr));}
}

/* v2.50 · Editor integral de presupuestos */


/* V2.53 · Editor visual de presupuestos basado en la plantilla Excel QTM */
.budget-editor-form{padding-bottom:84px}.excel-budget-sheet{background:#fff;border:1px solid #cbd5e1;border-radius:14px;box-shadow:0 12px 34px rgba(15,23,42,.09);overflow:hidden}.excel-budget-header{display:grid;grid-template-columns:290px 1fr 210px;align-items:stretch;border-bottom:3px solid #f18a00;background:#fff}.excel-company-block{display:flex;align-items:center;gap:14px;padding:14px 18px;border-right:1px solid #d6d9de}.excel-company-block img{display:block;width:150px;height:72px;object-fit:contain;object-position:left center}.excel-company-block div{display:flex;flex-direction:column}.excel-company-block strong{font-size:20px;color:#111827}.excel-company-block span{font-size:11px;color:#667085}.excel-document-title{display:flex;flex-direction:column;justify-content:center;padding:14px 20px;text-align:center}.excel-document-title>span{font-size:24px;font-weight:900;letter-spacing:.08em;color:#111827}.excel-document-title input{margin-top:7px;text-align:center;font-weight:700;border:1px solid #d0d5dd;background:#fff}.excel-document-status{padding:14px 18px;border-left:1px solid #d6d9de;display:flex;align-items:center}.excel-budget-sheet label{display:block;font-size:11px;font-weight:800;color:#344054;text-transform:uppercase;letter-spacing:.025em}.excel-budget-sheet input,.excel-budget-sheet select,.excel-budget-sheet textarea{box-sizing:border-box;width:100%;margin-top:5px;border:1px solid #c9ced6;border-radius:3px;padding:8px;background:#fff;color:#101828;font-size:13px;text-transform:none;letter-spacing:normal}.excel-budget-sheet input:focus,.excel-budget-sheet select:focus,.excel-budget-sheet textarea:focus{outline:2px solid rgba(241,138,0,.22);border-color:#f18a00}.excel-budget-columns{display:grid;grid-template-columns:minmax(0,1fr) 310px;min-height:560px}.excel-commercial-panel{min-width:0;border-right:2px solid #667085}.excel-internal-panel{background:#f4f5f7;padding-bottom:18px}.excel-section-title{min-height:35px;display:flex;align-items:center;padding:0 14px;background:#20242a;color:#fff;font-size:12px;font-weight:900;letter-spacing:.06em}.excel-section-title.toolbar-title{justify-content:space-between;gap:12px;background:#343a40}.excel-section-title.internal-title{background:#f18a00;color:#111827}.excel-meta-grid{display:grid;grid-template-columns:1.6fr 1fr 1fr 1fr;gap:1px;padding:1px;background:#aeb4bc}.excel-meta-grid label{padding:8px 10px;background:#fff}.excel-meta-grid .span-2{grid-column:span 2}.excel-toolbar-actions{display:flex;gap:8px;padding:4px 0}.excel-toolbar-actions .btn{padding:7px 10px;font-size:12px}.excel-lines-wrap{overflow:auto;max-height:520px;border:0}.excel-budget-lines{width:max-content;min-width:100%;border-collapse:collapse;font-size:11px}.excel-budget-lines th{position:sticky;top:0;z-index:2;background:#dfe3e8;color:#111827;border:1px solid #8d949d;padding:7px 5px;white-space:nowrap}.excel-budget-lines th.internal-col{background:#f7ca91}.excel-budget-lines td{padding:3px;border:1px solid #b7bdc5;background:#fff}.excel-budget-lines input,.excel-budget-lines select{margin:0;min-width:70px;border:0;border-radius:0;padding:6px;background:transparent;font-size:11px}.excel-budget-lines .descripcion{min-width:260px}.excel-budget-lines .partida{min-width:105px;font-weight:800}.excel-budget-lines .articulo_id{min-width:170px}.excel-budget-lines .comentarios{min-width:150px}.excel-budget-lines .calc{min-width:82px;text-align:right;font-weight:800;white-space:nowrap;padding:7px 5px}.excel-budget-lines td:nth-child(1),.excel-budget-lines td:nth-child(6),.excel-budget-lines td:nth-child(7),.excel-budget-lines td:nth-child(8),.excel-budget-lines td:nth-child(9),.excel-budget-lines td:nth-child(10),.excel-budget-lines td:nth-child(11),.excel-budget-lines td:nth-child(12),.excel-budget-lines td:nth-child(15){background:#fff8ec}.line-delete{border:0;background:#fee2e2;color:#991b1b;border-radius:3px;width:28px;height:28px;font-size:18px;cursor:pointer}.excel-commercial-bottom{display:grid;grid-template-columns:1fr 300px;gap:14px;padding:14px;background:#fff}.excel-commercial-bottom textarea{min-height:132px}.budget-totals{border:1px solid #8d949d;border-radius:0;overflow:hidden}.budget-totals>div{display:flex;justify-content:space-between;padding:10px 12px;border-bottom:1px solid #b7bdc5}.budget-totals>div:last-child{border-bottom:0}.budget-totals .grand-total{background:#20242a;color:#fff;font-size:16px;border-top:3px solid #f18a00}.excel-internal-grid{display:grid;gap:1px;padding:1px;background:#b7bdc5}.excel-internal-grid label,.internal-notes{padding:9px 12px;background:#f8f9fa}.excel-internal-summary{margin:14px 12px;border:1px solid #9da4ad;background:#fff}.excel-internal-summary>div{display:flex;justify-content:space-between;padding:11px;border-bottom:1px solid #d0d5dd}.excel-internal-summary>div:last-child{border-bottom:0}.internal-notes{display:block;margin:0 12px;background:#fff;border:1px solid #c2c7ce}.excel-help-box{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:14px 12px 0;padding:12px;border-left:4px solid #f18a00;background:#fff;font-size:11px;color:#475467}.excel-help-box strong{grid-column:1/-1;color:#111827}.budget-sticky-actions{position:sticky;bottom:0;z-index:20;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);padding:14px;border-top:1px solid #e2e8f0;box-shadow:0 -8px 20px rgba(15,23,42,.08)}
@media(max-width:1250px){.excel-budget-columns{grid-template-columns:1fr}.excel-commercial-panel{border-right:0;border-bottom:2px solid #667085}.excel-internal-panel{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:0 12px 14px}.excel-internal-panel .internal-title{grid-column:1/-1;margin:0 -12px}.excel-internal-grid{grid-template-columns:repeat(3,1fr)}.excel-help-box{align-self:start}}
@media(max-width:850px){.excel-budget-header{grid-template-columns:1fr}.excel-company-block,.excel-document-status{border:0;border-bottom:1px solid #d6d9de}.excel-meta-grid{grid-template-columns:1fr 1fr}.excel-commercial-bottom{grid-template-columns:1fr}.excel-internal-panel{grid-template-columns:1fr}.excel-internal-grid{grid-template-columns:1fr 1fr}.excel-section-title.toolbar-title{align-items:flex-start;flex-direction:column;padding-top:8px;padding-bottom:8px}}

/* =========================================================
   V3.00 · NUEVO FRAMEWORK VISUAL Y CENTRO DE CONTROL
   ========================================================= */
:root{--v3-sidebar:260px;--v3-header:126px;--v3-bg:#f3f5f7;--v3-dark:#252a2f;--v3-dark-2:#30363c;--v3-text:#20262b;--v3-muted:#6f7881;--v3-accent:#ee7f1a;--v3-border:#e3e7ea;--v3-card:#fff}
body.gmao-v300{margin:0;background:var(--v3-bg);color:var(--v3-text);overflow-x:hidden}
.gmao-v300 .app-shell{min-height:100vh;display:grid;grid-template-columns:var(--v3-sidebar) minmax(0,1fr);grid-template-rows:var(--v3-header) minmax(calc(100vh - var(--v3-header)),auto);grid-template-areas:"logo header" "sidebar content"}
.app-logo-zone{grid-area:logo;background:#fff;border-right:1px solid var(--v3-border);border-bottom:1px solid var(--v3-border);display:flex;align-items:center;justify-content:center;padding:20px 28px;box-sizing:border-box;overflow:hidden}
.app-logo-zone img{display:block;max-width:100%;max-height:82px;width:auto;height:auto;object-fit:contain}
.app-header{grid-area:header;background:#fff;border-bottom:1px solid var(--v3-border);display:flex;align-items:center;justify-content:space-between;padding:0 34px;box-sizing:border-box;min-width:0}
.app-header-copy{min-width:0}.app-kicker{font-size:11px;font-weight:800;letter-spacing:1.6px;color:var(--v3-accent)}.app-header h1{margin:5px 0 4px;font-size:25px;line-height:1.05;color:var(--v3-text)}.app-header p{margin:0;color:var(--v3-muted);font-size:13px}
.app-session{display:flex;align-items:center;gap:20px;flex-shrink:0}.app-user-badge{display:flex;align-items:center;gap:11px}.app-user-avatar{width:40px;height:40px;border-radius:12px;background:#f0f2f4;color:var(--v3-dark);display:grid;place-items:center;font-weight:800}.app-user-badge strong,.app-user-badge small{display:block}.app-user-badge strong{font-size:13px}.app-user-badge small{font-size:11px;color:var(--v3-muted);margin-top:2px}.app-logout{background:var(--v3-dark);color:#fff!important;text-decoration:none;padding:10px 16px;border-radius:10px;font-size:12px;font-weight:800}.app-logout:hover{background:#15191c}
.app-sidebar{grid-area:sidebar;background:var(--v3-dark);min-height:calc(100vh - var(--v3-header));position:sticky;top:0}.app-menu{height:100%;display:flex;flex-direction:column;padding:22px 14px;box-sizing:border-box}.app-menu-section{display:flex;flex-direction:column;gap:5px}.app-menu-admin{margin-top:auto;padding-top:20px;border-top:1px solid rgba(255,255,255,.1)}.app-menu-caption{padding:0 14px 9px;color:#89929a;font-size:10px;font-weight:800;letter-spacing:1.4px}.app-menu-link{position:relative;display:flex;align-items:center;gap:12px;min-height:44px;padding:0 14px;color:#d7dde2!important;text-decoration:none;border-radius:10px;font-size:13px;font-weight:650;transition:.18s ease}.app-menu-link>span{width:22px;text-align:center;font-size:17px;color:#aeb7be}.app-menu-link:hover{background:rgba(255,255,255,.07);color:#fff!important}.app-menu-link.is-active{background:rgba(255,255,255,.1);color:#fff!important}.app-menu-link.is-active:before{content:"";position:absolute;left:-14px;top:9px;bottom:9px;width:4px;background:var(--v3-accent);border-radius:0 4px 4px 0}.app-menu-link.is-active>span{color:var(--v3-accent)}
.app-content{grid-area:content;padding:26px 30px 34px;min-width:0;box-sizing:border-box}.gmao-v300 .container{max-width:none}
.dashboard-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:22px}.dashboard-eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:800;color:var(--v3-accent)}.dashboard-intro h2{margin:5px 0 3px;font-size:25px}.dashboard-intro p{margin:0;color:var(--v3-muted);font-size:13px}.dashboard-date{text-transform:capitalize;color:var(--v3-muted);font-size:12px;font-weight:650;white-space:nowrap}
.dashboard-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.dashboard-card{position:relative;min-width:0;min-height:238px;border:1px solid var(--v3-border);background:var(--v3-card);border-radius:16px;padding:22px;text-align:left;cursor:pointer;box-shadow:0 7px 22px rgba(27,35,42,.045);display:flex;flex-direction:column;overflow:hidden;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;font:inherit;color:inherit}.dashboard-card:before{content:"";position:absolute;left:0;top:0;right:0;height:4px;background:#cfd5da}.dashboard-card:hover{transform:translateY(-3px);box-shadow:0 13px 30px rgba(27,35,42,.09);border-color:#d5dade}.card-expiry:before,.card-billing:before,.card-budgets:before,.card-deviation:before,.card-employees:before{background:var(--v3-accent)}.dashboard-card-icon{width:40px;height:40px;border-radius:12px;background:#f1f3f5;display:grid;place-items:center;font-size:20px;margin-bottom:17px;color:var(--v3-dark)}.dashboard-card-label{font-size:10px;letter-spacing:1.1px;font-weight:850;color:var(--v3-muted)}.dashboard-card>strong{display:block;font-size:29px;line-height:1;margin:10px 0 7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dashboard-card>small{font-size:12px;color:var(--v3-muted)}.dashboard-card-action{margin-top:auto;padding-top:14px;color:var(--v3-accent);font-size:11px;font-weight:850}.mini-list{display:flex;flex-direction:column;gap:6px;margin-top:13px}.mini-list span{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px}.mini-list b{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mini-list em{font-style:normal;color:var(--v3-muted);white-space:nowrap;max-width:45%;overflow:hidden;text-overflow:ellipsis}
.dashboard-lower{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(250px,.75fr);gap:18px;margin-top:18px}.dashboard-panel{background:#fff;border:1px solid var(--v3-border);border-radius:16px;padding:22px;box-shadow:0 7px 22px rgba(27,35,42,.035);min-width:0}.dashboard-panel-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:15px}.dashboard-panel-heading span{font-size:9px;color:var(--v3-accent);font-weight:850;letter-spacing:1.2px}.dashboard-panel-heading h3{margin:4px 0 0;font-size:17px}.dashboard-panel-heading a{font-size:11px;text-decoration:none;color:var(--v3-accent);font-weight:800}.dashboard-contract-list{display:flex;flex-direction:column}.dashboard-contract-list>a{display:grid;grid-template-columns:54px minmax(0,1fr) 16px;align-items:center;gap:13px;padding:12px 0;border-top:1px solid #eef0f2;color:inherit;text-decoration:none}.deadline-days{height:48px;border-radius:11px;background:#f1f3f5;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:16px;font-weight:850}.deadline-days small{font-size:8px;color:var(--v3-muted);text-transform:uppercase}.dashboard-contract-list strong,.dashboard-contract-list small{display:block}.dashboard-contract-list strong{font-size:13px}.dashboard-contract-list div small{font-size:10px;color:var(--v3-muted);margin-top:4px}.dashboard-empty{padding:22px 4px;color:var(--v3-muted);font-size:12px}.summary-metric{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 0;border-top:1px solid #eef0f2}.summary-metric span{font-size:11px;color:var(--v3-muted)}.summary-metric strong{font-size:17px}
.dashboard-modal{position:fixed;inset:0;background:rgba(18,23,27,.58);display:none;align-items:center;justify-content:center;padding:24px;z-index:5000}.dashboard-modal.is-open{display:flex}.dashboard-modal-dialog{position:relative;width:min(620px,96vw);max-height:86vh;overflow:auto;background:#fff;border-radius:18px;padding:26px;box-shadow:0 25px 70px rgba(0,0,0,.22)}.dashboard-modal-dialog.modal-wide{width:min(900px,96vw)}.modal-close{position:absolute;right:17px;top:14px;border:0;background:#f1f3f5;width:34px;height:34px;border-radius:10px;font-size:22px;cursor:pointer}.modal-heading span{font-size:9px;letter-spacing:1.4px;font-weight:850;color:var(--v3-accent)}.modal-heading h3{margin:5px 42px 20px 0;font-size:21px}.modal-list{display:flex;flex-direction:column}.modal-list>a{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:14px 0;border-top:1px solid #eceff1;text-decoration:none;color:inherit}.modal-list strong,.modal-list small{display:block}.modal-list small{color:var(--v3-muted);font-size:11px;margin-top:3px}.modal-pill,.deviation-badge{display:inline-block;background:#fff0e3;color:#b95600;border-radius:999px;padding:6px 10px;font-size:10px;font-weight:850;white-space:nowrap}.modal-table-wrap{overflow:auto;border:1px solid #eceff1;border-radius:12px}.modal-table{width:100%;border-collapse:collapse;font-size:12px}.modal-table th{background:#f5f6f7;text-align:left;color:#68717a;font-size:9px;letter-spacing:.8px;padding:12px}.modal-table td{padding:13px 12px;border-top:1px solid #eceff1}.modal-table td:last-child,.modal-table th:last-child{text-align:right}.modal-table a{color:var(--v3-text);font-weight:800}
@media(max-width:1250px){:root{--v3-sidebar:230px}.dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-card{min-height:220px}}
@media(max-width:860px){body.gmao-v300{overflow:auto}.gmao-v300 .app-shell{display:block}.app-logo-zone{height:105px}.app-header{min-height:118px;padding:18px 20px}.app-header-copy p{display:none}.app-session{gap:9px}.app-user-badge div{display:none}.app-sidebar{position:static;min-height:auto}.app-menu{padding:10px;display:block}.app-menu-section{display:flex;flex-direction:row;overflow-x:auto}.app-menu-admin{margin-top:8px;padding-top:8px}.app-menu-caption{display:none}.app-menu-link{flex:0 0 auto}.app-content{padding:20px 14px}.dashboard-grid,.dashboard-lower{grid-template-columns:1fr}.dashboard-date{display:none}}
@media(max-width:520px){.app-header h1{font-size:19px}.app-kicker{font-size:9px}.dashboard-grid{grid-template-columns:1fr}.dashboard-card{min-height:205px}.app-user-avatar{display:none}.dashboard-intro h2{font-size:21px}}

/* =========================================================
   V3.01 · AJUSTE VISUAL PREMIUM DEL CENTRO DE CONTROL
   ========================================================= */
:root{
  --v301-black:#111315;
  --v301-black-soft:#181b1e;
  --v301-orange:#f18412;
  --v301-bg:#f4f5f6;
  --v301-card:#ffffff;
  --v301-text:#1f2327;
  --v301-muted:#66717b;
  --v301-line:#e1e5e8;
}
.gmao-v300 .app-logo-zone{
  background:linear-gradient(145deg,var(--v301-black),#171a1d);
  border-right:1px solid rgba(255,255,255,.08);
  border-bottom:1px solid rgba(255,255,255,.08);
  padding:14px 28px;
}
.gmao-v300 .app-logo-zone img{
  max-width:84%;
  max-height:94px;
  filter:none;
}
.gmao-v300 .app-header{
  background:linear-gradient(110deg,var(--v301-black),#15181a);
  border-bottom:1px solid rgba(255,255,255,.08);
  color:#fff;
}
.gmao-v300 .app-kicker{color:var(--v301-orange)}
.gmao-v300 .app-header h1{color:#fff}
.gmao-v300 .app-header p{color:#c5cbd0}
.gmao-v300 .app-user-avatar{background:var(--v3-accent);color:#fff;border:none}
.gmao-v300 .app-user-badge strong{color:#fff}
.gmao-v300 .app-user-badge small{color:var(--v3-accent);font-style:italic}
.gmao-v300 .app-logout{background:transparent;border:1px solid var(--v3-accent);color:var(--v3-accent)!important}
.gmao-v300 .app-logout:hover{background:var(--v3-accent);color:#fff!important}
.gmao-v300 .app-sidebar{background:linear-gradient(180deg,var(--v301-black),#171a1c)}
.gmao-v300 .app-menu-caption{color:var(--v301-orange)}
.gmao-v300 .app-menu-link{border-radius:0;margin-left:-14px;margin-right:-14px;padding-left:28px}
.gmao-v300 .app-menu-link:hover{background:rgba(255,255,255,.055);color:#fff!important}
.gmao-v300 .app-menu-link.is-active{background:rgba(255,255,255,.075);color:var(--v301-orange)!important}
.gmao-v300 .app-menu-link.is-active:before{left:0;top:0;bottom:0;border-radius:0}
.gmao-v300 .app-menu-link.is-active>span{color:var(--v301-orange)}
.gmao-v300 .app-content{background:var(--v301-bg);padding:18px 22px 26px}

.control-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin:0 0 14px;padding:0 3px}
.control-heading h2{margin:0;color:var(--v301-text);font-size:25px;line-height:1.05;letter-spacing:-.4px}
.control-heading>div:first-child>span{display:block;width:62px;height:3px;margin-top:8px;background:var(--v301-orange)}

.gmao-v300 .dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.gmao-v300 .dashboard-card,
.gmao-v300 .dashboard-card:hover,
.gmao-v300 .dashboard-card:focus,
.gmao-v300 .dashboard-card:focus-visible,
.gmao-v300 .dashboard-card:active{
  min-height:224px;
  padding:18px 22px 16px 92px;
  background:#fff!important;
  color:var(--v301-text)!important;
  border:1px solid #dde2e5!important;
  border-radius:12px;
  box-shadow:0 3px 10px rgba(22,27,31,.09)!important;
  transform:none!important;
  outline:none!important;
}
.gmao-v300 .dashboard-card:hover{box-shadow:0 7px 20px rgba(22,27,31,.13)!important;border-color:#d3d9dd!important}
.gmao-v300 .dashboard-card:before{display:none}
.gmao-v300 .dashboard-card-icon{position:absolute;left:22px;top:18px;width:52px;height:52px;margin:0;border:1px solid #f4d5b9;background:#fff;color:var(--v301-orange);font-size:28px;box-shadow:0 3px 9px rgba(37,42,46,.09)}
.gmao-v300 .dashboard-card-label{align-self:center;color:#30363c;font-size:13px;letter-spacing:.15px;font-weight:850;text-align:center}
.gmao-v300 .dashboard-card>strong{align-self:center;margin:12px 0 5px;color:var(--v301-orange);font-size:39px;overflow:visible}
.gmao-v300 .dashboard-card>small{align-self:center;color:var(--v301-orange);font-size:12px;font-weight:750}
.gmao-v300 .dashboard-card-action{align-self:center;margin-top:auto;padding-top:12px;color:#ef6f00;font-size:11px;font-weight:900}
.gmao-v300 .dashboard-card-action i{font-style:normal;font-size:20px;vertical-align:-2px;margin-left:7px}
.gmao-v300 .mini-list{width:100%;margin-top:14px;gap:7px}
.gmao-v300 .mini-list span{font-size:11px}
.gmao-v300 .mini-list b{color:#15181a;text-align:left}
.gmao-v300 .mini-list em{color:#31373c;text-align:right;max-width:none}
.deviation-mini-list{width:100%;margin-top:16px;display:flex;flex-direction:column}
.deviation-mini-list span{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:4px 0;border-bottom:1px solid #edf0f2;font-size:11px}
.deviation-mini-list b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
.deviation-mini-list em{font-style:normal;color:#dc2e28;font-weight:800;white-space:nowrap}
.dashboard-empty.compact{padding:32px 0 0;text-align:center}

.gmao-v300 .dashboard-lower.dashboard-tables{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.gmao-v300 .dashboard-panel{padding:0;border-radius:12px;border:1px solid #dde2e5;overflow:hidden;box-shadow:0 3px 10px rgba(22,27,31,.08)}
.gmao-v300 .dashboard-panel-heading{align-items:center;margin:0;padding:15px 16px 10px}
.gmao-v300 .dashboard-panel-heading h3{margin:0;font-size:15px}
.gmao-v300 .dashboard-panel-heading button{border:0;background:transparent;color:#ef6f00;font-size:10px;font-weight:900;cursor:pointer}
.dashboard-inline-table{width:100%;overflow:hidden}
.dashboard-inline-table table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:10.5px}
.dashboard-inline-table th{padding:9px 15px;text-align:left;color:#68737d;font-size:8.5px;letter-spacing:.4px;border-bottom:1px solid #dfe3e6}
.dashboard-inline-table td{padding:9px 15px;border-bottom:1px solid #e8ebed;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dashboard-inline-table th:last-child,.dashboard-inline-table td:last-child{text-align:right;width:72px}
.dashboard-inline-table th:nth-child(2),.dashboard-inline-table td:nth-child(2){width:28%}
.dashboard-inline-table a{color:#15181a;text-decoration:none;font-weight:650}
.dashboard-inline-table .accent-cell{color:var(--v301-orange);font-weight:850}
.dashboard-inline-table .money-cell{font-weight:750}
.panel-footer-link{display:inline-flex;align-items:center;gap:8px;padding:12px 16px 15px;color:#ef6f00!important;text-decoration:none;font-size:10px;font-weight:900}
.panel-footer-link span{font-size:20px;line-height:1}

body.modal-open{overflow:hidden}
.gmao-v300 .dashboard-modal{background:rgba(13,15,17,.66);padding:18px}
.gmao-v300 .dashboard-modal-dialog{width:min(690px,calc(100vw - 36px));max-height:calc(100vh - 36px);overflow-y:auto;overflow-x:hidden;border-radius:15px;padding:22px;box-sizing:border-box}
.gmao-v300 .dashboard-modal-dialog.modal-wide{width:min(860px,calc(100vw - 36px))}
.gmao-v300 .modal-table-wrap{overflow-x:hidden;overflow-y:auto;max-height:58vh;border-radius:9px}
.gmao-v300 .modal-table{width:100%;min-width:0;table-layout:fixed;font-size:10.5px}
.gmao-v300 .modal-table th{padding:9px 10px;font-size:8px;white-space:normal}
.gmao-v300 .modal-table td{padding:10px;white-space:normal;overflow-wrap:anywhere;vertical-align:top}
.gmao-v300 .modal-table td:last-child,.gmao-v300 .modal-table th:last-child{white-space:nowrap}
.billing-client{width:42%}.billing-company{width:38%}.billing-amount{width:20%}
.budget-number{width:18%}.budget-client{width:39%}.budget-status{width:23%}.budget-amount{width:20%}
.dev-rank{width:5%}.dev-budget{width:17%}.dev-client{width:35%}.dev-hours{width:13%}.dev-percent{width:17%}
.gmao-v300 .modal-close{background:#f0f2f3;color:#202529}
.gmao-v300 .modal-close:hover{background:#23282c;color:#fff}

@media(max-width:1100px){
  .gmao-v300 .dashboard-card{padding-left:82px}
  .gmao-v300 .dashboard-card-icon{left:17px}
  .dashboard-inline-table th,.dashboard-inline-table td{padding-left:10px;padding-right:10px}
}
@media(max-width:860px){
  .gmao-v300 .app-logo-zone{background:var(--v301-black)}
  .gmao-v300 .dashboard-grid,.gmao-v300 .dashboard-lower.dashboard-tables{grid-template-columns:1fr}
  .control-heading{align-items:flex-start}
}
@media(max-width:560px){
  .gmao-v300 .dashboard-card{padding:78px 16px 16px;min-height:255px}
  .gmao-v300 .dashboard-card-icon{left:50%;top:16px;transform:translateX(-50%)}
  .gmao-v300 .modal-table{font-size:9.5px}
  .gmao-v300 .modal-table th,.gmao-v300 .modal-table td{padding:8px 6px}
  .billing-company{display:none}
  .billing-client{width:72%}.billing-amount{width:28%}
  .billing-table th:nth-child(2),.billing-table td:nth-child(2){display:none}
}


/* V3.03 - Seguimiento de facturación mensual: pendiente, albaranado y facturado */
.gmao-v300 .card-billing{padding-bottom:16px}
.gmao-v300 .card-billing>strong{margin-top:8px}
.billing-status-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;width:100%;margin:14px 0 2px}
.billing-status-summary span{display:flex;min-width:0;flex-direction:column;align-items:center;padding:8px 5px;border-radius:9px;border:1px solid #e2e5e7;background:#f7f8f8}
.billing-status-summary b{font-size:12px;line-height:1.2;color:#252a2e;white-space:nowrap}
.billing-status-summary em{margin-top:3px;font-size:8px;font-style:normal;font-weight:800;text-transform:uppercase;letter-spacing:.35px;color:#6d767e}
.billing-status-summary .status-delivery{background:#fff8df;border-color:#f3d879}
.billing-status-summary .status-invoiced{background:#e8f7ed;border-color:#a9d8b7}
.billing-modal-totals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 12px}
.billing-total{padding:11px 12px;border:1px solid #e1e5e7;border-radius:10px;background:#f6f7f8;min-width:0}
.billing-total span{display:block;font-size:8px;font-weight:900;letter-spacing:.55px;text-transform:uppercase;color:#69737c}
.billing-total strong{display:block;margin-top:5px;font-size:16px;white-space:nowrap;color:#202529}
.billing-total.delivery{background:#fff7d6;border-color:#efd36a}
.billing-total.invoiced{background:#e4f6ea;border-color:#9ed0ad}
.billing-total.planned{background:#f0f2f3}
.billing-modal-help{margin:0 0 12px;font-size:10px;color:#616b73}
.billing-followup-wrap{max-height:55vh!important}
.billing-followup-table .billing-client{width:36%}
.billing-followup-table .billing-company{width:27%}
.billing-followup-table .billing-amount{width:16%}
.billing-followup-table .billing-check{width:10.5%}
.gmao-v300 .billing-followup-table th:nth-last-child(-n+2),.gmao-v300 .billing-followup-table td:nth-last-child(-n+2){text-align:center}
.gmao-v300 .billing-followup-table td:nth-child(3),.gmao-v300 .billing-followup-table th:nth-child(3){text-align:right;white-space:nowrap}
.billing-row{transition:background-color .18s ease,opacity .18s ease}
.billing-row.is-delivery td{background:#fff4bf}
.billing-row.is-invoiced td{background:#dff3e5}
.billing-row.is-saving{opacity:.62}
.billing-check-cell{text-align:center!important;vertical-align:middle!important}
.billing-check{width:18px;height:18px;accent-color:#ef6f00;cursor:pointer}
.billing-row.is-invoiced .billing-invoiced-check{accent-color:#24854a}
.billing-save-status{min-height:18px;padding-top:8px;text-align:right;font-size:10px;font-weight:800}
.billing-save-status.is-saving{color:#8a6500}.billing-save-status.is-saved{color:#218044}.billing-save-status.is-error{color:#b42318}
@media(max-width:700px){.billing-modal-totals{grid-template-columns:repeat(2,minmax(0,1fr))}.billing-status-summary b{font-size:10px}.billing-followup-table .billing-company{display:none}.billing-followup-table th:nth-child(2),.billing-followup-table td:nth-child(2){display:none}.billing-followup-table .billing-client{width:48%}.billing-followup-table .billing-amount{width:24%}.billing-followup-table .billing-check{width:14%}}


/* ===== V3.04 · SELECTOR COMPACTO DE ESPECIALIDADES ===== */
.compact-specialties-section { padding-bottom: 18px !important; }
.specialties-section-header { margin-bottom: 14px !important; }
.specialties-toolbar { display:grid; grid-template-columns:minmax(240px,1fr) auto auto; gap:12px; align-items:center; margin-bottom:12px; }
.specialties-search-wrap { position:relative; }
.specialties-search-wrap input { width:100%; padding-left:38px !important; min-height:40px !important; }
.specialties-search-icon { position:absolute; left:14px; top:50%; transform:translateY(-50%); font-size:20px; color:#64748b; pointer-events:none; }
.specialties-selection-summary { min-width:120px; text-align:center; color:#475569; font-size:12px; font-weight:800; white-space:nowrap; }
.specialties-selection-summary strong { color:#f97316; font-size:18px; margin-right:4px; }
.specialty-add-toggle { min-height:40px; white-space:nowrap; }
.specialty-creator { margin:0 0 14px; padding:14px; border:1px solid #fed7aa; border-radius:14px; background:#fffaf5; }
.specialty-creator-grid { display:grid; grid-template-columns:1.2fr 1fr 1fr auto; gap:12px; align-items:end; }
.specialty-creator-grid .field { margin:0; }
.specialty-creator-actions { display:flex; gap:8px; align-items:center; padding-bottom:1px; }
.specialty-creator-help { margin:8px 0 0; color:#64748b; font-size:11px; font-weight:700; }
.specialty-creator-help.success { color:#15803d; }
.specialty-creator-help.error { color:#b91c1c; }
.compact-specialties { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.specialty-category { border:1px solid #dbe3ee; border-radius:13px; background:#fff; overflow:hidden; min-width:0; }
.specialty-category[hidden] { display:none; }
.specialty-category summary { list-style:none; cursor:pointer; display:flex; justify-content:space-between; align-items:center; gap:8px; min-height:44px; padding:10px 12px; color:#102a55; font-size:12px; font-weight:950; user-select:none; }
.specialty-category summary::-webkit-details-marker { display:none; }
.specialty-category summary::before { content:'›'; color:#f97316; font-size:20px; line-height:1; transition:transform .16s ease; }
.specialty-category[open] summary::before { transform:rotate(90deg); }
.specialty-category.has-selection { border-color:#fdba74; box-shadow:0 0 0 1px rgba(249,115,22,.08); }
.specialty-category-meta { margin-left:auto; color:#64748b; font-size:10px; background:#f1f5f9; border-radius:999px; padding:4px 7px; }
.specialty-category-meta b { color:#f97316; }
.specialty-chip-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:0 10px 10px; border-top:1px solid #eef2f7; }
.specialty-chip { display:flex; align-items:center; gap:7px; min-width:0; padding:7px 8px; margin-top:7px; border:1px solid #e2e8f0; border-radius:9px; background:#f8fafc; cursor:pointer; font-size:10px; font-weight:800; color:#334155; transition:.15s ease; }
.specialty-chip:hover { border-color:#fdba74; background:#fff7ed; }
.specialty-chip:has(input:checked) { border-color:#fb923c; background:#fff7ed; color:#9a3412; }
.specialty-chip input { width:15px !important; height:15px !important; min-height:0 !important; margin:0; flex:0 0 auto; accent-color:#f97316; }
.specialty-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.specialty-chip[hidden] { display:none; }
@media (max-width:1300px) { .compact-specialties { grid-template-columns:repeat(2,minmax(0,1fr)); } .specialty-creator-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:760px) { .specialties-toolbar { grid-template-columns:1fr; } .specialties-selection-summary { text-align:left; } .compact-specialties { grid-template-columns:1fr; } .specialty-chip-grid { grid-template-columns:1fr; } .specialty-creator-grid { grid-template-columns:1fr; } .specialty-creator-actions { flex-direction:column; align-items:stretch; } }

/* V3.05 - Plantilla de empleados compacta y estado de vacaciones */
.control-employees-list-card .articulos-table-wrap {
    overflow-x: auto;
}

.empleados-horas-table {
    min-width: 1040px;
    table-layout: fixed;
}

.empleados-horas-table th,
.empleados-horas-table td {
    padding: 4px 6px !important;
    line-height: 1.1;
}

.empleados-horas-table thead th {
    font-size: 9px;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
}

.empleados-horas-table input,
.empleados-horas-table select {
    min-height: 28px !important;
    height: 28px;
    padding: 3px 7px !important;
    font-size: 10px !important;
    border-radius: 6px;
}

.empleados-horas-table .col-nombre { width: 34%; }
.empleados-horas-table .col-movil { width: 12%; }
.empleados-horas-table .col-delegacion { width: 10%; }
.empleados-horas-table .col-jornada { width: 8%; }
.empleados-horas-table .col-baja { width: 13%; }
.empleados-horas-table .col-whatsapp { width: 6%; }
.empleados-horas-table .col-motivo-baja { width: 9%; }
.empleados-horas-table .col-acciones { width: 8%; min-width: 142px; }

.empleados-actions,
.control-panel .empleados-actions.compact-actions-cell {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 142px;
    white-space: nowrap;
}

.empleados-actions form {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
}

.control-panel .empleados-actions.compact-actions-cell .btn,
.empleados-actions .btn {
    width: auto !important;
    min-width: 62px !important;
    height: 25px;
    padding: 3px 7px !important;
    font-size: 8px !important;
    line-height: 1;
    justify-content: center;
}

.empleados-horas-table tbody tr.empleado-en-vacaciones > td {
    background: #fff6c7 !important;
    border-color: #f3d66b !important;
}

.empleados-horas-table tbody tr.empleado-en-vacaciones:hover > td {
    background: #ffefaa !important;
}

.empleados-horas-table tbody tr.empleado-en-vacaciones input,
.empleados-horas-table tbody tr.empleado-en-vacaciones select {
    background: rgba(255, 255, 255, 0.72);
    border-color: #e8c94f;
}

.empleados-horas-table tbody tr.empleado-de-baja > td {
    background: #f6f7f9;
    opacity: .82;
}

@media (max-width: 1250px) {
    .empleados-horas-table { min-width: 980px; }
    .empleados-horas-table .col-nombre { width: 30%; }
    .empleados-horas-table .col-motivo-baja { width: 11%; }
}


/* V3.06 - Control horario inteligente por vacaciones y bajas */
.badge-vacaciones{background:#fef3c7;color:#92400e;border:1px solid #f59e0b}
.horas-dia-table tbody tr.hora-row-vacaciones>td{background:#fff7cc!important;color:#6b4f00}
.horas-dia-table tbody tr.hora-row-baja>td{background:#f8e4e4!important;color:#7f1d1d}
.horas-dia-table tbody tr.hora-row-correcto>td{background:#edf9f0}
.horas-dia-table tbody tr.hora-row-deficit>td{background:#fff0dc}
.horas-dia-table tbody tr.hora-row-exceso>td{background:#eaf3ff}
.horas-dia-table tbody tr.hora-row-sin-declarar>td{background:#f2f4f7}
.empleados-horas-table .col-periodo{width:8%}
.empleados-horas-table input[type="date"]{min-width:112px;font-size:11px;padding-left:5px;padding-right:3px}
@media (max-width:1400px){.empleados-horas-table{min-width:1260px}}

/* ===== GMAO ROPA V3 - tablas compactas sin scroll horizontal ===== */
.table-wrapper{overflow-x:visible!important}
table,table.admin-table{min-width:0!important;width:100%!important;table-layout:auto}
table td:first-child,table th:first-child,table td:nth-child(n),table th:nth-child(n){min-width:0!important;max-width:none!important}
th,td{padding:7px 6px!important;font-size:12px!important;white-space:normal!important;overflow-wrap:anywhere}
th{font-size:10px!important}.compact-table input,.compact-table select{padding:6px 7px;font-size:12px;min-width:0}.compact-table .action-btn{font-size:11px}.inline{display:inline}.inline-edit{display:contents}.mini{padding:6px 9px!important;font-size:11px!important}.delete-delivery{display:flex;gap:5px;align-items:center;max-width:250px}.delete-delivery input{padding:5px 6px;font-size:11px}.wrap-cell{white-space:normal!important}.stock-adjust-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.stock-adjust-card{border:1px solid var(--border);border-radius:12px;padding:12px;display:grid;gap:8px;background:#fafafa}.stock-adjust-card strong{font-size:18px}.stock-adjust-card label{font-size:12px;color:var(--muted)}
@media(max-width:1100px){th,td{font-size:11px!important;padding:6px 4px!important}.app-content{padding-left:14px!important;padding-right:14px!important}}

/* ===== GMAO ROPA V3.3 - acceso seguro ===== */
.login-page{min-height:100vh;margin:0;display:grid;place-items:center;background:#eef1f5;padding:20px;box-sizing:border-box;font-family:Arial,sans-serif}.login-card{width:min(420px,100%);background:#fff;border:1px solid #dfe4ea;border-radius:18px;padding:34px;box-shadow:0 18px 50px rgba(20,30,45,.12)}.login-brand{font-weight:900;font-size:24px;letter-spacing:1px;color:#202b3c}.login-kicker{font-size:11px;font-weight:800;letter-spacing:1.8px;color:#7b8794;margin:7px 0 24px}.login-card h1{margin:0 0 8px;font-size:27px}.login-help{color:#667085;margin:0 0 22px}.login-form{display:grid;gap:16px}.login-form label{display:grid;gap:7px;font-weight:700;font-size:13px}.login-form input{width:100%;box-sizing:border-box;padding:12px 13px;border:1px solid #cfd5dd;border-radius:9px;font-size:15px}.login-form .btn{width:100%;padding:12px;border:0;border-radius:9px;background:#202b3c;color:#fff;font-weight:800;cursor:pointer}.app-session{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.logout-form{margin:0}.logout-btn{border:1px solid #d0d5dd;background:#fff;border-radius:8px;padding:7px 10px;font-size:11px;font-weight:700;cursor:pointer}

/* ===== GMAO ROPA V3.4 - usuarios, cabecera y sesión ===== */
.app-logo-zone{display:flex!important;align-items:center!important;gap:14px!important;padding:12px 18px!important;overflow:hidden}.club-header-logo{width:62px;height:78px;object-fit:contain;display:block;flex:0 0 auto}.brand-stack{min-width:0}.brand-stack small{display:block;color:#cbd5e1;font-size:9px;font-weight:800;letter-spacing:2.4px;margin-top:4px}.logout-btn{background:#f58216!important;color:#fff!important;border:1px solid #f58216!important;min-width:112px!important;padding:9px 13px!important;opacity:1!important;visibility:visible!important}.logout-btn:hover{background:#d96d09!important;color:#fff!important}.page-actions{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}.page-actions h2{margin:0 0 4px}.user-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.user-actions form{margin:0}.role-badge{display:inline-block;border-radius:999px;padding:5px 9px;font-size:10px;font-weight:800}.role-admin{background:#fff0db;color:#9a4c00}.role-material{background:#e8f1ff;color:#174ea6}.role-consulta{background:#eef1f5;color:#475467}.permissions-help{margin-top:14px;padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:#fff;font-size:12px}.user-form-card{max-width:850px}.user-form-card label{display:grid;gap:7px;font-weight:700}.user-form-card input,.user-form-card select,.password-row input{padding:10px 12px;border:1px solid #cfd5dd;border-radius:8px;font-size:14px}.form-actions{grid-column:1/-1;display:flex;gap:10px;align-items:center}.password-card{max-width:850px;margin-top:16px}.password-row{display:flex;gap:10px}.password-row input{flex:1}.action-btn.danger{color:#b42318;border-color:#f0b4ae}@media(max-width:800px){.club-header-logo{width:48px;height:60px}.brand-stack .ropa-logo{font-size:15px}.password-row,.page-actions{align-items:stretch;flex-direction:column}}
