body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #eef3f9;
    color: #1a2533;
}

body.login-page {
    overflow: hidden;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: #1565d8;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

button,
.button,
input,
select {
    font: inherit;
}

.shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: linear-gradient(90deg, #1954a6 0%, #22a7ea 100%);
    color: #fff;
    box-shadow: 0 10px 25px rgba(16, 51, 102, 0.18);
    box-sizing: border-box;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 42px;
}

.brand strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1.1;
}

.brand p {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
}

.menu-toggle {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 1.7rem;
    cursor: pointer;
    flex: 0 0 46px;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.welcome-pill,
.role-pill {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
}

.role-pill {
    background: rgba(255, 255, 255, 0.28);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(6, 20, 40, 0.46);
}

.drawer {
    position: fixed;
    top: 0;
    left: -310px;
    z-index: 1050;
    width: 290px;
    height: 100vh;
    padding: 28px 22px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #103b72 0%, #0b2548 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0 20px 40px rgba(5, 18, 36, 0.35);
    transition: left 0.25s ease;
}

.drawer.is-open {
    left: 0;
}

.drawer h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.muted-sidebar {
    margin: 0 0 6px;
    color: #d7e5f8;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.85rem;
}

.menu {
    display: grid;
    gap: 12px;
}

.menu a {
    display: block;
    padding: 13px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
}

.menu a:hover {
    background: rgba(255, 255, 255, 0.18);
}

.content {
    padding: 28px;
    box-sizing: border-box;
}

.content-with-topbar {
    padding-top: 26px;
}

.dashboard-stack,
.admin-stack {
    display: grid;
    gap: 28px;
}

.feature-split {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
    gap: 24px;
    align-items: start;
}

.feature-column {
    display: grid;
    gap: 24px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.stat,
.card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 14px 35px rgba(17, 56, 111, 0.08);
}

.stat {
    padding: 24px;
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    color: #102848;
}

.card {
    padding: 24px;
}

.card h2,
.card h3 {
    margin-top: 0;
    color: #102848;
}

.helper-text {
    margin-top: 0;
    margin-bottom: 18px;
    color: #4a5a70;
    line-height: 1.5;
}

.feature-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.summary-box {
    padding: 16px;
    border: 1px solid #dbe6f2;
    border-radius: 14px;
    background: #fff;
}

.summary-box span {
    display: block;
    color: #5a6c84;
    font-size: 0.95rem;
}

.summary-box strong {
    display: block;
    margin-top: 8px;
    font-size: 1.9rem;
    color: #102848;
}

.summary-box-wide {
    grid-column: 1 / -1;
}

.summary-box-date {
    font-size: 1.15rem;
    line-height: 1.4;
}

.info-note {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(21, 101, 216, 0.08);
    color: #26456c;
}

.info-note strong {
    display: block;
    margin-bottom: 8px;
    color: #163f79;
}

.info-note p {
    margin: 0;
    line-height: 1.5;
}

.rules-list {
    display: grid;
    gap: 14px;
}

.rule-item {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid #dbe6f2;
    background: #fff;
}

.rule-item strong {
    display: block;
    margin-bottom: 8px;
    color: #163f79;
}

.rule-item p {
    margin: 0;
    color: #4d5f77;
    line-height: 1.5;
}

.rule-item code {
    padding: 2px 6px;
    border-radius: 8px;
    background: #edf4ff;
    color: #163f79;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
}

.alert-success {
    background: #dff6e8;
    color: #1a6a3b;
}

.alert-error {
    background: #fde5e5;
    color: #a12828;
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd8e6;
    border-radius: 12px;
    box-sizing: border-box;
    background: #fff;
}

button,
.button {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    background: #1565d8;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

button.secondary,
.button.secondary {
    background: #e9f0fb;
    color: #163f79;
}

.danger {
    background: #c53b3b;
}

.actions,
.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.separator {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid #e2eaf3;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: auto;
}

.filter-form {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #dce5ef;
    border-radius: 14px;
    background: #f7fafe;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.filter-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.employee-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mass-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.mass-summary-item {
    padding: 18px;
    border-radius: 14px;
    background: #f7fafe;
    border: 1px solid #dce5ef;
}

.mass-summary-item span {
    display: block;
    color: #5a6c84;
}

.mass-summary-item strong {
    display: block;
    margin-top: 8px;
    font-size: 1.8rem;
    color: #102848;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid #e7edf5;
    vertical-align: top;
}

th {
    color: #102848;
}

.inline-details {
    border: 1px solid #dce5ef;
    border-radius: 12px;
    padding: 8px 10px;
    background: #f8fbff;
}

.inline-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #163f79;
}

.inline-form {
    margin-top: 12px;
    min-width: 220px;
}

.login-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top, #5ca4ff 0%, #0c2749 55%, #08172b 100%);
    box-sizing: border-box;
    overflow: hidden;
}

.login-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 22px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(4, 21, 43, 0.25);
    text-align: center;
}

.login-card h1 {
    margin-top: 0;
}

.login-card p {
    margin-bottom: 24px;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.login-logo {
    width: 92px;
    height: auto;
    object-fit: contain;
}

.login-card form {
    text-align: left;
}

@media (max-width: 900px) {
    .topbar {
        padding: 10px 12px;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .topbar-user {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    .brand {
        width: 100%;
        gap: 10px;
    }

    .brand strong {
        font-size: 1.15rem;
    }

    .brand p {
        font-size: 0.8rem;
    }

    .topbar-logo {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        font-size: 1.5rem;
    }

    .welcome-pill,
    .role-pill {
        min-height: 34px;
        padding: 0 12px;
        font-size: 0.92rem;
    }

    .stats,
    .feature-split,
    .grid-2,
    .summary-grid,
    .mass-summary,
    .filter-grid,
    .filter-grid-4 {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 18px;
    }

    .drawer {
        width: min(290px, calc(100vw - 24px));
    }

    .table-responsive {
        overflow-x: visible;
    }

    .responsive-table {
        border-collapse: separate;
        width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: grid;
        gap: 14px;
    }

    .responsive-table tr {
        display: block;
        padding: 14px;
        border: 1px solid #e4ebf3;
        border-radius: 14px;
        background: #fbfdff;
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: minmax(92px, 110px) minmax(0, 1fr);
        gap: 10px;
        padding: 10px 0;
        border: 0;
        align-items: start;
        word-break: break-word;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #163f79;
    }

    .responsive-table td:last-child {
        padding-bottom: 0;
    }

    .responsive-table td:last-child .button,
    .responsive-table td:last-child button {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .table-actions {
        width: 100%;
    }

    .table-actions > * {
        width: 100%;
    }

    .inline-details summary {
        display: block;
    }

    .inline-form {
        min-width: 0;
    }

    .responsive-table td[data-label="Acción"] {
        grid-template-columns: 1fr;
    }

    .responsive-table td[data-label="Acción"]::before {
        margin-bottom: 4px;
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 10px;
    }

    .brand p {
        display: none;
    }

    .welcome-pill,
    .role-pill {
        font-size: 0.85rem;
    }

    .content {
        padding: 14px;
    }

    .card {
        padding: 18px;
    }

    .login-wrap {
        padding: 16px;
        min-height: 100svh;
        height: 100svh;
    }

    .login-card {
        width: min(100%, 390px);
        padding: 24px 20px;
    }
}
