:root {
    --bg: #eef2f7;
    --panel: #ffffff;
    --line: #cfd8e3;
    --text: #0f172a;
    --muted: #52627a;
    --blue: #2563eb;
    --green: #198754;
    --red: #dc3545;
    --amber: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
}

body.app-modal-open {
    overflow: hidden;
}

.app-modal-overlay {
    align-items: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 18px;
    position: fixed;
    transition: opacity 0.14s ease;
    z-index: 9999;
}

.app-modal-overlay.is-visible {
    opacity: 1;
}

.app-modal {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #cfe0ff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
    display: grid;
    gap: 18px;
    grid-template-columns: auto minmax(0, 1fr);
    max-width: 560px;
    padding: 24px;
    transform: translateY(10px) scale(0.98);
    transition: transform 0.14s ease;
    width: min(100%, 560px);
}

.app-modal-overlay.is-visible .app-modal {
    transform: translateY(0) scale(1);
}

.app-modal-icon {
    align-items: center;
    background: #eaf2ff;
    border: 1px solid #bdd4ff;
    border-radius: 12px;
    color: #2563eb;
    display: inline-flex;
    font-size: 16px;
    font-weight: 900;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.app-modal-body {
    min-width: 0;
}

.app-modal-kicker {
    color: #475569;
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.app-modal h3 {
    color: #0f172a;
    font-size: 24px;
    line-height: 1.1;
    margin: 0 0 10px;
}

.app-modal p {
    color: #334155;
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 18px;
}

.app-modal-field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.app-modal-field span {
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
}

.app-modal-field input {
    border: 2px solid #93b4ff;
    border-radius: 10px;
    color: #0f172a;
    font-size: 15px;
    min-height: 42px;
    outline: 0;
    padding: 8px 11px;
    width: 100%;
}

.app-modal-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.app-modal-choices {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    margin: 0 0 18px;
    max-height: 280px;
    overflow: auto;
    padding-right: 2px;
    scrollbar-width: thin;
}

.app-modal-choice {
    background: linear-gradient(180deg, #ffffff, #f5f8ff);
    border: 1px solid #cfe0ff;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
    color: #0f172a;
    cursor: pointer;
    min-height: 54px;
    padding: 10px 12px;
    text-align: left;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.app-modal-choice:hover {
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.app-modal-choice strong,
.app-modal-choice small {
    display: block;
}

.app-modal-choice strong {
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 900;
}

.app-modal-choice small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.25;
    margin-top: 2px;
}

.app-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.app-modal-btn {
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    min-height: 42px;
    padding: 0 18px;
}

.app-modal-btn-primary {
    background: #12875a;
}

.app-modal-btn-muted {
    background: #2563eb;
}

.app-modal-btn:hover {
    filter: brightness(0.96);
}

@media (max-width: 560px) {
    .app-modal {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .app-modal-actions {
        justify-content: stretch;
    }

    .app-modal-btn {
        flex: 1;
    }
}

.site-navbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 0;
    border-bottom: 1px solid #d8e0ea;
    border-radius: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 0 0 24px;
    max-width: none;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-brand {
    align-items: center;
    color: #1e293b;
    display: inline-flex;
    font-size: 15px;
    font-weight: 800;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.site-brand::before {
    background: #2563eb;
    border-radius: 9px;
    box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.18);
    content: "";
    display: inline-block;
    height: 28px;
    width: 28px;
}

.site-navlinks {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.site-navlink {
    border-radius: 8px;
    color: #52627a;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 11px;
    text-decoration: none;
}

.site-navlink:hover,
.site-navlink.active {
    background: #e8f0ff;
    color: #2563eb;
}

.dashboard-shell {
    margin: 0 auto;
    max-width: 1320px;
    padding: 0 18px 28px;
}

.install-shell {
    margin: 0 auto;
    max-width: 960px;
    padding: 0 18px 28px;
}

.app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: #1f2937;
    color: #fff;
    padding: 22px 18px;
}

.brand {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 28px;
}

.nav-link {
    border-radius: 6px;
    color: #dbeafe;
    display: block;
    margin-bottom: 8px;
    padding: 10px 12px;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    background: #334155;
    color: #fff;
}

.main {
    padding: 0;
}

.topbar,
.dashboard-hero {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.dashboard-hero {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--text);
    overflow: visible;
    padding: 2px 0 0;
    position: relative;
}

.dashboard-hero::after {
    content: none;
}

.hero-copy,
.hero-visual,
.dashboard-hero .btn {
    position: relative;
    z-index: 1;
}

.hero-kicker {
    color: #2563eb;
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.dashboard-hero h1,
.dashboard-hero .muted {
    color: var(--text);
}

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

.hero-visual {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.hero-badge {
    align-items: center;
    background: #e8f0ff;
    border: 1px solid #d8e7ff;
    border-radius: 12px;
    color: #2563eb;
    display: inline-flex;
    font-weight: 900;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.hero-line {
    background: linear-gradient(90deg, #2563eb, #2dd4bf);
    border-radius: 999px;
    display: block;
    height: 5px;
    width: 70px;
}

.hero-dot {
    background: #2dd4bf;
    box-shadow: 0 0 0 8px rgba(45, 212, 191, 0.18);
    display: block;
    height: 10px;
    width: 10px;
}

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

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

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

.card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    padding: 16px;
}

.metric-card {
    align-items: center;
    color: inherit;
    display: flex;
    gap: 12px;
    min-height: 116px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.metric-card::before {
    background: var(--metric-accent, #2563eb);
    content: "";
    height: 3px;
    inset: 0 0 auto;
    opacity: 0.9;
    position: absolute;
    width: auto;
}

.metric-card:hover,
.metric-card.active {
    border-color: #b8c8ff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.10);
    transform: translateY(-1px);
}

.metric-card.active::after {
    background: var(--metric-accent, #2563eb);
    border-radius: 999px;
    content: "";
    height: 6px;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 6px;
}

.metric-blue { --metric-accent: #2563eb; --metric-soft: #dbeafe; }
.metric-green { --metric-accent: #198754; --metric-soft: #d1e7dd; }
.metric-amber { --metric-accent: #f59e0b; --metric-soft: #fff3cd; }
.metric-purple { --metric-accent: #7c3aed; --metric-soft: #ede9fe; }

.metric-icon {
    align-items: center;
    background: var(--metric-soft, #dbeafe);
    border-radius: 10px;
    color: var(--metric-accent, #2563eb);
    display: inline-flex;
    flex: 0 0 40px;
    height: 40px;
    justify-content: center;
    margin-left: 4px;
    position: relative;
    width: 40px;
}

.metric-icon svg,
.section-icon svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 22px;
}

.metric {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    text-transform: uppercase;
}

.metric-value {
    color: #0f172a;
    font-size: 28px;
    font-weight: 800;
    margin-top: 6px;
}

.active-line-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.active-line-tags span {
    align-items: center;
    background: #ede9fe;
    border: 1px solid #c4b5fd;
    border-radius: 7px;
    color: #5b21b6;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    min-width: 34px;
    padding: 0 8px;
}

.section-heading {
    align-items: center;
    display: flex;
    gap: 12px;
}

.section-heading h2 {
    font-size: 20px;
    margin: 0;
}

.section-icon {
    align-items: center;
    background: #dbeafe;
    border-radius: 9px;
    color: #2563eb;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.6fr);
    margin-bottom: 16px;
    padding: 16px;
}

.filter-heading {
    align-items: center;
    display: flex;
}

.filter-kicker {
    color: #2563eb;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.filter-heading h2 {
    font-size: 20px;
    margin: 0;
}

.filter-heading p {
    color: var(--muted);
    margin: 4px 0 0;
}

.filter-form {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr) minmax(90px, 0.45fr) auto;
}

.filter-field {
    margin: 0;
}

.filter-field span {
    color: #334155;
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.filter-field input {
    background: #ffffff;
    border-color: #cbd5e1;
    border-radius: 8px;
    min-height: 38px;
}

.filter-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: 0;
}

.filter-actions {
    display: flex;
    gap: 8px;
}

input,
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    padding: 9px 10px;
    width: 100%;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.field-span-2 {
    grid-column: span 2;
}

.field-span-4 {
    grid-column: span 4;
}

label {
    color: #334155;
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
}

.section-title {
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    grid-column: span 4;
    margin: 8px 0 0;
    padding-bottom: 8px;
}

.btn {
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    gap: 6px;
    padding: 10px 14px;
    text-decoration: none;
}

.btn-primary { background: #2563eb; }
.btn-success { background: var(--green); }
.btn-danger { background: var(--red); }
.btn-muted { background: #52627a; }

.btn-sm {
    font-size: 12px;
    padding: 7px 9px;
}

.table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.table-actions form {
    margin: 0;
}

.icon-action {
    align-items: center;
    border: 0;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    width: 34px;
}

.icon-action svg {
    fill: none;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 17px;
}

.icon-action-pdf { background: #64748b; }
.icon-action-history { background: #7c3aed; }
.icon-action-edit { background: var(--blue); }
.icon-action-delete { background: var(--red); }
.icon-action-restore { background: var(--green); }

.icon-action:hover {
    filter: brightness(0.92);
}

.table {
    border-collapse: collapse;
    width: 100%;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.table th {
    background: #eef2f7;
    font-size: 12px;
    text-transform: uppercase;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
}

.badge-ok { background: #d1e7dd; color: #0f5132; }
.badge-warn { background: #fff3cd; color: #664d03; }
.badge-stop { background: #f8d7da; color: #842029; }

.alert {
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 12px;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
}

.alert-error {
    background: #f8d7da;
    color: #842029;
}

.role-page-shell {
    margin: 0 auto;
    max-width: 1500px;
    padding: 0 18px 30px;
}

.role-personal-sheet {
    background: #9bbb59;
    border: 1px solid #5d742d;
    border-radius: 4px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    color: #00183d;
    overflow-x: auto;
    padding: 28px 30px 34px;
}

.role-editor-toolbar {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(220px, 1fr) auto;
    margin: 0 0 14px;
    padding: 14px 16px;
    position: sticky;
    top: 60px;
    z-index: 18;
}

.role-editor-toolbar h1 {
    font-size: 22px;
    margin: 0;
}

.role-editor-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.role-save-status {
    color: #52627a;
    font-size: 12px;
    font-weight: 800;
    min-width: 78px;
}

.role-save-status.is-saving {
    color: #2563eb;
}

.role-save-status.is-ok {
    color: #0f8f3a;
}

.role-save-status.is-error {
    color: #dc2626;
}

.btn-with-icon {
    align-items: center;
    display: inline-flex;
}

.btn-with-icon svg {
    fill: none;
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 16px;
}

.role-toolbar-group {
    align-items: center;
    border-left: 1px solid #d8e0ea;
    display: inline-flex;
    gap: 6px;
    margin-left: 4px;
    padding-left: 10px;
}

.role-color-btn {
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 36px;
    justify-content: center;
    width: 38px;
}

.role-color-yellow {
    background: #fff200;
}

.role-color-orange {
    background: #ffc000;
}

.role-color-gold {
    background: #ffb000;
}

.role-color-cell-green {
    background: #9bbb59;
}

.role-color-turquoise {
    background: #00aeea;
}

.role-text-black {
    background: #111827;
    color: #ffffff;
}

.role-text-red {
    background: #fee2e2;
    color: #e00000;
}

.role-text-green {
    background: #dcfce7;
    color: #0f8f3a;
}

.role-text-turquoise {
    background: #e0f2fe;
    color: #0b78b6;
}

.role-color-clear {
    background: #ffffff;
    color: #111827;
}

.role-personal-title {
    background: #8fb5e1;
    border: 2px solid #1f3b63;
    margin-bottom: 28px;
    padding: 6px 18px;
    text-align: center;
}

.role-personal-title div {
    align-items: baseline;
    display: flex;
    gap: 56px;
    justify-content: center;
}

.role-personal-title span {
    font-size: 24px;
    font-style: italic;
    font-weight: 900;
}

.role-personal-title strong {
    color: #e00000;
    font-size: 25px;
    font-style: italic;
    letter-spacing: 0;
}

.role-personal-title h1 {
    color: #06275d;
    font-size: 48px;
    font-style: italic;
    line-height: 1;
    margin: 4px 0 0;
}

.role-personal-grid {
    align-items: start;
    display: grid;
    gap: 26px 54px;
    grid-template-columns: repeat(2, minmax(560px, 1fr));
}

.role-team-card {
    display: grid;
    grid-template-columns: 164px minmax(0, 1fr);
}

.role-team-card.selected {
    outline: 3px solid rgba(37, 99, 235, 0.38);
    outline-offset: 3px;
}

.role-team-label {
    align-items: center;
    background: #8fb5e1;
    border: 1px solid #111827;
    color: #0b1020;
    display: flex;
    flex-direction: column;
    font-size: 20px;
    font-weight: 900;
    justify-content: center;
    min-height: 100%;
    padding: 12px;
    text-align: center;
}

.role-team-label span {
    margin-top: 8px;
}

.role-turno-label {
    background: #b7dbe5;
}

.role-team-table {
    min-width: 0;
}

.role-dropzone {
    background: #ffffff;
    border-top: 1px solid #111827;
    min-height: 34px;
}

.role-dropzone.drag-over {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: -3px;
}

.role-person-row {
    background: #ffffff;
    border-bottom: 1px solid #222;
    border-right: 1px solid #111827;
    cursor: grab;
    display: grid;
    font-size: 18px;
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 28px;
    touch-action: manipulation;
}

.role-person-row.selected {
    box-shadow: inset 0 0 0 3px #2563eb, 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.role-person-row.dragging {
    opacity: 0.45;
}

.role-person-code,
.role-person-name {
    align-items: center;
    display: flex;
    min-width: 0;
    padding: 2px 6px;
}

.role-person-code {
    border-left: 1px solid #111827;
    border-right: 1px solid #222;
    font-weight: 700;
    justify-content: center;
}

.role-person-name {
    color: #0b1020;
    overflow: hidden;
    white-space: nowrap;
}

.role-person-row.lead .role-person-code,
.role-person-row.lead .role-person-name {
    color: #0b78b6;
    font-style: italic;
    font-weight: 900;
}

.role-person-row.bold .role-person-code,
.role-person-row.bold .role-person-name,
.role-person-row.manual-bold .role-person-code,
.role-person-row.manual-bold .role-person-name {
    font-weight: 900;
}

.role-person-row.mark {
    background: #fff200;
}

.role-person-row.warn {
    background: #ffc000;
}

.role-redoble {
    background: #00aeea;
    border: 1px solid #111827;
    border-top: 0;
    color: #0b1020;
    font-size: 18px;
    min-height: 28px;
    padding: 3px 8px;
}

.role-note-row {
    background: #00aeea;
    cursor: text;
}

.role-redoble.selected,
.role-note-row.selected {
    box-shadow: inset 0 0 0 3px #2563eb;
}

.role-team-count {
    background: #8fb5e1;
    border: 1px solid #111827;
    border-top: 0;
    font-size: 20px;
    font-style: italic;
    min-height: 28px;
    text-align: center;
}

.role-team-small,
.role-summary-card {
    grid-column: span 1;
}

.role-extra-card {
    margin-top: 0;
}

.role-summary-card {
    background: #ffffff;
    border: 1px solid #111827;
    display: grid;
}

.role-summary-card div {
    align-items: center;
    border-bottom: 1px solid #222;
    display: grid;
    font-size: 19px;
    grid-template-columns: 1fr 120px;
    min-height: 28px;
    text-align: center;
}

.role-summary-card div:last-child {
    border-bottom: 0;
}

.role-summary-card span {
    padding: 2px 8px;
}

.role-summary-card strong {
    border-left: 1px solid #222;
    font-weight: 500;
    padding: 2px 8px;
}

.role-summary-card .total {
    background: #062b69;
    color: #ffffff;
}

.role-summary-card div:first-child span {
    color: #e00000;
}

.role-placeholder {
    margin: 0 auto;
    max-width: 980px;
}

.role-placeholder h1 {
    margin: 0 0 6px;
}

.role-placeholder-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    margin-top: 18px;
}

.role-placeholder-grid span {
    color: #334155;
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
}

.puestos-shell {
    max-width: 1900px;
    min-width: 0;
    width: 100%;
}

.puestos-layout {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: 260px minmax(0, 1fr);
}

.puestos-list-panel,
.puestos-editor-panel,
.puestos-personal-panel {
    min-width: 0;
}

.puestos-editor-panel {
    min-width: 910px;
    width: 100%;
}

.puestos-role-list,
.puestos-personal-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.puestos-role-card {
    background: #f8fafc;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    color: #06172e;
    cursor: pointer;
    display: grid;
    gap: 4px;
    padding: 12px;
    text-align: left;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.puestos-role-card:hover,
.puestos-role-card.active {
    border-color: #2563eb;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.puestos-role-card strong {
    font-size: 14px;
}

.puestos-role-card span,
.puestos-role-card small {
    color: #52627a;
    font-size: 12px;
}

.puestos-form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 14px 0;
}

.puestos-form-grid span {
    color: #334155;
    display: block;
    font-size: 11px;
    font-weight: 900;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.puestos-table-wrap {
    overflow-x: auto;
}

.puestos-table {
    border-collapse: collapse;
    color: #0b1020;
    min-width: 910px;
    table-layout: fixed;
    text-align: center;
    width: 100%;
}

.puestos-col-linea {
    width: 16.2%;
}

.puestos-col-rompedora {
    width: 21.4%;
}

.puestos-col-integrado {
    width: 42.8%;
}

.puestos-col-prensa {
    width: 19.6%;
}

.puestos-table th,
.puestos-table td {
    border: 2px solid #333333;
    height: 50px;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.puestos-table thead th {
    background: #d9ead3;
    font-size: 26px;
    font-weight: 900;
}

.puestos-table thead tr:first-child th {
    background: #d9ead3;
    font-size: 24px;
    height: 42px;
    letter-spacing: 0;
}

.puestos-table thead tr:not(:first-child) th:first-child {
    background: #fff200;
    color: #111827;
    font-size: 22px;
    line-height: 1;
    overflow-wrap: anywhere;
}

.puestos-table tbody th {
    background: #f4f4f5;
    color: #111827;
    font-size: 24px;
    font-weight: 900;
}

.puestos-linea-label {
    cursor: text;
    outline: 0;
}

.puestos-linea-label:focus {
    background: #fff8d6;
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.puestos-table tbody tr.puestos-linea-parada th,
.puestos-table tbody tr.puestos-linea-parada td:not(.puestos-prensa-merged),
.puestos-prensa-parada {
    background: #d9d9d9;
}

.puestos-table tbody tr.puestos-linea-parada td:not(.puestos-prensa-merged) input {
    color: #dc2626;
    font-weight: 900;
}

.puestos-table tbody tr.puestos-row-selected th,
.puestos-table tbody tr.puestos-row-selected td {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.puestos-parada-cell input {
    letter-spacing: 0;
    text-align: center;
}

.puestos-table input {
    background: transparent;
    border: 0;
    color: #0b1020;
    font-size: 22px;
    font-weight: 900;
    height: 100%;
    outline: 0;
    line-height: 1.05;
    padding: 5px;
    text-align: center;
    text-transform: uppercase;
    width: 100%;
}

.puestos-integrado-split {
    background: #ffffff;
    padding: 0;
}

.puestos-integrado-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    min-height: 50px;
    width: 100%;
}

.puestos-split-field {
    display: grid;
    grid-template-rows: minmax(50px, 1fr);
    height: 100%;
    min-height: 50px;
    position: relative;
    width: 100%;
}

.puestos-split-field + .puestos-split-field {
    border-left: 2px solid #333333;
}

.puestos-split-field span {
    display: none;
}

.puestos-table tr[data-row-id="L2"] .puestos-split-field span {
    background: transparent;
}

.puestos-split-field input {
    color: #0b1020;
    font-size: 22px;
    letter-spacing: 0;
    line-height: 1.05;
    padding: 5px;
    white-space: normal;
    word-break: break-word;
}

.puestos-split-field input.puestos-redoble-input {
    font-size: 22px;
    padding-inline: 5px;
}

.puestos-redoble-input {
    color: #ff0000 !important;
    padding-bottom: 0 !important;
    padding-top: 18px !important;
}

.puestos-redoble-cell::before {
    color: #ff0000;
    content: "REDOBLE";
    font-size: 22px;
    font-weight: 900;
    left: 0;
    letter-spacing: 0;
    line-height: 1;
    position: absolute;
    right: 0;
    text-align: center;
    top: 2px;
    z-index: 2;
}

.puestos-split-field input::-webkit-calendar-picker-indicator {
    display: none !important;
}

.puestos-prensa-merged {
    vertical-align: middle;
}

.puestos-prensa-merged.puestos-redoble-cell::before {
    top: calc(50% - 24px);
}

.puestos-prensa-merged .puestos-redoble-input {
    height: 34px;
    left: 0;
    max-height: 34px;
    min-height: 34px !important;
    padding: 0 5px !important;
    position: absolute;
    right: 0;
    top: calc(50% - 2px);
    transform: none;
}

.puestos-prensa-merged input {
    min-height: 82px;
}

.puestos-prensa-merged[rowspan="4"] input {
    min-height: 164px;
}

.puestos-extra-row th {
    background: #e0f2fe;
}

.puestos-personal-list {
    max-height: 560px;
    overflow: auto;
}

.puestos-personal-list span {
    background: #f8fafc;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
}

.puestos-jefes-box {
    border-top: 1px solid #d8e0ea;
    margin-top: 16px;
    padding-top: 14px;
}

.puestos-status {
    color: #52627a;
    font-size: 13px;
    font-weight: 800;
    margin-top: 12px;
    min-height: 18px;
}

.puestos-status.ok {
    color: #0f8f3a;
}

.puestos-status.error {
    color: #dc2626;
}

.puestos-status.saving {
    color: #2563eb;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lineas-panel {
    background: #ffffff;
    margin-bottom: 18px;
}

.linea-groups {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.linea-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.linea-card-header {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 12px 14px;
    position: relative;
}

.linea-card-header::before {
    background: linear-gradient(180deg, #2563eb, #34d399);
    border-radius: 999px;
    content: "";
    height: 34px;
    left: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
}

.linea-card-header h3 {
    font-size: 16px;
    margin: 0;
    min-width: 0;
}

.linea-registros {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.linea-registros-scroll {
    max-height: 318px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-color: #94a3b8 #eef2f7;
    scrollbar-width: thin;
}

.linea-registros-scroll::-webkit-scrollbar {
    width: 8px;
}

.linea-registros-scroll::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 999px;
}

.linea-registros-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

.linea-registros-scroll::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.linea-registro {
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.06), rgba(45, 212, 191, 0.04) 45%, rgba(255, 255, 255, 0) 70%),
        #ffffff;
    border: 1px solid #d8e4f2;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 10px;
    overflow: hidden;
    padding: 13px;
    position: relative;
}

.linea-registro::after {
    background: linear-gradient(180deg, #2563eb, #2dd4bf);
    border-radius: 999px;
    content: "";
    height: 42px;
    left: 0;
    position: absolute;
    top: 14px;
    width: 4px;
}

.linea-registro strong {
    color: #0f172a;
    display: inline-flex;
    font-size: 15px;
    font-weight: 900;
    gap: 8px;
    letter-spacing: 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
    padding-left: 3px;
}

.linea-registro strong::before {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
    border-radius: 999px;
    content: "";
    flex: 0 0 7px;
    display: inline-block;
    height: 7px;
    margin-top: 6px;
    width: 7px;
}

.linea-registro span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

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

.linea-registro-info span {
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid #e5edf7;
    border-radius: 10px;
    color: #172033;
    min-height: 50px;
    padding: 8px 9px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.linea-registro-info span:hover {
    border-color: #bfd0e8;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.linea-registro-info b {
    color: #2563eb;
    display: block;
    font-size: 9.5px;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.linea-registro .table-actions {
    gap: 7px;
    justify-content: flex-start;
    margin-top: 0;
    padding-top: 2px;
}

.linea-registro .icon-action {
    box-shadow: 0 8px 14px rgba(15, 23, 42, 0.12);
}

.linea-close-panel {
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 8px;
}

.linea-close-panel summary {
    background: #eef2ff;
    border: 1px solid #d8e3ff;
    border-radius: 8px;
    color: #2563eb;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 10px;
    text-align: center;
}

.linea-close-form {
    display: grid;
    gap: 8px;
    margin-top: 9px;
}

.linea-close-date {
    margin: 0;
}

.linea-close-date span {
    color: #0f172a;
    display: block;
    font-size: 10px;
    font-weight: 900;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.linea-close-date input {
    min-height: 34px;
}

.linea-close-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.linea-close-table th,
.linea-close-table td {
    border: 1px solid #1f2a3d;
    color: #00152f;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    padding: 3px;
    text-align: center;
    vertical-align: middle;
}

.linea-close-table th,
.linea-close-table td:first-child {
    background: #e8e8e8;
}

.linea-close-table input {
    background: #ffffff;
    border: 0;
    border-radius: 0;
    color: #ff0000;
    font-size: 10px;
    font-weight: 800;
    min-height: 24px;
    padding: 2px 3px;
    text-align: center;
}

.linea-quality-table tr:nth-child(3) td:not(:first-child),
.linea-range {
    background: #ffd4b1 !important;
    color: #ff0000 !important;
    font-weight: 800 !important;
}

.linea-close-form .btn {
    justify-content: center;
    margin-top: 2px;
    width: 100%;
}

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

.summary-grid-modern {
    align-items: start;
}

.summary-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    padding: 16px;
    overflow: hidden;
    position: relative;
}

.summary-panel-production {
    border-top: 4px solid #2563eb;
}

.summary-panel-type {
    border-top: 4px solid #198754;
}

.summary-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.summary-title-group {
    align-items: center;
    display: flex;
    gap: 10px;
}

.summary-head-icon {
    align-items: center;
    background: #dbeafe;
    border-radius: 14px;
    color: #2563eb;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.summary-head-icon-green {
    background: #d1e7dd;
    color: #198754;
}

.summary-head-icon svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 22px;
}

.summary-head h2 {
    font-size: 18px;
    margin: 0;
}

.summary-link {
    background: #eef4ff;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
    text-decoration: none;
    white-space: nowrap;
}

.summary-link:hover {
    background: #dbeafe;
}

.summary-chart-card {
    background: #f8fafc;
    border: 1px solid #dbe5f2;
    border-radius: 10px;
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px;
}

.summary-lines-chart {
    grid-template-columns: minmax(125px, 0.42fr) minmax(0, 1fr);
}

.summary-type-chart {
    grid-template-columns: minmax(125px, 0.36fr) minmax(0, 1fr);
}

.summary-chart-total {
    align-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    min-height: 128px;
    padding: 14px;
}

.summary-chart-total span,
.summary-chart-total small {
    color: #52627a;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.summary-chart-total strong {
    color: #0f172a;
    font-size: 38px;
    font-weight: 900;
    line-height: 1;
    margin: 7px 0;
}

.summary-bars-visual {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    min-height: 128px;
}

.summary-bar-column {
    align-items: center;
    color: inherit;
    display: grid;
    gap: 6px;
    justify-items: center;
    min-width: 0;
    text-decoration: none;
    transition: transform 0.16s ease;
}

.summary-bar-column:hover {
    transform: translateY(-2px);
}

.summary-bar-track {
    align-items: end;
    background: #e5eaf2;
    border-radius: 999px;
    display: flex;
    height: 88px;
    overflow: hidden;
    padding: 3px;
    width: 22px;
}

.summary-bar-track span {
    background: linear-gradient(180deg, color-mix(in srgb, var(--summary-accent) 62%, white), var(--summary-accent));
    border-radius: inherit;
    display: block;
    width: 100%;
}

.summary-bar-column strong {
    color: var(--summary-accent);
    font-size: 12px;
    font-weight: 900;
}

.summary-bar-column small {
    background: var(--summary-soft);
    border-radius: 999px;
    color: var(--summary-accent);
    font-size: 11px;
    font-weight: 900;
    padding: 3px 7px;
}

.summary-donut-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.summary-donut {
    align-items: center;
    background: #ffffff;
    border: 1px solid color-mix(in srgb, var(--summary-accent) 24%, #dbe5f2);
    border-radius: 10px;
    color: inherit;
    display: grid;
    justify-items: center;
    min-height: 128px;
    padding: 10px;
    position: relative;
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.summary-donut:hover {
    border-color: color-mix(in srgb, var(--summary-accent) 50%, #dbe5f2);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.summary-donut::before {
    background:
        radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
        conic-gradient(var(--summary-accent) 0 var(--donut-value), #e5eaf2 var(--donut-value) 100%);
    border-radius: 999px;
    content: "";
    height: 72px;
    width: 72px;
}

.summary-donut span {
    color: var(--summary-accent);
    font-size: 13px;
    font-weight: 900;
    position: absolute;
    top: 38px;
}

.summary-donut strong {
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
    margin-top: 2px;
}

.summary-donut small {
    color: #52627a;
    font-size: 11px;
    font-weight: 800;
}

.summary-list {
    display: grid;
    gap: 10px;
}

.summary-item {
    background: #ffffff;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    color: inherit;
    display: grid;
    gap: 8px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
    text-decoration: none;
}

.summary-card-item {
    --summary-accent: #2563eb;
    --summary-soft: #dbeafe;
    background: #ffffff;
    border-color: color-mix(in srgb, var(--summary-accent) 22%, #edf1f5);
    border-radius: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 84px;
    padding: 12px;
}

.summary-mini-icon {
    align-items: center;
    background: var(--summary-soft);
    border-radius: 10px;
    color: var(--summary-accent);
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    grid-row: span 3;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.summary-line-1 { --summary-accent: #2563eb; --summary-soft: #dbeafe; }
.summary-line-2 { --summary-accent: #0f766e; --summary-soft: #ccfbf1; }
.summary-line-3 { --summary-accent: #7c3aed; --summary-soft: #ede9fe; }
.summary-line-4 { --summary-accent: #dc2626; --summary-soft: #fee2e2; }
.summary-line-5 { --summary-accent: #ea580c; --summary-soft: #ffedd5; }
.summary-line-6 { --summary-accent: #0891b2; --summary-soft: #cffafe; }
.summary-type-hb { --summary-accent: #dc2626; --summary-soft: #fee2e2; }
.summary-type-n { --summary-accent: #2563eb; --summary-soft: #dbeafe; }
.summary-type-s { --summary-accent: #111827; --summary-soft: #e5e7eb; }

a.summary-item {
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

a.summary-item:hover {
    border-color: var(--summary-accent, #2563eb);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--summary-accent, #2563eb) 18%, transparent);
    transform: translateY(-1px);
}

.summary-label {
    align-self: end;
    font-weight: 800;
}

.summary-count {
    align-self: end;
    background: var(--summary-soft, #e8f0ff);
    border-radius: 999px;
    color: var(--summary-accent, #1d4ed8);
    font-size: 12px;
    font-weight: 800;
    min-width: 64px;
    padding: 5px 9px;
    text-align: center;
}

.summary-item-type .summary-count {
    background: var(--summary-soft, #d1e7dd);
    color: var(--summary-accent, #0f5132);
}

.summary-bar {
    background: #e5e7eb;
    border-radius: 999px;
    grid-column: 2 / -1;
    height: 8px;
    overflow: hidden;
}

.summary-bar span {
    background: linear-gradient(90deg, var(--summary-accent, #2563eb), color-mix(in srgb, var(--summary-accent, #2563eb) 55%, white));
    border-radius: inherit;
    display: block;
    height: 100%;
}

.summary-item-type .summary-bar span {
    background: linear-gradient(90deg, var(--summary-accent, #198754), color-mix(in srgb, var(--summary-accent, #198754) 55%, white));
}

.summary-percent {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    grid-column: 2 / -1;
}

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

.records-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
    overflow: hidden;
    padding: 16px;
}

.active-filter-strip {
    align-items: center;
    background: linear-gradient(135deg, #eef4ff, #f8fbff);
    border: 1px solid #cfe0ff;
    border-radius: 10px;
    color: #1e3a8a;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 14px;
    padding: 10px 12px;
}

.active-filter-label {
    color: #52627a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.active-filter-chip {
    background: #dbeafe;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    padding: 5px 10px;
}

.active-filter-strip a {
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    margin-left: auto;
    text-decoration: none;
}

.records-table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.records-table th {
    background: #f1f5f9;
    border-bottom: 0;
    color: #334155;
    font-size: 11px;
    letter-spacing: 0.03em;
    padding: 12px 10px;
    text-transform: uppercase;
}

.records-table td {
    background: #ffffff;
    border-bottom: 1px solid #dce6f2;
    border-top: 1px solid #dce6f2;
    color: #0f172a;
    padding: 12px 10px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.records-table tbody tr {
    --row-accent: #2563eb;
}

.records-table tbody tr:hover td {
    border-color: color-mix(in srgb, var(--row-accent) 34%, #dce6f2);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
}

.records-table tbody tr td:first-child {
    border-left: 4px solid var(--row-accent);
    border-radius: 12px 0 0 12px;
}

.records-table tbody tr td:last-child {
    border-radius: 0 12px 12px 0;
    border-right: 1px solid #dce6f2;
}

.record-line-1 { --row-accent: #2563eb; }
.record-line-2 { --row-accent: #0f766e; }
.record-line-3 { --row-accent: #7c3aed; }
.record-line-4 { --row-accent: #dc2626; }
.record-line-5 { --row-accent: #ea580c; }
.record-line-6 { --row-accent: #0891b2; }

.record-code {
    color: #0f172a;
    display: block;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.record-product {
    color: #0f172a;
    display: inline-flex;
    font-weight: 800;
    line-height: 1.25;
}

.record-partida {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
}

.record-hoja {
    align-items: center;
    background: #eef2ff;
    border: 1px solid #dbe5ff;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    min-width: 30px;
    padding: 4px 9px;
}

.record-jefe {
    color: #172033;
    font-weight: 600;
}

.line-pill,
.type-pill,
.condition-pill,
.role-pill {
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
}

.line-pill {
    background: color-mix(in srgb, var(--row-accent, #2563eb) 12%, white);
    border: 1px solid color-mix(in srgb, var(--row-accent, #2563eb) 24%, #dbeafe);
    border-radius: 999px;
    color: color-mix(in srgb, var(--row-accent, #2563eb) 78%, #0f172a);
    min-width: 38px;
    justify-content: center;
    padding: 5px 10px;
}

.type-pill {
    background: #e5e7eb;
    color: #111827;
}

.type-hb {
    background: #fee2e2;
    color: #b91c1c;
}

.type-n {
    background: #dbeafe;
    color: #1d4ed8;
}

.type-s {
    background: #f3f4f6;
    color: #111827;
}

.condition-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #334155;
    max-width: 160px;
    overflow-wrap: anywhere;
    padding: 5px 10px;
    white-space: normal;
}

.user-role-cell {
    display: grid;
    gap: 2px;
}

.user-role-cell strong {
    color: #0f172a;
    font-size: 13px;
}

.user-role-cell small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.record-actions {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: inline-flex;
    gap: 7px;
    padding: 6px;
}

.record-actions .icon-action {
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.10);
}

.estiraje-open-btn {
    align-items: center;
    background:
        linear-gradient(135deg, #eff6ff, #ecfeff);
    border: 1px solid #b9d3ff;
    border-radius: 999px;
    color: #0f172a;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    min-height: 34px;
    justify-content: center;
    padding: 6px 14px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.estiraje-open-btn:hover {
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.estiraje-open-btn span {
    display: none;
}

.estiraje-open-btn strong {
    color: #0f766e;
    font-size: 13px;
    font-weight: 900;
}

.estiraje-modal {
    align-items: center;
    display: none;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 1000;
}

.estiraje-modal[aria-hidden="false"] {
    display: flex;
}

.estiraje-modal-backdrop {
    background: rgba(15, 23, 42, 0.56);
    inset: 0;
    position: absolute;
}

.estiraje-modal-card {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34%),
        #ffffff;
    border: 1px solid #d6e2f0;
    border-radius: 22px;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.24);
    max-height: min(88vh, 760px);
    max-width: 760px;
    overflow: hidden;
    padding: 22px;
    position: relative;
    width: min(100%, 760px);
}

.estiraje-modal-close {
    align-items: center;
    background: #eef4ff;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    color: #1d4ed8;
    cursor: pointer;
    display: inline-flex;
    font-size: 26px;
    font-weight: 700;
    height: 38px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 16px;
    top: 16px;
    width: 38px;
}

.estiraje-modal-title {
    align-items: center;
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    padding-right: 48px;
}

.estiraje-modal-title > span {
    align-items: center;
    background: linear-gradient(135deg, #dbeafe, #ecfeff);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    color: #2563eb;
    display: inline-flex;
    font-weight: 900;
    height: 50px;
    justify-content: center;
    width: 50px;
}

.estiraje-modal-title small {
    color: #2563eb;
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.estiraje-modal-title h2 {
    color: #0f172a;
    font-size: 24px;
    margin: 2px 0 0;
}

.estiraje-modal-content {
    max-height: calc(88vh - 130px);
    overflow: auto;
    padding-right: 4px;
}

.estiraje-detail-head {
    align-items: center;
    background: linear-gradient(135deg, #f8fbff, #ecfeff);
    border: 1px solid #d7e5f4;
    border-radius: 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
}

.estiraje-detail-head > span {
    align-items: center;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.estiraje-detail-head strong,
.estiraje-detail-head small {
    display: block;
}

.estiraje-detail-head small {
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.estiraje-detail-scroll {
    display: grid;
    gap: 12px;
}

.estiraje-detail-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.estiraje-detail-table td:nth-child(1) {
    width: 22%;
}

.estiraje-detail-table td:nth-child(2) {
    width: 24%;
}

.estiraje-detail-table td:nth-child(3),
.estiraje-detail-table td:nth-child(4) {
    width: 27%;
}

.estiraje-detail-table td {
    border: 1px solid #1f2d44;
    font-size: 12px;
    font-weight: 800;
    height: 30px;
    padding: 5px 7px;
    text-align: center;
}

.estiraje-detail-table .no-border {
    background: transparent;
    border: 0;
}

.estiraje-auto-line td:not(.no-border) {
    border: 0;
    color: #ff0000;
    font-weight: 900;
}

.estiraje-section {
    background: #bfbfbf;
    color: #0f172a;
    width: 22%;
}

.estiraje-label,
.estiraje-head {
    background: #e5e7eb;
}

.estiraje-gray {
    background: #bfbfbf;
}

.estiraje-blue {
    color: #0000ff;
}

.estiraje-peach {
    background: #f8cbad;
}

.estiraje-detail-table .text-red {
    color: #ff0000;
    font-weight: 900;
}

.auth-body {
    align-items: center;
    display: flex;
    min-height: 100vh;
}

.auth-shell {
    margin: 0 auto;
    max-width: 460px;
    padding: 16px;
    width: 100%;
}

.auth-card {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.10), transparent 42%),
        #ffffff;
    border: 1px solid #d9e2ef;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    padding: 22px;
}

.auth-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-brand h1,
.auth-brand p {
    margin: 0;
}

.auth-brand p {
    color: var(--muted);
    margin-top: 4px;
}

.auth-logo {
    align-items: center;
    background: #dbeafe;
    border-radius: 14px;
    color: #1d4ed8;
    display: inline-flex;
    font-weight: 900;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form .btn {
    justify-content: center;
}

.users-page {
    margin: 0 auto;
    max-width: 1480px;
}

.role-layout {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
    margin-bottom: 14px;
}

.role-panel,
.users-list-panel {
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
}

.role-panel .section-heading,
.users-list-panel .section-heading {
    margin-bottom: 16px;
}

.role-form {
    margin-top: 14px;
}

.role-cards {
    align-content: start;
    align-self: start;
    display: grid;
    gap: 10px;
}

.role-card {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 38%),
        #ffffff;
    border: 1px solid #d9e2ef;
    border-left: 6px solid #2563eb;
    border-radius: 14px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 8px;
    min-height: 92px;
    padding: 16px;
}

.role-card strong {
    color: #0f172a;
    font-size: 15px;
}

.role-card span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.role-developer { border-left-color: #7c3aed; }
.role-planta { border-left-color: #198754; }
.role-turno { border-left-color: #2563eb; }
.role-asistente { border-left-color: #64748b; }

.user-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.user-card {
    align-items: flex-start;
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.11), transparent 32%),
        radial-gradient(circle at 0% 100%, rgba(34, 199, 184, 0.10), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    border: 1px solid #d6e2f0;
    border-radius: 18px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 14px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
    padding: 18px;
    position: relative;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.user-card::before {
    background: linear-gradient(180deg, #2563eb, #22c7b8);
    border-radius: 999px;
    content: "";
    inset: 16px auto 16px 0;
    position: absolute;
    width: 4px;
}

.user-card::after {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12), rgba(34, 199, 184, 0.08), transparent);
    content: "";
    height: 1px;
    inset: 0 20px auto 20px;
    position: absolute;
}

.user-card:hover {
    border-color: #a8c3ff;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.13);
    transform: translateY(-3px);
}

.user-card-admin {
    grid-template-areas:
        "avatar main role perms actions";
    grid-template-columns: auto minmax(180px, 0.9fr) auto minmax(280px, 1.6fr) auto;
    min-height: 116px;
}

.user-card-admin.is-inactive {
    background: #f8fafc;
    opacity: 0.72;
}

.user-card-main {
    display: grid;
    gap: 5px;
    grid-area: main;
    min-width: 0;
}

.user-card strong,
.user-card span {
    display: block;
}

.user-card-main > strong {
    color: #0f172a;
    font-size: 18px;
    line-height: 1.15;
}

.user-card span {
    color: var(--muted);
    font-size: 12.5px;
}

.user-card-main > small {
    color: #64748b;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
}

.user-avatar {
    align-items: center;
    background:
        linear-gradient(135deg, #dbeafe, #c7fff4);
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 16px;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    display: inline-flex !important;
    font-weight: 900;
    grid-area: avatar;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.user-actions {
    align-items: center;
    background: rgba(241, 245, 249, 0.92);
    border: 1px solid #dce6f2;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
    display: inline-flex;
    gap: 7px;
    grid-area: actions;
    justify-self: end;
    margin-left: 4px;
    padding: 6px;
}

.user-actions form {
    margin: 0;
}

.user-access-panel {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.06), transparent 45%),
        #f8fbff;
    border: 1px solid #dbe7f5;
    border-radius: 16px;
    padding: 16px;
}

.user-access-side {
    align-self: start;
    border-top: 4px solid #2563eb;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
    max-height: calc(100vh - 96px);
    overflow: auto;
    position: sticky;
    top: 82px;
    scrollbar-width: thin;
}

.user-access-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.user-access-head strong {
    color: #0f172a;
    display: block;
    font-size: 15px;
}

.user-access-head span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.user-access-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.user-access-grid-side {
    grid-template-columns: 1fr;
}

.access-toggle {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    gap: 11px;
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0;
    min-height: 72px;
    padding: 12px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.access-toggle:hover {
    border-color: #9bbcff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.access-toggle input {
    appearance: none;
    background: #dbe3ef;
    border: 0;
    border-radius: 999px;
    height: 20px;
    margin-top: 2px;
    position: relative;
    transition: background 0.16s ease;
    width: 36px;
}

.access-toggle input::before {
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    content: "";
    height: 16px;
    left: 2px;
    position: absolute;
    top: 2px;
    transition: transform 0.16s ease;
    width: 16px;
}

.access-toggle input:checked {
    background: #2563eb;
}

.access-toggle input:checked::before {
    transform: translateX(16px);
}

.access-toggle:has(input:checked) {
    background: linear-gradient(135deg, #eef4ff, #ffffff);
    border-color: #a9c5ff;
}

.access-toggle strong {
    color: #0f172a;
    display: block;
    font-size: 13px;
}

.access-toggle small {
    color: #64748b;
    display: block;
    font-size: 11px;
    line-height: 1.35;
    margin-top: 2px;
}

.user-access-side .access-toggle {
    min-height: 66px;
}

.user-access-mini {
    align-content: start;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.94));
    border: 1px solid #dce6f2;
    border-radius: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    grid-area: perms;
    max-height: 82px;
    overflow: auto;
    padding: 11px;
    scrollbar-width: thin;
}

.user-access-mini span {
    align-items: center;
    background: linear-gradient(180deg, #ffffff, #eef5ff);
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    box-shadow: 0 5px 12px rgba(37, 99, 235, 0.06);
    color: #1d4ed8;
    display: inline-flex;
    font-size: 10.8px;
    font-weight: 800;
    justify-content: center;
    line-height: 1.15;
    min-height: 26px;
    padding: 6px 11px;
    text-align: center;
}

.user-card .role-pill {
    align-items: center;
    background: linear-gradient(180deg, #eff6ff, #ffffff);
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
    color: #1e3a8a;
    grid-area: role;
    justify-self: end;
    padding: 7px 12px;
}

.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
}

.password-field input {
    border-radius: 7px 0 0 7px;
}

.password-eye {
    align-items: center;
    background: #eef2f7;
    border: 1px solid #b9c5d4;
    border-left: 0;
    border-radius: 0 7px 7px 0;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
}

.password-eye.is-visible {
    background: #dbeafe;
    color: #1d4ed8;
}

.password-eye svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.field-help {
    color: var(--muted);
    display: block;
    font-size: 11px;
    margin-top: 5px;
}

.user-active-toggle {
    align-items: center;
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 199, 184, 0.14), transparent 38%),
        linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #d7e3f3;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 74px;
    padding: 14px 16px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.user-active-toggle:hover {
    border-color: #9bbcff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.user-active-toggle input {
    appearance: none;
    background: #dbe3ef;
    border: 0;
    border-radius: 999px;
    height: 26px;
    margin: 0;
    position: relative;
    width: 48px;
}

.user-active-toggle input::before {
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.2);
    content: "";
    height: 20px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 0.16s ease;
    width: 20px;
}

.user-active-toggle input:checked {
    background: linear-gradient(135deg, #16a34a, #22c7b8);
}

.user-active-toggle input:checked::before {
    transform: translateX(22px);
}

.user-active-switch {
    display: none;
}

.user-active-copy {
    display: grid;
    gap: 3px;
}

.user-active-copy strong {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.1;
}

.user-active-copy small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
}

.role-pill {
    background: #eef2f7;
    color: #334155;
    white-space: nowrap;
}

@media (max-width: 900px) {
    body {
        padding: 0;
    }

    .site-navbar {
        align-items: center;
        flex-direction: row;
        gap: 12px;
        padding: 9px 12px;
    }

    .dashboard-shell {
        padding: 0 12px 22px;
    }

    .site-navlinks {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
        width: auto;
    }

    .site-navlink {
        flex: 0 0 auto;
        text-align: center;
        white-space: nowrap;
    }

    .main {
        padding: 0;
    }

    .topbar,
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-visual {
        margin-left: 0;
        order: 3;
        width: 100%;
    }

    .hero-line {
        flex: 1;
        width: auto;
    }

    .cards,
    .summary-grid,
    .form-grid,
    .role-layout {
        grid-template-columns: 1fr;
    }

    .user-access-side {
        max-height: none;
        overflow: visible;
        position: static;
    }

    .summary-lines-chart,
    .summary-type-chart {
        grid-template-columns: 1fr;
    }

    .summary-chart-total {
        min-height: 96px;
    }

    .field-span-2,
    .field-span-4,
    .section-title {
        grid-column: span 1;
    }

    .role-page-shell {
        padding: 0 10px 22px;
    }

    .role-personal-sheet {
        overflow-x: hidden;
        padding: 12px;
        width: 100%;
    }

    .role-personal-title,
    .role-personal-grid {
        min-width: 0;
    }

    .role-personal-grid {
        gap: 14px;
        grid-template-columns: 1fr;
    }

    .role-personal-title h1 {
        font-size: clamp(26px, 7vw, 34px);
    }

    .role-personal-title span,
    .role-personal-title strong {
        font-size: clamp(15px, 4.2vw, 20px);
    }

    .role-personal-title div {
        align-items: center;
        flex-wrap: wrap;
        gap: 8px 18px;
    }

    .role-team-card {
        grid-template-columns: minmax(72px, 24%) minmax(0, 1fr);
        width: 100%;
    }

    .role-team-label {
        font-size: clamp(13px, 3.5vw, 17px);
        padding: 8px 5px;
        word-break: break-word;
    }

    .role-person-row {
        grid-template-columns: minmax(44px, 22%) minmax(0, 1fr);
    }

    .role-person-code,
    .role-person-name,
    .role-redoble {
        font-size: clamp(12px, 3.35vw, 16px);
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .role-placeholder-grid {
        grid-template-columns: 1fr;
    }

    .role-editor-toolbar {
        grid-template-columns: 1fr;
    }

    .role-editor-actions {
        justify-content: flex-start;
    }

    .puestos-layout {
        grid-template-columns: 1fr;
    }

    .puestos-shell {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        width: 100%;
    }

    .puestos-editor-panel {
        min-width: 0;
        width: 100%;
    }

    .puestos-editor-panel .summary-head {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .puestos-editor-panel .summary-head .actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .puestos-editor-panel .summary-head .btn {
        justify-content: center;
        min-width: 0;
        padding-inline: 10px;
    }

    .puestos-personal-panel {
        display: none;
    }

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

    .puestos-table-wrap {
        border: 1px solid #d8e0ea;
        border-radius: 12px;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .puestos-table {
        min-width: 920px;
    }

    .puestos-personal-list {
        max-height: 260px;
    }
}

@media (max-width: 760px) {
    body {
        -webkit-text-size-adjust: 100%;
    }

    .panel {
        padding: 12px;
    }

    .dashboard-hero {
        border-radius: 0;
        padding: 0;
    }

    .dashboard-hero .btn {
        justify-content: center;
        width: 100%;
    }

    .hero-visual {
        display: none;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-card {
        grid-template-columns: 1fr;
    }

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

    .filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions .btn {
        justify-content: center;
    }

    .lineas-panel .toolbar {
        gap: 12px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .lineas-panel .toolbar .btn {
        justify-content: center;
        width: 100%;
    }

    .linea-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .linea-card-header .badge {
        align-self: flex-start;
    }

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

    .table thead {
        display: none;
    }

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

    .table tr {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 8px;
    }

    .table td {
        align-items: start;
        border-bottom: 1px solid #edf1f5;
        display: grid;
        gap: 10px;
        grid-template-columns: 105px minmax(0, 1fr);
        padding: 8px 4px;
        word-break: break-word;
    }

    .table td:last-child {
        border-bottom: 0;
    }

    .table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .table-actions {
        justify-content: flex-start;
    }

    .records-table {
        border-spacing: 0;
        display: table;
        min-width: 0;
        table-layout: fixed;
        width: 100%;
    }

    .records-table thead {
        display: table-header-group;
    }

    .records-table tbody {
        display: table-row-group;
    }

    .records-table tr {
        display: table-row;
        margin: 0;
        padding: 0;
        width: auto;
    }

    .records-table th,
    .records-table td {
        display: table-cell;
        font-size: 11px;
        padding: 8px 5px;
        vertical-align: middle;
        width: auto;
    }

    .records-table td {
        gap: 0;
        grid-template-columns: none;
        word-break: normal;
    }

    .records-table td::before {
        content: none;
    }

    .records-table th:nth-child(3),
    .records-table td:nth-child(3),
    .records-table th:nth-child(6),
    .records-table td:nth-child(6),
    .records-table th:nth-child(7),
    .records-table td:nth-child(7),
    .records-table th:nth-child(8),
    .records-table td:nth-child(8) {
        display: none;
    }

    .records-table th:nth-child(1),
    .records-table td:nth-child(1) {
        width: 24%;
    }

    .records-table th:nth-child(2),
    .records-table td:nth-child(2),
    .records-table th:nth-child(4),
    .records-table td:nth-child(4) {
        width: 12%;
    }

    .records-table th:nth-child(5),
    .records-table td:nth-child(5) {
        width: 22%;
    }

    .records-table th:nth-child(9),
    .records-table td:nth-child(9) {
        width: 30%;
    }

    .records-table tbody tr {
        border-left: 4px solid var(--row-accent, #2563eb);
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    }

    .records-table td {
        border-left: 0 !important;
        border-right: 0 !important;
        transform: none !important;
    }

    .records-table tbody tr td:first-child,
    .records-table tbody tr td:last-child {
        border-radius: 0;
    }

    .record-actions {
        align-self: start;
        flex-wrap: wrap;
        gap: 4px;
        padding: 4px;
    }

    .record-actions .icon-action {
        height: 30px;
        width: 30px;
    }

    .estiraje-open-btn {
        border-radius: 12px;
        display: grid;
        gap: 1px;
        justify-items: center;
        min-height: 38px;
        padding: 5px;
        width: 100%;
    }

    .estiraje-open-btn span {
        display: none;
    }

    .estiraje-open-btn strong {
        font-size: 12px;
    }

    .estiraje-modal {
        padding: 10px;
    }

    .estiraje-modal-card {
        border-radius: 18px;
        max-height: 92vh;
        padding: 16px;
    }

    .estiraje-modal-title h2 {
        font-size: 20px;
    }

    .estiraje-modal-content {
        max-height: calc(92vh - 116px);
    }

    .estiraje-detail-head {
        align-items: flex-start;
    }

    .estiraje-detail-table td {
        font-size: 11px;
        height: 28px;
        padding: 4px;
    }
}

@media (max-width: 520px) {
    body {
        padding: 0;
    }

    .site-navbar {
        border-radius: 0;
        margin-bottom: 14px;
    }

    .topbar .btn {
        justify-content: center;
        width: 100%;
    }

    .card,
    .panel,
    .filter-card {
        border-radius: 7px;
        padding: 12px;
    }

    .metric-value {
        font-size: 24px;
    }

    .filter-heading h2 {
        font-size: 18px;
    }

    .filter-actions {
        grid-template-columns: 1fr;
    }

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

    .summary-bar-track {
        height: 72px;
    }

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

    .linea-groups {
        grid-template-columns: 1fr;
    }

    .linea-registros {
        padding: 10px;
    }

    .linea-registro {
        padding: 10px;
    }

    .linea-registro-info {
        grid-template-columns: 1fr;
    }

    .linea-registro .table-actions {
        display: grid;
        grid-template-columns: repeat(2, 34px);
        justify-content: start;
    }

    .summary-title-group {
        align-items: flex-start;
    }

    .summary-head {
        flex-direction: column;
    }

    .summary-link {
        text-align: center;
        width: 100%;
    }

    .summary-card-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .summary-count {
        grid-column: 2;
        justify-self: start;
    }

    .summary-bar,
    .summary-percent {
        grid-column: 1 / -1;
    }

    .table td {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .user-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .user-card .role-pill {
        grid-area: role;
        justify-content: center;
        justify-self: start;
    }

    .user-card-admin {
        grid-template-areas:
            "avatar main"
            "perms perms"
            "role role"
            "actions actions";
        grid-template-columns: auto minmax(0, 1fr);
    }

    .user-actions {
        grid-area: actions;
        justify-content: flex-start;
        justify-self: start;
    }

    .user-access-mini {
        max-height: 132px;
    }
}

@media (max-width: 380px) {
    body {
        padding: 0;
    }

    h1 {
        font-size: 20px;
    }

    .site-brand {
        font-size: 14px;
    }

    .table td {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .table td::before {
        font-size: 10px;
    }

    .icon-action {
        height: 32px;
        width: 32px;
    }
}

@media (max-width: 640px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .site-navbar {
        align-items: center;
        gap: 10px;
        margin: 0 -10px 10px;
        overflow: hidden;
        padding: 8px 10px;
    }

    .site-navlinks {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0;
        scrollbar-width: thin;
        width: auto;
    }

    .site-navlink {
        flex: 0 0 auto;
        font-size: 11px;
        min-height: 34px;
        padding: 8px 10px;
        text-align: center;
        white-space: nowrap;
    }

    .site-brand {
        font-size: 15px;
        flex: 0 0 auto;
        width: auto;
    }

    .site-brand::before {
        border-radius: 8px;
        height: 24px;
        width: 24px;
    }

    .dashboard-shell,
    .install-shell,
    .users-page,
    .role-page-shell {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .dashboard-hero,
    .panel,
    .card,
    .filter-card,
    .summary-panel {
        max-width: 100%;
    }

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

    .metric-card {
        min-height: 92px;
    }

    .filter-form,
    .search-form,
    .form-grid,
    .role-layout,
    .puestos-layout,
    .puestos-form-grid {
        grid-template-columns: 1fr;
    }

    .records-panel,
    .puestos-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .user-access-panel {
        border-radius: 14px;
        padding: 12px;
    }

    .user-access-grid,
    .user-access-grid-side {
        grid-template-columns: 1fr;
    }

    .linea-groups {
        grid-template-columns: 1fr;
    }

    .linea-card {
        min-width: 0;
    }

    .linea-registros {
        max-height: 420px;
        overflow-y: auto;
    }

    .role-editor-toolbar {
        border-radius: 18px 18px 0 0;
        bottom: 0;
        box-shadow: 0 -14px 34px rgba(15, 23, 42, 0.16);
        left: 0;
        margin: 0;
        max-height: 42vh;
        overflow-y: auto;
        padding: 10px;
        position: fixed;
        right: 0;
        top: auto;
        z-index: 80;
    }

    .role-editor-toolbar > div:first-child {
        display: none;
    }

    .role-editor-actions {
        gap: 7px;
        justify-content: center;
        width: 100%;
    }

    .role-editor-actions .btn {
        flex: 1 1 calc(50% - 7px);
        font-size: 12px;
        justify-content: center;
        min-width: 0;
        min-height: 38px;
        padding: 8px 9px;
    }

    .role-editor-actions .btn span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .role-toolbar-group {
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .role-color-btn {
        flex: 1 1 38px;
        height: 38px;
        max-width: 48px;
    }

    .role-editor-actions > .icon-action {
        flex: 1 1 42px;
        height: 38px;
        max-width: 58px;
    }

    .role-toolbar-group {
        border-left: 0;
        margin-left: 0;
        padding-left: 0;
    }

    .role-personal-sheet {
        max-width: 100%;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .role-page-shell {
        padding-bottom: 250px;
    }

    .role-personal-title,
    .role-personal-grid {
        min-width: 0;
    }

    .puestos-editor-panel .summary-head .actions {
        grid-template-columns: 1fr;
    }

    .puestos-editor-panel .summary-head .btn {
        min-height: 40px;
        width: 100%;
    }

    .puestos-table {
        min-width: 760px;
    }

    .puestos-personal-list {
        grid-template-columns: 1fr;
    }

    .puestos-table thead th {
        font-size: 18px;
    }

    .puestos-table thead th:first-child {
        width: auto;
    }

    .puestos-table tbody th {
        font-size: 17px;
    }

    .puestos-table th,
    .puestos-table td {
        height: 56px;
    }

    .puestos-table input {
        font-size: 15px;
        padding: 5px;
    }

    .puestos-split-field {
        grid-template-rows: minmax(56px, 1fr);
        min-height: 56px;
    }

    .puestos-split-field input {
        font-size: 15px;
        padding: 4px;
    }

    .puestos-split-field input.puestos-redoble-input {
        font-size: 15px;
    }

    .puestos-redoble-cell::before {
        font-size: 15px;
    }

    .puestos-prensa-merged input {
        min-height: 112px;
    }

    .puestos-prensa-merged[rowspan="4"] input {
        min-height: 224px;
    }

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

    .user-card,
    .user-card-admin {
        align-items: flex-start;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .user-card .role-pill,
    .user-actions {
        grid-column: 1 / -1;
    }

    .user-actions {
        flex-wrap: wrap;
    }

    .password-field {
        grid-template-columns: minmax(0, 1fr) 40px;
    }
}

/* Rodillos */
.rodillos-shell {
    color: #071226;
}

.rodillos-hero {
    align-items: center;
    background:
        radial-gradient(circle at 78% 18%, rgba(45, 212, 191, 0.34), transparent 34%),
        radial-gradient(circle at 42% 68%, rgba(59, 130, 246, 0.22), transparent 34%),
        linear-gradient(135deg, #0f172a 0%, #243f83 48%, #0f766e 100%);
    border-radius: 18px;
    box-shadow: 0 22px 58px rgba(15, 23, 42, 0.18);
    color: #ffffff;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
    margin: 18px 0;
    min-height: 230px;
    overflow: hidden;
    padding: 28px;
    position: relative;
}

.rodillos-hero::after {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 58%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.rodillos-hero-copy {
    position: relative;
    z-index: 1;
}

.rodillos-hero h1 {
    font-size: clamp(28px, 4vw, 48px);
    letter-spacing: 0;
    margin: 4px 0 8px;
}

.rodillos-hero p {
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
    max-width: 680px;
}

.rodillos-hero-media {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.18), rgba(20, 184, 166, 0.18)),
        rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 18px 42px rgba(15, 23, 42, 0.22);
    display: flex;
    justify-content: center;
    min-height: 178px;
    overflow: hidden;
    padding: 10px 14px;
    position: relative;
    z-index: 1;
}

.rodillos-hero-media img {
    display: block;
    filter: contrast(1.06) saturate(1.08) drop-shadow(0 16px 18px rgba(15, 23, 42, 0.2));
    height: 100%;
    max-height: 210px;
    mix-blend-mode: multiply;
    object-fit: contain;
    opacity: 0.96;
    width: 100%;
}

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

.rodillo-kpi {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d7e2f0;
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 3px 14px;
    grid-template-columns: auto 1fr;
    padding: 18px;
}

.rodillo-kpi-icon {
    align-items: center;
    background: #dbeafe;
    border-radius: 15px;
    color: #2563eb;
    display: inline-flex;
    font-weight: 900;
    grid-row: span 2;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.rodillo-kpi-icon.teal {
    background: #ccfbf1;
    color: #0f766e;
}

.rodillo-kpi-icon.orange {
    background: #ffedd5;
    color: #ea580c;
}

.rodillo-kpi small {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.rodillo-kpi strong {
    font-size: clamp(22px, 3vw, 32px);
}

.rodillos-grid {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    margin-bottom: 16px;
}

.rodillos-form-panel {
    align-self: start;
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 199, 184, 0.12), transparent 30%),
        linear-gradient(135deg, #ffffff, #f8fbff);
}

.rodillos-form-panel .panel-head {
    margin-bottom: 10px;
}

.rodillos-right-stack {
    align-content: start;
    display: grid;
    gap: 12px;
    min-width: 0;
}

.rodillos-chart-panel {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
}

.rodillos-chart-panel > .panel-head {
    grid-column: 1 / -1;
}

.rodillos-history-panel {
    margin-top: 16px;
}

.rodillos-form {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(190px, 1fr) minmax(150px, 0.8fr) minmax(220px, 1fr) minmax(260px, 1.2fr) minmax(150px, auto);
}

.rodillos-form label {
    display: grid;
    gap: 6px;
}

.rodillos-form span {
    color: #12345b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.rodillos-form input,
.rodillos-form select,
.rodillos-form textarea {
    background: #f8fbff;
    border: 1px solid #bfd0e5;
    border-radius: 10px;
    color: #071226;
    font: inherit;
    min-height: 40px;
    padding: 9px 11px;
    width: 100%;
}

.rodillos-form textarea {
    height: 42px;
    resize: vertical;
}

.rodillos-form .rodillos-span-2,
.rodillos-form .rodillos-submit {
    grid-column: auto;
}

.rodillos-form .rodillos-submit {
    border-radius: 12px;
    box-shadow: 0 12px 22px rgba(22, 163, 74, 0.18);
    min-height: 42px;
    white-space: nowrap;
}

.rodillos-bars {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rodillos-machine-tabs {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    margin-bottom: 12px;
}

.rodillo-model-block {
    background: #f8fbff;
    border: 1px solid #d7e2f0;
    border-radius: 18px;
    display: grid;
    gap: 12px;
    margin-top: 0;
    padding: 12px;
}

.rodillo-model-block:first-of-type {
    margin-top: 0;
}

.rodillo-model-title {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.rodillo-model-title > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rodillo-model-title strong {
    color: #071226;
    font-size: 18px;
}

.rodillo-model-title span {
    background: #dbeafe;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    padding: 6px 10px;
}

.rodillo-model-toggle {
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    padding: 8px 14px;
    white-space: nowrap;
}

.rodillo-machine-tab {
    align-items: center;
    background: linear-gradient(135deg, #ffffff, #f1f7ff);
    border: 1px solid #d7e2f0;
    border-radius: 999px;
    color: #071226;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    min-height: 46px;
    padding: 10px 14px;
    text-align: center;
}

.rodillo-machine-tab span {
    color: #2563eb;
    font-weight: 900;
}

.rodillo-machine-tab strong {
    font-size: 13.5px;
    line-height: 1.15;
}

.rodillo-machine-tab small {
    color: #475569;
    font-weight: 800;
}

.rodillo-machine-tab.is-active {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
    border-color: #2563eb;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
    color: #1d4ed8;
}

.rodillo-machine-map {
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid #d7e2f0;
    border-radius: 18px;
    display: none;
    overflow: hidden;
    padding: 12px;
}

.rodillo-map-placeholder {
    align-items: center;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px dashed #b8c9df;
    border-radius: 16px;
    color: #475569;
    display: flex;
    font-weight: 800;
    justify-content: center;
    min-height: 92px;
    padding: 18px;
    text-align: center;
}

.rodillo-map-placeholder[hidden] {
    display: none;
}

.rodillo-machine-map.is-visible {
    display: block;
}

@media (min-width: 701px) {
    .rodillo-model-block {
        align-self: start;
    }

    .rodillo-model-block.is-expanded {
        grid-column: 1 / -1;
    }

    .rodillo-model-block:not(.is-expanded) {
        gap: 0;
    }

    .rodillo-model-block:not(.is-expanded) .rodillos-machine-tabs,
    .rodillo-model-block:not(.is-expanded) .rodillo-map-placeholder,
    .rodillo-model-block:not(.is-expanded) .rodillo-machine-map {
        display: none;
    }

    .rodillo-model-block:not(.is-expanded) .rodillo-model-title {
        min-height: 52px;
    }
}

.rodillo-map-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 10px;
}

.rodillo-map-head span {
    color: #2563eb;
    display: block;
    font-size: 18px;
    font-weight: 900;
}

.rodillo-map-head strong {
    font-size: 24px;
}

.rodillo-map-head small,
.rodillo-map-note {
    color: #475569;
    font-weight: 800;
}

.rodillo-machine-canvas {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.rodillo-machine-canvas img {
    display: block;
    height: auto;
    min-height: 190px;
    object-fit: contain;
    width: 100%;
}

.rodillo-overlay-head {
    align-items: center;
    background: #ffffff;
    border: 3px solid #2563eb;
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22);
    color: #1d4ed8;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 900;
    height: clamp(34px, 3.8vw, 50px);
    justify-content: center;
    left: var(--x);
    position: absolute;
    top: var(--y);
    transform: translate(-50%, -50%);
    width: clamp(34px, 3.8vw, 50px);
    z-index: 2;
}

.rodillo-overlay-head.is-busy {
    background: #14b8a6;
    border-color: #0f766e;
    color: #ffffff;
}

.rodillo-overlay-head.is-active {
    background: #facc15;
    border-color: #ca8a04;
    color: #071226;
    transform: translate(-50%, -50%) scale(1.12);
}

.rodillo-map-note {
    font-size: 12px;
    padding: 10px 4px 0;
}

.rodillo-bar-card {
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid #d7e2f0;
    border-radius: 14px;
    color: #071226;
    display: grid;
    gap: 8px;
    padding: 12px;
    text-align: left;
}

.rodillo-bar-card.is-active {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
    border-color: #2563eb;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

.rodillo-machine-filter {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: grid;
    gap: 8px;
    padding: 0;
    text-align: left;
    width: 100%;
}

.rodillo-machine-filter.is-active,
.rodillo-head-chip.is-active {
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.rodillo-machine-filter span {
    color: #2563eb;
    font-size: 16px;
    font-weight: 900;
}

.rodillo-machine-filter strong {
    font-size: 24px;
}

.rodillo-machine-filter i {
    background: #e5eaf2;
    border-radius: 999px;
    display: block;
    height: 8px;
    overflow: hidden;
}

.rodillo-machine-filter b {
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.rodillo-machine-filter small {
    color: #475569;
    font-weight: 700;
}

.rodillos-head-map {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-top: 4px;
}

.rodillo-head-chip {
    background: #f1f5f9;
    border: 1px solid #d7e2f0;
    border-radius: 10px;
    color: #475569;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    min-height: 30px;
    padding: 6px 4px;
}

.rodillo-head-chip.is-busy {
    background: linear-gradient(135deg, #dbeafe, #ccfbf1);
    border-color: #60a5fa;
    color: #0f3f8f;
}

.rodillo-head-chip.is-active {
    box-shadow: 0 0 0 2px #2563eb;
    color: #1d4ed8;
}

.rodillos-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rodillos-history-panel .panel-head {
    align-items: center;
    gap: 12px;
}

.rodillos-filter-status {
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    gap: 8px;
    padding: 7px 8px 7px 12px;
}

.rodillos-filter-status[hidden] {
    display: none;
}

.rodillos-filter-status span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.rodillos-filter-status button {
    background: #2563eb;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
}

.rodillos-empty-filter td {
    color: #475569;
    font-weight: 800;
    text-align: center;
}

.rodillos-load-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 12px;
}

.rodillos-load-more {
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.18);
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    padding: 11px 18px;
}

.rodillos-load-more[hidden] {
    display: none;
}

.rodillos-table {
    border-collapse: separate;
    border-spacing: 0 8px;
    min-width: 720px;
    width: 100%;
}

.rodillos-table th {
    background: #eaf0f7;
    color: #12345b;
    font-size: 11px;
    padding: 10px 9px;
    text-align: left;
    text-transform: uppercase;
}

.rodillos-table td {
    background: #ffffff;
    border-bottom: 1px solid #d7e2f0;
    border-top: 1px solid #d7e2f0;
    padding: 10px 9px;
    vertical-align: middle;
}

.estiro-shell {
    color: #071226;
}

.estiro-hero {
    align-items: center;
    background:
        radial-gradient(circle at 90% 20%, rgba(34, 199, 184, 0.18), transparent 30%),
        linear-gradient(135deg, #ffffff, #f5f9ff);
    border: 1px solid #d4e1f0;
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin: 18px 0;
    padding: 22px;
}

.estiro-hero h1 {
    font-size: clamp(28px, 4vw, 44px);
    margin: 3px 0 8px;
}

.estiro-hero p {
    color: #41516b;
    margin: 0;
    max-width: 760px;
}

.estiro-print-btn {
    align-items: center;
    background: linear-gradient(135deg, #ff8a00, #f43f5e);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 16px 30px rgba(244, 63, 94, 0.24);
    color: #ffffff;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px;
}

.estiro-print-btn:hover {
    box-shadow: 0 18px 34px rgba(244, 63, 94, 0.32);
    transform: translateY(-1px);
}

.estiro-layout {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(260px, 340px) minmax(300px, 440px);
    justify-content: center;
    margin-bottom: 16px;
}

.estiro-form-panel,
.estiro-board-panel {
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
}

.estiro-linea-box {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.07)),
        #ffffff;
    border: 1px solid #bfd4f2;
    border-radius: 20px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 12px;
    margin: 14px 0 18px;
    max-width: 100%;
    overflow: hidden;
    padding: 14px;
    position: relative;
    width: 100%;
}

.estiro-linea-box::before {
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.estiro-linea-heading {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 10px;
    justify-content: space-between;
    padding: 0;
    text-align: left;
    width: 100%;
}

.estiro-linea-heading span {
    color: #12345b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.estiro-linea-heading strong {
    align-items: center;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    border-radius: 999px;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
    color: #ffffff;
    display: inline-flex;
    font-size: 14px;
    font-weight: 900;
    justify-content: center;
    min-width: 48px;
    padding: 8px 14px;
    position: relative;
}

.estiro-linea-heading strong::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    content: "";
    margin-left: 8px;
    transition: transform 0.16s ease;
}

.estiro-linea-box.open .estiro-linea-heading strong::after {
    transform: rotate(180deg);
}

.estiro-linea-picker {
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(190, 210, 235, 0.9);
    border-radius: 18px;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    padding: 8px;
}

.estiro-linea-picker[hidden] {
    display: none;
}

.estiro-linea-option {
    align-items: center;
    background:
        linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid #d4e1f2;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    color: #1d3557;
    cursor: pointer;
    display: flex;
    font: inherit;
    justify-content: space-between;
    min-height: 48px;
    padding: 10px 12px;
    position: relative;
    text-align: left;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.estiro-linea-option::before {
    background: #dbeafe;
    border-radius: 999px;
    content: "";
    height: 8px;
    left: 12px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
}

.estiro-linea-option span {
    color: #263b5b;
    font-size: 13px;
    font-weight: 900;
    padding-left: 18px;
}

.estiro-linea-option strong {
    align-items: center;
    background: #eef5ff;
    border: 1px solid #cfe0f7;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    justify-content: center;
    min-width: 42px;
    padding: 6px 10px;
}

.estiro-linea-option:hover {
    border-color: #2563eb;
    box-shadow: 0 12px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.estiro-linea-option.active {
    background:
        radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.28), transparent 30%),
        linear-gradient(135deg, #2563eb, #14b8a6);
    border-color: transparent;
    box-shadow: 0 14px 24px rgba(20, 184, 166, 0.22);
    color: #ffffff;
}

.estiro-linea-option.active::before {
    background: #ffffff;
}

.estiro-linea-option.active span,
.estiro-linea-option.active strong {
    color: #ffffff;
}

.estiro-linea-option.active strong {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.36);
}

.estiro-linea-option:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.26);
    outline-offset: 2px;
}

.estiro-percent-field,
.estiro-observacion {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.estiro-percent-field span,
.estiro-observacion span {
    color: #12345b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.estiro-percent-field input,
.estiro-observacion textarea {
    background: #f8fbff;
    border: 1px solid #bfd0e5;
    border-radius: 10px;
    color: #071226;
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

.estiro-percent-field strong {
    align-items: center;
    background: linear-gradient(135deg, #ecfdf5, #eff6ff);
    border: 1px solid #b7d8ff;
    border-radius: 10px;
    color: #0f766e;
    display: flex;
    font-size: 20px;
    font-weight: 900;
    min-height: 42px;
    padding: 10px 12px;
}

.estiro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.estiro-board-title {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
    text-align: center;
}

.estiro-board-title span {
    background: #dbeafe;
    border: 1px solid #b8d0ff;
    border-radius: 12px;
    color: #1d4ed8;
    font-weight: 900;
    padding: 8px 12px;
}

.estiro-board-title strong {
    color: #071226;
    font-size: 18px;
    letter-spacing: 0;
}

.estiro-tech-table-wrap {
    display: grid;
    gap: 8px;
    margin-inline: auto;
    max-width: 300px;
    width: 100%;
}

.estiro-tech-table {
    border-collapse: collapse;
    border-radius: 10px;
    font-size: 12px;
    overflow: hidden;
    table-layout: fixed;
    width: 100%;
}

.estiro-tech-table th,
.estiro-tech-table td {
    border: 1px solid #1f2d44;
    height: 26px;
    padding: 2px 4px;
    text-align: center;
    vertical-align: middle;
}

.estiro-tech-table thead th {
    background: #e5e7eb;
    color: #071226;
    font-weight: 900;
}

.estiro-blank {
    background: transparent !important;
    border-color: transparent !important;
}

.estiro-section-cell {
    background: #bfbfbf;
    color: #071226;
    font-weight: 900;
    text-transform: uppercase;
    width: 32%;
}

.estiro-label-cell {
    background: #edf1f5;
    color: #102033;
    font-weight: 800;
    width: 54px;
}

.estiro-gray {
    background: #bfbfbf;
}

.estiro-peach {
    background: #ffd8ba;
}

.estiro-tech-table input {
    background: transparent;
    border: 0;
    color: #001eff;
    font: inherit;
    font-weight: 800;
    height: 24px;
    padding: 0;
    text-align: center;
    width: 100%;
}

.estiro-tech-table input::placeholder {
    color: #6b7280;
    font-weight: 800;
    opacity: 0.72;
}

.estiro-tech-table input:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.estiro-tech-table input[readonly],
.estiro-formula-input {
    cursor: not-allowed;
    color: #001eff;
    font-weight: 900;
}

.estiro-total-row .estiro-label-cell,
.estiro-total-row .estiro-peach,
.estiro-total-row td,
.estiro-total-row input {
    color: #ff0000;
    font-weight: 900;
}

.estiro-samples {
    margin-bottom: 28px;
}

.estiro-samples > .panel-head {
    align-items: center;
    background:
        radial-gradient(circle at 92% 18%, rgba(20, 184, 166, 0.18), transparent 28%),
        linear-gradient(135deg, #f8fbff, #ffffff 62%);
    border: 1px solid #d7e5f7;
    border-radius: 16px;
    margin-bottom: 16px;
    padding: 16px;
}

.estiro-samples > .panel-head h2 {
    color: #071226;
    font-size: clamp(22px, 2.4vw, 32px);
    letter-spacing: 0;
    margin: 2px 0 4px;
}

.estiro-samples-subtitle {
    color: #52627a;
    font-size: 14px;
    margin: 0;
}

.estiro-samples-print-btn {
    align-items: center;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
    color: #ffffff;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px;
}

.estiro-samples-print-btn:hover {
    box-shadow: 0 18px 36px rgba(20, 184, 166, 0.28);
    transform: translateY(-1px);
}

.estiro-sample-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.estiro-sample-card {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #d6e2f0;
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 12px;
    padding: 14px;
}

.estiro-sample-card header {
    background: linear-gradient(135deg, #eef6ff, #ffffff 64%);
    border: 1px solid #dbe8ff;
    border-radius: 14px;
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    position: relative;
}

.estiro-sample-card header span {
    background: #e4efff;
    border: 1px solid #c7dcff;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    justify-self: start;
    padding: 4px 9px;
    text-transform: uppercase;
}

.estiro-sample-card header strong {
    color: #071226;
    font-size: 24px;
    letter-spacing: 0;
    line-height: 1.05;
}

.estiro-sample-card header small,
.estiro-note {
    color: #51627a;
}

.estiro-note {
    background: #f1f6ff;
    border: 1px solid #d9e6f8;
    border-radius: 10px;
    margin: 0;
    padding: 9px 10px;
}

.rodillos-table td:first-child {
    border-left: 4px solid #2563eb;
    border-radius: 12px 0 0 12px;
}

.rodillos-table td:last-child {
    border-radius: 0 12px 12px 0;
    border-right: 1px solid #d7e2f0;
}

.rodillos-table small {
    color: #475569;
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

.rodillo-state {
    background: #fee2e2;
    border-radius: 999px;
    color: #b91c1c;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    padding: 5px 10px;
}

.rodillo-state.active {
    background: #dcfce7;
    color: #047857;
}

.rodillo-retired-pill {
    align-items: center;
    background: linear-gradient(135deg, #fff7ed, #fee2e2);
    border: 1px solid #fecaca;
    border-radius: 11px;
    color: #991b1b;
    display: inline-flex;
    flex-direction: column;
    font-size: 11px;
    font-weight: 900;
    gap: 1px;
    justify-content: center;
    line-height: 1.15;
    min-height: 34px;
    padding: 6px 9px;
    text-transform: uppercase;
}

.rodillo-retired-pill small {
    color: #7f1d1d;
    display: block;
    font-size: 9px;
    font-weight: 800;
    margin-top: 1px;
    text-transform: none;
    white-space: nowrap;
}

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

    .rodillos-form .rodillos-span-2,
    .rodillos-form .rodillos-submit {
        grid-column: 1 / -1;
    }

    .rodillos-form textarea {
        height: auto;
        min-height: 76px;
    }
}

@media (max-width: 980px) {
    .rodillos-grid,
    .rodillos-kpis,
    .rodillos-chart-panel {
        grid-template-columns: 1fr;
    }

    .rodillos-right-stack {
        gap: 14px;
    }

    .rodillos-hero {
        align-items: flex-start;
        gap: 20px;
        grid-template-columns: 1fr;
    }

    .rodillos-hero-media {
        min-height: 150px;
        width: 100%;
    }

    .rodillos-hero-media img {
        max-height: 170px;
    }
}

@media (max-width: 640px) {
    .rodillos-shell {
        padding: 10px;
    }

    .rodillos-hero {
        border-radius: 14px;
        margin: 12px 0;
        min-height: 0;
        padding: 18px;
    }

    .rodillos-hero-media {
        border-radius: 14px;
        min-height: 120px;
        padding: 8px;
    }

    .rodillos-hero-media img {
        max-height: 135px;
    }

    .rodillos-form,
    .rodillos-bars,
    .estiro-layout {
        grid-template-columns: 1fr;
    }

    .estiro-hero {
        align-items: flex-start;
        flex-direction: column;
        margin: 12px 0;
        padding: 16px;
    }

    .estiro-linea-box {
        padding: 13px;
    }

    .estiro-linea-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .estiro-linea-heading strong {
        min-width: 64px;
    }

    .estiro-linea-picker {
        grid-template-columns: 1fr;
    }

    .estiro-linea-option {
        min-height: 48px;
    }

    .estiro-sample-grid {
        grid-template-columns: 1fr;
    }

    .estiro-tech-table {
        font-size: 12px;
    }

    .estiro-tech-table th,
    .estiro-tech-table td {
        height: 28px;
        padding: 3px 4px;
    }

    .rodillo-machine-tab {
        min-height: 58px;
        padding: 8px;
    }

    .rodillo-map-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .rodillo-overlay-head {
        font-size: 10px;
        height: clamp(20px, 5.8vw, 28px);
        width: clamp(20px, 5.8vw, 28px);
        border-width: 2px;
    }

    .rodillo-model-toggle {
        display: none;
    }

    .rodillos-history-panel {
        margin-top: 12px;
        padding: 12px;
    }

    .rodillos-history-panel .panel-head {
        align-items: stretch;
        background: rgba(248, 251, 255, 0.94);
        border-bottom: 1px solid #d7e2f0;
        flex-direction: column;
        margin: -12px -12px 12px;
        padding: 12px;
        position: sticky;
        top: 0;
        z-index: 4;
    }

    .rodillos-filter-status {
        border-radius: 14px;
        justify-content: space-between;
        width: 100%;
    }

    .rodillos-table-wrap {
        overflow: visible;
    }

    .rodillos-table {
        border-collapse: separate;
        border-spacing: 0 7px;
        min-width: 0;
    }

    .rodillos-table thead {
        display: none;
    }

    .rodillos-table tbody {
        display: table-row-group;
    }

    .rodillos-table tr {
        display: grid;
        grid-template-columns: 50px 46px minmax(0, 1fr) 94px;
        gap: 0;
        align-items: stretch;
        background: linear-gradient(135deg, #ffffff, #f7fbff);
        border: 1px solid #cfe0f4;
        border-left: 4px solid #2563eb;
        border-radius: 13px;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
        margin-bottom: 7px;
        min-height: 58px;
        overflow: hidden;
    }

    .rodillos-table tr[hidden] {
        display: none;
    }

    .rodillos-table td {
        align-items: center;
        background: transparent;
        border: 0;
        display: none;
        min-width: 0;
        padding: 8px 7px;
    }

    .rodillos-table td::before {
        display: none;
    }

    .rodillos-table td[data-label="Maquina"],
    .rodillos-table td[data-label="Cabezal"],
    .rodillos-table td[data-label="Instalado"],
    .rodillos-table td[data-label="Accion"] {
        display: flex;
    }

    .rodillos-table td[data-label="Maquina"] {
        color: #1d4ed8;
        font-size: 12px;
        font-weight: 900;
        justify-content: center;
    }

    .rodillos-table td[data-label="Cabezal"] {
        background: #eef6ff;
        color: #0f172a;
        font-size: 12px;
        font-weight: 900;
        justify-content: center;
    }

    .rodillos-table td[data-label="Instalado"] {
        align-items: flex-start;
        flex-direction: column;
        font-size: 12px;
        font-weight: 800;
        justify-content: center;
        line-height: 1.25;
        overflow: hidden;
    }

    .rodillos-table td[data-label="Instalado"]::after {
        color: #64748b;
        content: "Instalacion";
        display: block;
        font-size: 10px;
        font-weight: 900;
        margin-top: 2px;
        text-transform: uppercase;
    }

    .rodillos-table td:first-child {
        border: 0;
        border-radius: 0;
    }

    .rodillos-table td:last-child {
        border: 0;
        border-radius: 0;
    }

    .rodillos-table td[data-label="Accion"] {
        align-items: center;
        justify-content: center;
        padding-left: 5px;
        padding-right: 6px;
    }

    .rodillos-table td[data-label="Accion"] .btn {
        min-height: 34px;
        padding: 8px 10px;
        white-space: nowrap;
    }

    .rodillos-table td[data-label="Accion"] .rodillo-retired-pill {
        border-radius: 10px;
        font-size: 10px;
        min-height: 42px;
        padding: 5px 6px;
        width: 100%;
    }

    .rodillos-table td[data-label="Accion"] .rodillo-retired-pill small {
        font-size: 8px;
        line-height: 1.15;
        max-width: 78px;
        text-align: center;
        white-space: normal;
    }

    .rodillos-empty-filter {
        grid-template-columns: 1fr;
    }

    .rodillos-no-data {
        grid-template-columns: 1fr;
    }

    .rodillos-no-data td,
    .rodillos-empty-filter td {
        display: flex;
        justify-content: center;
        min-height: 58px;
        text-align: center;
    }

    .rodillos-no-data td::before,
    .rodillos-empty-filter td::before {
        display: none;
    }

    .rodillos-load-more-wrap {
        padding-top: 8px;
    }

    .rodillos-load-more {
        border-radius: 12px;
        width: 100%;
    }
}

@media (max-width: 460px) {
    .rodillos-machine-tabs {
        grid-template-columns: 1fr;
    }

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

    .rodillo-machine-canvas img {
        min-height: 150px;
    }
}

@media (max-width: 380px) {
    .site-navlink {
        flex-basis: auto;
        font-size: 10px;
    }

    .role-editor-actions .btn {
        flex-basis: 100%;
    }

    .role-editor-toolbar {
        max-height: 48vh;
    }

    .role-page-shell {
        padding-bottom: 310px;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 6mm;
    }

    body {
        background: #ffffff;
        padding: 0;
    }

    .no-print,
    .site-navbar {
        display: none !important;
    }

    .role-page-shell {
        max-width: none;
        padding: 0;
    }

    .role-personal-sheet {
        border: 1px solid #5d742d;
        border-radius: 0;
        box-shadow: none;
        height: auto;
        overflow: visible;
        margin: 0 auto;
        min-height: 285mm;
        padding: 6mm 7mm;
        width: 195mm;
    }

    .role-personal-title {
        box-sizing: border-box;
        margin-bottom: 7px;
        min-width: 0;
        padding: 5px 8px;
        width: 100%;
    }

    .role-personal-title div {
        gap: 30px;
    }

    .role-personal-title h1 {
        font-size: 28.8px;
        margin-top: 2px;
    }

    .role-personal-title span,
    .role-personal-title strong {
        font-size: 16.1px;
    }

    .role-personal-grid {
        gap: 7px 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }

    .role-team-card {
        align-items: start;
        break-inside: avoid;
        grid-template-columns: 17mm minmax(0, 1fr);
        min-width: 0;
    }

    .role-team-label {
        font-size: 12px;
        padding: 3px;
    }

    .role-team-label span {
        margin-top: 3px;
    }

    .role-person-row,
    .role-redoble,
    .role-summary-card div {
        font-size: 10.6px;
        line-height: 1.05;
        min-height: 13px;
    }

    .role-team-table,
    .role-dropzone {
        min-height: 0;
    }

    .role-person-row {
        grid-template-columns: 18mm minmax(0, 1fr);
    }

    .role-person-code,
    .role-person-name {
        padding: 1px 3px;
    }

    .role-redoble {
        padding: 1px 3px;
    }

    .role-team-count {
        font-size: 11.5px;
        min-height: 13px;
    }

    .role-summary-card div {
        grid-template-columns: minmax(0, 1fr) 22mm;
    }

    .role-summary-card span,
    .role-summary-card strong {
        padding: 1px 3px;
    }

    .role-extra-descanso,
.role-extra-vacaciones {
    grid-column: 2;
}

    .puestos-shell {
        max-width: none;
        padding: 0;
    }

    .puestos-shell > .dashboard-hero,
    .puestos-list-panel,
    .puestos-form-grid,
    .puestos-editor-panel > .summary-head,
    .puestos-status {
        display: none !important;
    }

    .puestos-layout,
    .puestos-editor-panel {
        display: block !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .puestos-table-wrap {
        overflow: visible !important;
    }

    .puestos-table {
        min-width: 0 !important;
        width: 100% !important;
    }

    .puestos-table th,
    .puestos-table td {
        border: 1.8px solid #222 !important;
        height: 32px !important;
    }

    .puestos-table input,
    .puestos-table tbody th {
        font-size: 18px !important;
    }

    .puestos-table thead th {
        font-size: 20px !important;
    }

    .puestos-table thead tr:first-child th {
        font-size: 18px !important;
        height: 30px !important;
    }

    .puestos-integrado-grid,
    .puestos-split-field {
        min-height: 32px !important;
    }

}

.historial-shell {
    max-width: 1320px;
}

.historial-hero {
    overflow: hidden;
    position: relative;
}

.historial-hero::after {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(20, 184, 166, 0.14));
    border-radius: 999px;
    content: "";
    height: 180px;
    position: absolute;
    right: -80px;
    top: -95px;
    width: 180px;
}

.historial-search {
    margin-bottom: 18px;
}

.historial-form {
    align-items: end;
    grid-template-columns: minmax(240px, 1fr) auto;
}

.historial-metrics {
    margin-bottom: 18px;
}

.historial-timeline {
    display: grid;
    gap: 16px;
}

.historial-card {
    background: #ffffff;
    border: 1px solid #cfdae8;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.historial-card-head {
    align-items: center;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.07)),
        #f8fbff;
    border-bottom: 1px solid #dbe5f2;
    cursor: pointer;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 16px 18px;
}

.historial-card-head::-webkit-details-marker {
    display: none;
}

.historial-card-head::marker {
    content: "";
}

.historial-card[open] .historial-card-head {
    border-bottom-color: #cbd8ea;
}

.historial-card:not([open]) .historial-card-head {
    border-bottom: 0;
}

.historial-card:not([open]) .historial-toggle {
    background: #e8f0ff;
    color: #2563eb;
}

.historial-card:not([open]) .historial-toggle::before {
    content: "Ver cambios";
}

.historial-card[open] .historial-toggle::before {
    content: "Minimizar";
}

.historial-toggle {
    align-items: center;
    background: #eef2f7;
    border: 1px solid #d8e2ef;
    border-radius: 999px;
    color: #475569;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    justify-content: center;
    min-width: 96px;
    padding: 7px 10px;
}

.historial-toggle {
    font-size: 0;
}

.historial-toggle::before {
    font-size: 12px;
}

.historial-card-head h2 {
    font-size: 20px;
    margin: 4px 0;
}

.historial-card-head p {
    color: #4b5f7c;
    margin: 0;
}

.historial-step {
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.historial-head-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.historial-change-count {
    background: #ecfdf5;
    border: 1px solid #b7ebd1;
    border-radius: 999px;
    color: #066447;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
    white-space: nowrap;
}

.historial-base-note,
.historial-no-changes,
.historial-motivo {
    margin: 16px 18px;
}

.historial-base-note,
.historial-no-changes {
    background: #f8fafc;
    border: 1px dashed #b8c7dc;
    border-radius: 12px;
    color: #334155;
    padding: 15px;
}

.historial-no-changes {
    background: #ecfdf5;
    border-color: #b7ebd1;
    color: #066447;
}

.historial-motivo {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    display: grid;
    gap: 6px;
    padding: 14px 16px;
}

.historial-motivo span {
    color: #9a3412;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.historial-motivo strong {
    color: #172033;
    font-size: 15px;
}

.historial-motivo em {
    color: #52627a;
    font-size: 12px;
    font-style: normal;
}

.historial-events {
    display: grid;
    gap: 16px;
    padding: 16px 18px 18px;
}

.historial-change-event {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.04), rgba(255, 255, 255, 0)),
        #ffffff;
    border: 1px solid #d7e2f0;
    border-left: 4px solid #2563eb;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.historial-change-event-head {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
}

.historial-change-event-head span {
    color: #2563eb;
    display: block;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.historial-change-event-head strong {
    color: #0f172a;
    display: block;
    font-size: 15px;
    margin-top: 3px;
}

.historial-change-event-head small {
    color: #52627a;
    font-size: 12px;
    white-space: nowrap;
}

.historial-change-event .historial-motivo {
    margin: 14px;
}

.historial-change-event .historial-ficha-grid {
    padding: 0 14px 14px;
}

.historial-change-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 18px 18px;
}

.historial-section-card {
    background: #f8fafc;
    border: 1px solid #d7e2f0;
    border-radius: 12px;
    overflow: hidden;
}

.historial-section-card h3 {
    background: #111827;
    color: #ffffff;
    font-size: 14px;
    margin: 0;
    padding: 10px 12px;
}

.historial-table-wrap {
    padding: 10px;
}

.historial-table,
.historial-mini-table {
    border-collapse: collapse;
    width: 100%;
}

.historial-table th,
.historial-table td,
.historial-mini-table th,
.historial-mini-table td {
    border: 1px solid #1f2a3d;
    font-size: 12px;
    padding: 6px 8px;
    text-align: center;
}

.historial-table th,
.historial-mini-table th {
    background: #e8eef6;
    font-weight: 800;
}

.historial-table td:first-child,
.historial-mini-table td:first-child {
    background: #d7dee8;
    font-weight: 700;
    text-align: left;
}

.historial-value-new {
    background: #ffd8b8;
    color: #e11d00;
    font-weight: 800;
}

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

.historial-ficha-grid-one {
    grid-template-columns: 1fr;
}

.historial-process-title {
    background: #111827;
    border-radius: 10px 10px 0 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.04em;
    margin-top: 4px;
    padding: 10px 14px;
    text-align: center;
    text-transform: uppercase;
}

.historial-subtitle {
    align-items: center;
    color: #12345b;
    display: flex;
    font-size: 13px;
    font-weight: 900;
    gap: 10px;
    letter-spacing: 0.04em;
    margin-top: 2px;
    text-transform: uppercase;
}

.historial-subtitle::after {
    background: #d6e0ee;
    content: "";
    flex: 1;
    height: 1px;
}

.historial-ficha-stack {
    display: grid;
    gap: 10px;
}

.historial-ficha-table {
    border-collapse: collapse;
    table-layout: fixed;
    max-width: 760px;
    width: 100%;
}

.historial-ficha-table td,
.historial-ficha-table th {
    border: 1px solid #1f2a3d;
    color: #00152f;
    font-size: 12px;
    font-weight: 600;
    height: 25px;
    line-height: 1.1;
    padding: 3px 6px;
    text-align: center;
    vertical-align: middle;
}

.historial-ficha-compact {
    align-self: start;
    max-width: 620px;
}

.historial-ficha-compact td,
.historial-ficha-compact th {
    height: 24px;
    padding: 3px 6px;
}

.historial-ficha-compact .historial-section-label {
    width: 33%;
}

.historial-table-title-row td {
    background: #f1f5f9;
    color: #12345b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.historial-ficha-table .historial-section-label {
    font-size: 12px;
    font-weight: 800;
    overflow-wrap: anywhere;
    text-transform: uppercase;
    white-space: normal;
    width: 24%;
    word-break: break-word;
}

.historial-section-label-wrap {
    font-size: clamp(9px, 1.1vw, 10.5px) !important;
    letter-spacing: 0;
    line-height: 1.1 !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
}

.historial-bg-gray {
    background: #bfbfbf;
}

.historial-bg-light {
    background: #e8e8e8;
}

.historial-bg-peach {
    background: #ffd4b1;
}

.historial-text-red {
    color: #ff0000 !important;
    font-weight: 800 !important;
}

.historial-ficha-blue {
    color: #0000ff !important;
    font-weight: 800 !important;
}

.historial-ficha-machine {
    border: 0 !important;
    color: #ff0000 !important;
    font-weight: 800 !important;
}

.historial-no-border {
    background: transparent !important;
    border: 0 !important;
}

.historial-ficha-alert,
.historial-ficha-changed {
    box-shadow: inset 0 0 0 2px rgba(255, 0, 0, 0.16);
}

.historial-ficha-muted {
    box-shadow: none !important;
    color: #071226 !important;
    font-weight: 700 !important;
}

.historial-change-layout td,
.historial-change-layout th {
    min-width: 58px;
}

.historial-snapshot {
    border-top: 1px solid #dbe5f2;
    padding: 0 18px 18px;
}

.historial-snapshot summary {
    color: #2563eb;
    cursor: pointer;
    font-weight: 800;
    padding: 14px 0;
}

.historial-snapshot-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.historial-empty {
    background: #ffffff;
    border: 1px solid #d7e2f0;
    border-radius: 14px;
    display: grid;
    gap: 6px;
    padding: 20px;
}

@media (max-width: 900px) {
    .historial-form,
    .historial-change-grid,
    .historial-ficha-grid,
    .historial-snapshot-grid {
        grid-template-columns: 1fr;
    }

    .historial-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .historial-head-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .historial-shell {
        padding: 10px;
    }

    .historial-card-head,
    .historial-change-grid,
    .historial-events,
    .historial-snapshot {
        padding-left: 12px;
        padding-right: 12px;
    }

    .historial-base-note,
    .historial-no-changes,
    .historial-motivo {
        margin-left: 12px;
        margin-right: 12px;
    }

    .historial-table-wrap,
    .historial-ficha-grid,
    .historial-snapshot-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .historial-table,
    .historial-ficha-table,
    .historial-mini-table {
        min-width: 360px;
    }
}

@media print {
    .estiro-shell {
        max-width: none;
        padding: 0;
    }

    .estiro-hero,
    .estiro-layout {
        display: none !important;
    }

    .estiro-samples {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .estiro-sample-grid {
        display: grid;
        gap: 3mm;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .estiro-sample-card {
        break-inside: avoid;
        box-shadow: none;
        gap: 2mm;
        padding: 2.4mm;
    }

    .estiro-sample-card header {
        border-radius: 3mm;
        gap: 1mm;
        padding: 2.2mm 2.5mm;
    }

    .estiro-sample-card header span {
        font-size: 8.5px;
        padding: 1mm 2mm;
    }

    .estiro-sample-card header strong {
        font-size: 16px;
    }

    .estiro-sample-card header small,
    .estiro-note {
        font-size: 8px;
    }

    .estiro-tech-table-wrap {
        gap: 2mm;
        max-width: none;
    }

    .estiro-tech-table {
        font-size: 8.7px;
    }

    .estiro-tech-table th,
    .estiro-tech-table td {
        height: 15px;
        padding: 1px 2px;
    }

    .estiro-tech-table input {
        height: 14px;
    }
}
