:root {
    --riflo-orange: #F58634;
    --riflo-orange-rgb: 245, 134, 52;
    --riflo-orange-dark: #B35408;
    --riflo-orange-dark-rgb: 179, 84, 8;
    --riflo-graphite: #373435;
    --riflo-graphite-rgb: 55, 52, 53;
    --riflo-yellow: #FFF212;
    --riflo-yellow-rgb: 255, 242, 18;
    --riflo-red: #ED3237;
    --riflo-red-rgb: 237, 50, 55;
    --riflo-ochre: #B98845;
    --riflo-ochre-rgb: 185, 136, 69;
    --riflo-gray: #A9ABAE;
    --riflo-gray-rgb: 169, 171, 174;
    --riflo-white: #FFFFFF;
    --surface: var(--riflo-white);
    --surface-soft: #f7f7f6;
    --surface-warm: rgba(var(--riflo-orange-rgb), 0.08);
    --line: rgba(var(--riflo-gray-rgb), 0.58);
    --text: var(--riflo-graphite);
    --muted: rgba(var(--riflo-graphite-rgb), 0.74);
    --primary: var(--riflo-orange);
    --primary-dark: var(--riflo-orange-dark);
    --success-soft: rgba(var(--riflo-orange-rgb), 0.13);
    --warning-soft: rgba(var(--riflo-yellow-rgb), 0.28);
    --danger-soft: rgba(var(--riflo-red-rgb), 0.12);
    --bs-primary: var(--riflo-orange);
    --bs-primary-rgb: var(--riflo-orange-rgb);
    --bs-danger: var(--riflo-red);
    --bs-danger-rgb: var(--riflo-red-rgb);
    --bs-warning: var(--riflo-yellow);
    --bs-warning-rgb: var(--riflo-yellow-rgb);
    --bs-body-color: var(--riflo-graphite);
    --bs-border-color: var(--line);
}

body {
    background: var(--surface-soft);
    color: var(--text);
    font-size: 15px;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-x: hidden;
    background:
        linear-gradient(145deg, rgba(var(--riflo-orange-rgb), 0.18) 0 16%, transparent 16.2%),
        linear-gradient(315deg, rgba(var(--riflo-orange-dark-rgb), 0.12) 0 12%, transparent 12.2%),
        linear-gradient(135deg, rgba(var(--riflo-gray-rgb), 0.18), rgba(var(--riflo-orange-rgb), 0.08));
}

.auth-shell {
    width: min(100%, 1100px);
}

.auth-card,
.panel {
    background: var(--surface);
    border: 1px solid rgba(var(--riflo-graphite-rgb), 0.10);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(var(--riflo-graphite-rgb), 0.08);
}

.auth-card {
    max-width: 460px;
    margin: 0 auto;
    padding: 28px;
}

.mfa-setup-card {
    max-width: 760px;
}

.mfa-setup-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 22px;
}

.mfa-qr-panel {
    display: grid;
    place-items: center;
    padding: 14px;
    border: 1px solid rgba(var(--riflo-orange-rgb), 0.38);
    border-radius: 8px;
    background: var(--riflo-white);
}

.mfa-qr-code {
    width: min(100%, 210px);
    height: auto;
    display: block;
    fill: var(--riflo-graphite);
    shape-rendering: crispEdges;
}

.mfa-qr-bg {
    fill: var(--riflo-white);
}

.mfa-setup-copy p {
    color: var(--muted);
}

.mfa-setup-copy dl {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 6px 12px;
    margin: 0 0 14px;
}

.mfa-setup-copy dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.mfa-setup-copy dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.mfa-secret-field {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    letter-spacing: 0;
}

.login-card {
    display: grid;
    grid-template-columns: minmax(390px, 0.92fr) minmax(0, 1.08fr);
    min-height: 612px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(var(--riflo-orange-dark-rgb), 0.16);
    border-radius: 16px;
    box-shadow: 0 24px 58px rgba(var(--riflo-graphite-rgb), 0.18);
}

.login-hero {
    position: relative;
    min-height: 612px;
    background-image:
        linear-gradient(135deg, rgba(var(--riflo-orange-dark-rgb), 0.90), rgba(var(--riflo-red-rgb), 0.58)),
        url("/assets/img/login-mining.png");
    background-size: cover;
    background-position: center;
    isolation: isolate;
}

.login-hero::before,
.login-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-hero::before {
    background:
        linear-gradient(120deg, rgba(var(--riflo-orange-rgb), 0.42), transparent 42%),
        linear-gradient(0deg, rgba(var(--riflo-graphite-rgb), 0.16), rgba(var(--riflo-graphite-rgb), 0.04));
}

.login-hero::after {
    right: auto;
    bottom: auto;
    width: 56%;
    height: 140%;
    left: -30%;
    top: -20%;
    border-radius: 50%;
    border: 28px solid rgba(255, 255, 255, 0.10);
}

.login-hero-overlay {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 14px;
    padding: 54px;
    text-align: center;
    color: var(--riflo-white);
}

.login-hero-mark {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 34px rgba(var(--riflo-graphite-rgb), 0.22);
}

.login-hero-mark img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.login-hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.1rem);
    line-height: 1;
    font-weight: 800;
    text-transform: uppercase;
}

.login-hero p {
    margin: 0;
    max-width: 440px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
    line-height: 1.55;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 54px 56px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94)),
        linear-gradient(135deg, rgba(var(--riflo-orange-rgb), 0.06), transparent);
}

.login-brand {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-bottom: 28px;
    text-align: center;
}

.login-brand span {
    color: rgba(var(--riflo-graphite-rgb), 0.76);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-brand img {
    width: min(100%, 270px);
    max-height: 74px;
    object-fit: contain;
}

.login-panel .auth-logo p,
.login-title p {
    margin: 4px 0 0;
    color: var(--muted);
}

.login-logo-frame {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.login-logo-image {
    width: 54px;
    height: 54px;
    display: block;
    object-fit: contain;
}

.login-title {
    margin-bottom: 26px;
    text-align: center;
}

.login-title h2 {
    margin: 0 0 8px;
    color: var(--riflo-graphite);
    font-size: 1.65rem;
    line-height: 1.15;
    font-weight: 800;
}

.login-panel .form-label {
    color: var(--riflo-graphite);
    font-weight: 700;
}

.login-field .form-label {
    margin-left: 18px;
    font-size: 0.82rem;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap svg {
    position: absolute;
    left: 17px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: rgba(var(--riflo-graphite-rgb), 0.54);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    pointer-events: none;
}

.login-panel .form-control {
    min-height: 48px;
    padding-left: 48px;
    border-color: rgba(var(--riflo-gray-rgb), 0.48);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 20px rgba(var(--riflo-graphite-rgb), 0.05);
}

.login-panel .form-control:focus {
    border-color: var(--riflo-orange);
    box-shadow: 0 0 0 0.2rem rgba(var(--riflo-orange-rgb), 0.20);
}

.login-panel .btn-primary {
    min-height: 48px;
    margin-top: 8px;
    border-radius: 999px;
    border-color: var(--riflo-orange);
    background: linear-gradient(135deg, var(--riflo-orange), var(--riflo-orange-dark));
    color: var(--riflo-graphite);
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(var(--riflo-orange-dark-rgb), 0.24);
}

.login-panel .btn-primary:hover {
    border-color: var(--riflo-orange-dark);
    background: var(--riflo-orange-dark);
    color: var(--riflo-white);
}

.login-field .invalid-feedback {
    display: block;
    margin-left: 18px;
}

.auth-logo,
.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.auth-logo {
    margin-bottom: 28px;
}

.auth-logo h1 {
    font-size: 1.45rem;
    line-height: 1.1;
    margin: 0;
}

.auth-logo p,
.auth-note,
.auth-help span,
.sidebar-brand small,
.page-header p,
.kpi-card small,
.user-summary small {
    color: var(--muted);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: var(--riflo-graphite);
    color: var(--riflo-white);
    font-weight: 700;
    letter-spacing: 0;
    flex: 0 0 auto;
}

.auth-help {
    margin-top: 22px;
    display: grid;
    gap: 4px;
    font-size: 0.9rem;
}

.auth-note {
    margin-top: 18px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    transition: grid-template-columns 240ms cubic-bezier(0.175, 0.885, 0.32, 1);
}

.sidebar {
    background: var(--riflo-graphite);
    color: var(--riflo-white);
    padding: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    transition: padding 240ms cubic-bezier(0.175, 0.885, 0.32, 1);
}

.sidebar .brand-mark {
    background: var(--riflo-orange);
    color: var(--riflo-graphite);
}

.sidebar-brand {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    min-width: 0;
}

.sidebar-brand-text {
    min-width: 0;
    max-width: 158px;
    opacity: 1;
    transform: translateX(0);
    transition:
        opacity 180ms ease,
        transform 220ms cubic-bezier(0.175, 0.885, 0.32, 1),
        max-width 240ms cubic-bezier(0.175, 0.885, 0.32, 1);
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand small {
    color: rgba(255, 255, 255, 0.65);
}

.sidebar-collapse-toggle {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--riflo-orange);
    border-radius: 10px;
    background: var(--riflo-orange);
    color: var(--riflo-graphite);
    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        transform 240ms cubic-bezier(0.175, 0.885, 0.32, 1);
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus {
    background: var(--riflo-orange-dark);
    border-color: var(--riflo-orange-dark);
    color: var(--riflo-white);
}

.sidebar-collapse-toggle .sidebar-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
    transition: transform 240ms cubic-bezier(0.175, 0.885, 0.32, 1);
}

.sidebar-mobile-close,
.sidebar-backdrop {
    display: none;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    margin-top: 22px;
    padding-bottom: 14px;
}

.sidebar-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(var(--riflo-orange-rgb), 0.62);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--riflo-orange-rgb), 0.86);
}

.sidebar-section {
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: 12px 12px 2px;
    text-transform: uppercase;
}

.sidebar-link,
.sidebar-group-toggle {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    text-align: left;
    transition:
        background-color 180ms ease,
        border-radius 240ms cubic-bezier(0.175, 0.885, 0.32, 1),
        color 180ms ease,
        padding 240ms cubic-bezier(0.175, 0.885, 0.32, 1),
        box-shadow 180ms ease;
}

.sidebar-link span,
.sidebar-link-main span {
    min-width: 0;
    max-width: 178px;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(0);
    transition:
        opacity 160ms ease,
        transform 220ms cubic-bezier(0.175, 0.885, 0.32, 1),
        max-width 240ms cubic-bezier(0.175, 0.885, 0.32, 1);
    white-space: nowrap;
}

.sidebar-link-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-group-toggle {
    justify-content: space-between;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.sidebar-group-toggle > .sidebar-icon:last-child {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
    transition: transform 160ms ease;
}

.sidebar-group.is-open .sidebar-group-toggle > .sidebar-icon:last-child {
    transform: rotate(180deg);
}

.sidebar-group.is-open .sidebar-group-toggle:not(.active) {
    background: rgba(255, 255, 255, 0.07);
    color: var(--riflo-white);
}

.sidebar-link:hover,
.sidebar-group-toggle:hover,
.sidebar-group-toggle:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--riflo-white);
}

.sidebar-link.active {
    background: var(--riflo-orange);
    color: var(--riflo-graphite);
    font-weight: 700;
}

.sidebar-group-toggle.active {
    background: rgba(var(--riflo-orange-rgb), 0.18);
    color: var(--riflo-white);
    font-weight: 700;
}

.sidebar-submenu {
    display: grid;
    gap: 3px;
    margin: 4px 0 6px 18px;
    padding-left: 10px;
    border-left: 1px solid rgba(var(--riflo-orange-rgb), 0.46);
    transition:
        margin 240ms cubic-bezier(0.175, 0.885, 0.32, 1),
        padding 240ms cubic-bezier(0.175, 0.885, 0.32, 1);
}

.sidebar-submenu[hidden] {
    display: none;
}

.sidebar-sublink {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.92rem;
}

.sidebar-sublink .sidebar-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}

@media (min-width: 993px) {
    body.sidebar-collapsed .app-shell {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    body.sidebar-collapsed .sidebar {
        padding: 18px 14px;
        scrollbar-gutter: auto;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        gap: 0;
        min-height: 72px;
        padding-right: 0;
        padding-bottom: 18px;
    }

    body.sidebar-collapsed .sidebar-brand .login-logo-frame,
    body.sidebar-collapsed .sidebar-brand .login-logo-image {
        width: 46px;
        height: 46px;
    }

    body.sidebar-collapsed .sidebar-brand-text {
        max-width: 0;
        opacity: 0;
        pointer-events: none;
        transform: translateX(-8px);
    }

    body.sidebar-collapsed .sidebar-collapse-toggle {
        background: var(--riflo-orange);
        border-color: var(--riflo-orange);
        color: var(--riflo-graphite);
        box-shadow: 0 10px 24px rgba(var(--riflo-orange-rgb), 0.28);
    }

    body.sidebar-collapsed .sidebar-collapse-toggle .sidebar-icon {
        transform: rotate(180deg);
    }

    body.sidebar-collapsed .sidebar-nav {
        gap: 8px;
        margin-top: 18px;
    }

    body.sidebar-collapsed .sidebar-footer {
        justify-content: center;
        padding-top: 14px;
    }

    body.sidebar-collapsed .sidebar-section {
        height: 1px;
        margin: 10px 16px;
        padding: 0;
        overflow: hidden;
        color: transparent;
        background: rgba(255, 255, 255, 0.14);
    }

    body.sidebar-collapsed .sidebar-link,
    body.sidebar-collapsed .sidebar-group-toggle {
        min-height: 46px;
        justify-content: center;
        gap: 0;
        padding: 12px;
        border-radius: 999px;
    }

    body.sidebar-collapsed .sidebar-link-main {
        flex: 0 0 auto;
        justify-content: center;
        gap: 0;
    }

    body.sidebar-collapsed .sidebar-link span,
    body.sidebar-collapsed .sidebar-link-main span {
        max-width: 0;
        opacity: 0;
        pointer-events: none;
        transform: translateX(-8px);
    }

    body.sidebar-collapsed .sidebar-group-toggle > .sidebar-icon:last-child {
        width: 0;
        height: 0;
        flex-basis: 0;
        opacity: 0;
        overflow: hidden;
    }

    body.sidebar-collapsed .sidebar-group.is-open .sidebar-group-toggle > .sidebar-icon:last-child {
        transform: none;
    }

    body.sidebar-collapsed .sidebar-submenu {
        gap: 6px;
        margin: 6px 0 10px;
        padding-left: 0;
        border-left: 0;
    }

    body.sidebar-collapsed .sidebar-sublink {
        width: 46px;
        height: 42px;
        min-height: 42px;
        margin: 0 auto;
        padding: 10px;
    }

    body.sidebar-collapsed .sidebar-link.active,
    body.sidebar-collapsed .sidebar-group-toggle.active {
        background: var(--riflo-orange);
        color: var(--riflo-graphite);
        box-shadow: 0 10px 24px rgba(var(--riflo-orange-rgb), 0.24);
    }

    body.sidebar-collapsed .sidebar-group.is-open .sidebar-group-toggle:not(.active) {
        background: rgba(255, 255, 255, 0.1);
    }
}

.main-shell {
    min-width: 0;
}

.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: var(--riflo-white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-summary span,
.user-summary small {
    display: block;
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus {
    border-color: rgba(var(--riflo-orange-rgb), 0.28);
    background: var(--surface-warm);
}

.user-avatar {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid rgba(var(--riflo-gray-rgb), 0.58);
    border-radius: 50%;
    background: rgba(var(--riflo-orange-rgb), 0.08);
}

.user-avatar img {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
}

.user-menu-text {
    min-width: 0;
}

.user-menu-text strong,
.user-menu-text small {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-text strong {
    font-size: 0.95rem;
    line-height: 1.2;
}

.user-menu-text small {
    color: var(--muted);
    font-size: 0.82rem;
}

.user-dropdown {
    min-width: 190px;
    border-color: rgba(var(--riflo-gray-rgb), 0.58);
    border-radius: 10px;
    box-shadow: 0 16px 34px rgba(var(--riflo-graphite-rgb), 0.16);
}

.profile-panel {
    max-width: 760px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid rgba(var(--riflo-gray-rgb), 0.58);
    border-radius: 50%;
    background: rgba(var(--riflo-orange-rgb), 0.08);
}

.profile-avatar img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

.profile-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.profile-header p {
    margin: 3px 0 0;
    color: var(--muted);
}

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

.profile-form {
    margin-top: 18px;
}

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

.admin-management-panel {
    max-width: none;
}

.admin-create-form {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(var(--riflo-gray-rgb), 0.08);
}

.admin-users-table {
    min-width: 1180px;
}

.section-subtitle {
    color: var(--riflo-graphite);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.role-permission-table {
    min-width: 820px;
}

.role-permission-table td:first-child strong,
.role-permission-table td:first-child small {
    display: block;
}

.role-permission-table td:first-child small {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.role-permission-table .form-check-input {
    cursor: pointer;
    height: 1.1rem;
    width: 1.1rem;
}

.role-permission-table .form-check-input:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.permission-group-row td {
    background: rgba(var(--riflo-orange-rgb), 0.08);
    color: var(--riflo-orange-dark);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-grid div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(var(--riflo-gray-rgb), 0.08);
}

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

.profile-grid span {
    color: var(--muted);
    font-size: 0.84rem;
}

.company-profile-panel {
    max-width: 1180px;
}

.company-profile-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 20px;
}

.company-logo-panel {
    align-self: start;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-warm);
    text-align: center;
}

.company-logo-preview {
    width: 168px;
    height: 168px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid var(--riflo-orange);
    border-radius: 8px;
    background: var(--riflo-white);
}

.company-logo-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    padding: 12px;
}

.company-logo-preview span {
    color: var(--riflo-orange-dark);
    font-size: 2.4rem;
    font-weight: 800;
}

.company-logo-panel strong,
.company-logo-panel span {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.company-logo-panel strong {
    color: var(--riflo-graphite);
    font-size: 1.05rem;
}

.company-logo-panel span {
    color: var(--muted);
}

.company-form-content {
    min-width: 0;
}

.attendance-bulk-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.25fr) 160px 160px 130px 130px auto;
    gap: 12px;
    align-items: end;
}

.attendance-bulk-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.attendance-matrix-table {
    min-width: 1080px;
}

.attendance-matrix-table th:first-child,
.attendance-matrix-table td:first-child {
    width: 56px;
    text-align: center;
}

.attendance-matrix-table th:nth-child(2) {
    width: 290px;
}

.attendance-matrix-table th:nth-child(3) {
    width: 220px;
}

.attendance-matrix-table th:nth-child(4),
.attendance-matrix-table th:nth-child(5),
.attendance-matrix-table th:nth-child(6) {
    width: 140px;
}

.attendance-import-pattern,
.personnel-import-pattern {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-warm);
}

.attendance-import-pattern code,
.personnel-import-pattern code {
    color: var(--riflo-graphite);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.personnel-import-pattern strong,
.personnel-import-pattern span {
    display: block;
}

.personnel-import-pattern span {
    color: var(--muted);
    font-size: 0.9rem;
}

.document-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.document-kpi-card {
    padding: 16px;
    border: 1px solid rgba(var(--riflo-orange-rgb), 0.22);
    border-radius: 8px;
    background: rgba(var(--riflo-orange-rgb), 0.10);
}

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

.document-kpi-card span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.document-kpi-card strong {
    color: var(--riflo-orange-dark);
    font-size: 1.8rem;
    line-height: 1.1;
    margin-top: 6px;
}

.document-kpi-card.warning {
    background: rgba(var(--riflo-yellow-rgb), 0.30);
    border-color: rgba(var(--riflo-yellow-rgb), 0.66);
}

.document-kpi-card.danger {
    background: rgba(var(--riflo-red-rgb), 0.10);
    border-color: rgba(var(--riflo-red-rgb), 0.30);
}

.document-kpi-card.muted {
    background: rgba(var(--riflo-gray-rgb), 0.16);
    border-color: rgba(var(--riflo-gray-rgb), 0.42);
}

.document-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 210px 190px auto;
    gap: 10px;
    width: 100%;
}

.training-filter-form {
    grid-template-columns: minmax(240px, 1fr) 210px 180px 170px auto;
}

.documents-table {
    min-width: 1120px;
}

.training-table {
    min-width: 1180px;
}

.training-agenda-panel {
    margin-bottom: 18px;
}

.training-agenda-panel .panel-header h2 {
    margin: 0;
    color: var(--riflo-graphite);
    font-size: 1.1rem;
    font-weight: 800;
}

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

.training-agenda-item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(var(--riflo-gray-rgb), 0.46);
    border-radius: 8px;
    background: var(--riflo-white);
}

.training-agenda-date,
.training-agenda-main {
    min-width: 0;
}

.training-agenda-date strong,
.training-agenda-date span,
.training-agenda-main strong,
.training-agenda-main span,
.training-agenda-main small {
    display: block;
}

.training-agenda-date strong,
.training-agenda-main strong {
    color: var(--riflo-graphite);
}

.training-agenda-date span,
.training-agenda-main span,
.training-agenda-main small,
.training-agenda-empty {
    color: var(--muted);
}

.training-agenda-main strong,
.training-agenda-main span,
.training-agenda-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.training-agenda-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.training-agenda-actions form {
    margin: 0;
}

.training-start-summary {
    display: grid;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid rgba(var(--riflo-gray-rgb), 0.46);
    border-radius: 8px;
    background: rgba(var(--riflo-orange-rgb), 0.06);
}

.training-start-summary strong,
.training-start-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.training-start-summary strong {
    color: var(--riflo-graphite);
}

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

.training-attendee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.training-attendee-header span {
    color: var(--muted);
    font-size: 0.88rem;
}

.training-attendee-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding: 10px;
    border: 1px solid rgba(var(--riflo-gray-rgb), 0.5);
    border-radius: 8px;
    background: var(--riflo-white);
}

.training-attendee-list.is-invalid {
    border-color: var(--riflo-red);
}

.training-attendee-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(var(--riflo-gray-rgb), 0.38);
    border-radius: 8px;
    cursor: pointer;
}

.training-attendee-option:hover {
    border-color: rgba(var(--riflo-orange-rgb), 0.6);
    background: rgba(var(--riflo-orange-rgb), 0.05);
}

.training-attendee-option span {
    display: grid;
    min-width: 0;
}

.training-attendee-option strong,
.training-attendee-option small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.training-attendee-option strong {
    color: var(--riflo-graphite);
    font-size: 0.92rem;
}

.training-attendee-option small {
    color: var(--muted);
}

.training-agenda-empty {
    padding: 16px;
    border: 1px dashed rgba(var(--riflo-gray-rgb), 0.72);
    border-radius: 8px;
    text-align: center;
}

.payroll-parameter-filter {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 220px 180px auto;
    gap: 10px;
    width: 100%;
}

.payroll-afp-filter {
    display: grid;
    grid-template-columns: 160px 180px 220px auto;
    gap: 10px;
    width: 100%;
}

.payroll-parameter-table {
    min-width: 1180px;
}

.payroll-afp-rate-table,
.payroll-afp-entry-table {
    min-width: 1120px;
}

.payroll-parameter-table td strong,
.payroll-parameter-table code,
.payroll-parameter-table .document-muted,
.payroll-afp-rate-table td strong,
.payroll-afp-rate-table .document-muted {
    display: block;
}

.payroll-run-table {
    min-width: 1180px;
}

.payroll-item-table {
    min-width: 1080px;
}

.payroll-item-table td strong,
.payroll-item-table .document-muted {
    display: block;
}

.payroll-summary-grid .payroll-status-text {
    font-size: 1.5rem;
}

.payroll-workflow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: center;
}

.payroll-workflow > div:not(.payroll-workflow-actions) {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(var(--riflo-gray-rgb), 0.08);
}

.payroll-workflow span,
.payroll-workflow strong {
    display: block;
}

.payroll-workflow span {
    color: var(--muted);
    font-size: 0.78rem;
}

.payroll-workflow strong {
    overflow-wrap: anywhere;
}

.payroll-workflow-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

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

.payroll-workflow-actions .payroll-approval-form {
    max-width: 360px;
    align-items: flex-end;
    gap: 10px;
}

.payroll-signature-field {
    min-width: 220px;
}

.payroll-signature-field .form-label {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.document-worker-cell {
    display: grid;
    gap: 2px;
}

.document-worker-cell strong,
.document-worker-cell span,
.document-worker-cell small,
.document-muted {
    display: block;
}

.document-worker-cell span,
.document-worker-cell small,
.document-muted {
    color: var(--muted);
    font-size: 0.82rem;
}

.badge.text-bg-warning {
    background: var(--riflo-yellow) !important;
    color: var(--riflo-graphite) !important;
}

.content-shell {
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;
    color: var(--riflo-graphite);
    font-size: 1.65rem;
}

.page-header p {
    margin: 4px 0 0;
}

.page-actions,
.table-actions,
.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

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

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

.kpi-card {
    background: var(--riflo-white);
    border: 1px solid rgba(var(--riflo-graphite-rgb), 0.10);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 26px rgba(var(--riflo-graphite-rgb), 0.08);
}

.kpi-card span,
.kpi-card small {
    display: block;
}

.kpi-card strong {
    display: block;
    color: var(--riflo-orange);
    font-size: 2rem;
    line-height: 1.1;
    margin: 8px 0;
}

.kpi-green {
    background: var(--success-soft);
    border-color: rgba(var(--riflo-orange-rgb), 0.22);
}

.kpi-yellow {
    background: var(--warning-soft);
    border-color: rgba(var(--riflo-yellow-rgb), 0.46);
}

.kpi-red {
    background: var(--danger-soft);
    border-color: rgba(var(--riflo-red-rgb), 0.28);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 16px;
}

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

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

.panel-header h2,
.form-section-title {
    font-size: 1rem;
    margin: 0;
    font-weight: 700;
}

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

.wide-table {
    min-width: 1550px;
}

.personnel-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.personnel-table th,
.personnel-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.personnel-table .col-code {
    width: 120px;
}

.personnel-table .col-worker {
    width: 23%;
}

.personnel-table .col-center {
    width: 20%;
}

.personnel-table .col-position {
    width: 15%;
}

.personnel-table .col-date {
    width: 96px;
}

.personnel-table .col-status {
    width: 116px;
}

.personnel-table .col-actions {
    width: 286px;
    overflow: visible;
}

.personnel-actions {
    flex-wrap: wrap;
    row-gap: 6px;
}

.personnel-actions .btn {
    padding-inline: 0.55rem;
}

.personnel-sheet {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
}

.personnel-sheet-summary {
    align-self: start;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-warm);
    text-align: center;
}

.personnel-sheet-summary strong,
.personnel-sheet-summary span,
.personnel-sheet-summary code {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.personnel-sheet-summary strong {
    color: var(--riflo-graphite);
    font-size: 1.05rem;
    line-height: 1.25;
}

.personnel-sheet-photo {
    width: 136px;
    height: 136px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid var(--riflo-orange);
    border-radius: 8px;
    background: var(--riflo-white);
}

.personnel-sheet-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.personnel-sheet-photo span {
    color: var(--riflo-orange-dark);
    font-size: 2rem;
    font-weight: 800;
}

.personnel-sheet-content {
    display: grid;
    gap: 16px;
}

.personnel-sheet-section h3 {
    margin: 0 0 10px;
    color: var(--riflo-orange-dark);
    font-size: 0.92rem;
    font-weight: 800;
    text-transform: uppercase;
}

.personnel-sheet-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.personnel-sheet-section-header h3 {
    margin: 0;
}

.personnel-sheet-section-header span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.personnel-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.personnel-sheet-grid div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--riflo-white);
}

.personnel-sheet-grid span,
.personnel-sheet-grid strong {
    display: block;
}

.personnel-sheet-grid span {
    color: var(--muted);
    font-size: 0.78rem;
}

.personnel-sheet-grid strong {
    color: var(--riflo-graphite);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.personnel-documents-table {
    min-width: 780px;
    margin-bottom: 0;
}

.personnel-documents-table td strong,
.personnel-documents-table .document-muted {
    display: block;
}

.personnel-sheet-empty {
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(var(--riflo-gray-rgb), 0.08);
}

.form-panel {
    max-width: 1180px;
}

.form-section-title {
    margin: 8px 0 12px;
    padding-top: 10px;
}

.form-section-title:not(:first-child) {
    margin-top: 22px;
    border-top: 1px solid var(--line);
}

.form-actions {
    margin-top: 22px;
}

.btn {
    border-radius: 8px;
}

.btn-primary {
    --bs-btn-bg: var(--riflo-orange);
    --bs-btn-border-color: var(--riflo-orange);
    --bs-btn-color: var(--riflo-graphite);
    --bs-btn-hover-bg: var(--riflo-orange-dark);
    --bs-btn-hover-border-color: var(--riflo-orange-dark);
    --bs-btn-hover-color: var(--riflo-white);
    --bs-btn-active-bg: var(--riflo-orange-dark);
    --bs-btn-active-border-color: var(--riflo-orange-dark);
    --bs-btn-active-color: var(--riflo-white);
    --bs-btn-focus-shadow-rgb: var(--riflo-orange-rgb);
    background: var(--primary);
    border-color: var(--primary);
    color: var(--riflo-graphite);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:first-child:active,
.btn-primary.show {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--riflo-white);
}

.btn-outline-primary {
    --bs-btn-border-color: var(--riflo-orange);
    --bs-btn-color: var(--riflo-orange-dark);
    --bs-btn-hover-bg: var(--riflo-orange);
    --bs-btn-hover-border-color: var(--riflo-orange);
    --bs-btn-hover-color: var(--riflo-graphite);
    --bs-btn-active-bg: var(--riflo-orange-dark);
    --bs-btn-active-border-color: var(--riflo-orange-dark);
    --bs-btn-active-color: var(--riflo-white);
    border-color: var(--riflo-orange);
    color: var(--riflo-orange-dark);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--riflo-orange);
    border-color: var(--riflo-orange);
    color: var(--riflo-graphite);
}

.btn-outline-danger {
    border-color: var(--riflo-red);
    color: var(--riflo-red);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: var(--riflo-red);
    border-color: var(--riflo-red);
    color: var(--riflo-white);
}

.btn-outline-secondary {
    --bs-btn-border-color: var(--riflo-gray);
    --bs-btn-color: var(--riflo-graphite);
    --bs-btn-hover-bg: var(--riflo-graphite);
    --bs-btn-hover-border-color: var(--riflo-graphite);
    --bs-btn-hover-color: var(--riflo-white);
    border-color: var(--riflo-gray);
    color: var(--riflo-graphite);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--riflo-graphite);
    border-color: var(--riflo-graphite);
    color: var(--riflo-white);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--riflo-orange);
    box-shadow: 0 0 0 0.2rem rgba(var(--riflo-orange-rgb), 0.18);
}

.form-check-input:checked {
    background-color: var(--riflo-orange);
    border-color: var(--riflo-orange);
}

.form-check-input:focus {
    border-color: var(--riflo-orange);
    box-shadow: 0 0 0 0.2rem rgba(var(--riflo-orange-rgb), 0.18);
}

.insurance-switch {
    border: 1px solid rgba(var(--riflo-orange-rgb), 0.22);
    border-radius: 8px;
    padding: 0.85rem 1rem 0.85rem 3rem;
    background: var(--surface-warm);
}

.insurance-switch .form-check-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--riflo-graphite);
    font-weight: 700;
}

.insurance-switch .form-check-label span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--riflo-red);
}

.invalid-feedback,
.text-danger {
    color: var(--riflo-red) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--surface-warm);
    color: var(--riflo-graphite);
}

.dropdown-item:active {
    background: var(--riflo-orange);
    color: var(--riflo-graphite);
}

.badge.text-bg-success {
    background: var(--riflo-orange) !important;
    color: var(--riflo-graphite) !important;
}

.badge.text-bg-secondary {
    background: var(--riflo-gray) !important;
    color: var(--riflo-graphite) !important;
}

.badge.text-bg-danger,
.toast.text-bg-danger {
    background: var(--riflo-red) !important;
    color: var(--riflo-white) !important;
}

.toast.text-bg-success {
    background: var(--riflo-orange) !important;
    color: var(--riflo-graphite) !important;
}

.alert-danger {
    background: rgba(var(--riflo-red-rgb), 0.10);
    border-color: rgba(var(--riflo-red-rgb), 0.28);
    color: var(--riflo-graphite);
}

.table th {
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--line);
}

.table-hover > tbody > tr:hover > * {
    background: var(--surface-warm);
}

.table td {
    vertical-align: middle;
}

@media (max-width: 992px) {
    .auth-body {
        padding: 14px;
    }

    .login-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .mfa-setup-grid {
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: 320px;
    }

    .login-hero-overlay,
    .login-panel {
        padding: 30px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 270px;
        transform: translateX(-100%);
        transition: transform 180ms ease;
        z-index: 21;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-brand {
        padding-right: 46px;
    }

    .sidebar-mobile-close {
        width: 36px;
        height: 36px;
        display: inline-grid;
        place-items: center;
        position: absolute;
        top: 4px;
        right: 0;
        border: 1px solid var(--riflo-orange);
        border-radius: 10px;
        background: var(--riflo-orange);
        color: var(--riflo-graphite);
    }

    .sidebar-mobile-close:focus,
    .sidebar-mobile-close:hover {
        background: var(--riflo-orange-dark);
        border-color: var(--riflo-orange-dark);
        color: var(--riflo-white);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 20;
        border: 0;
        background: rgba(var(--riflo-graphite-rgb), 0.48);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: opacity 180ms ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .sidebar-footer {
        display: none;
    }

    .topbar {
        padding: 0 16px;
    }

    .content-shell {
        padding: 18px 14px;
    }

    .page-header,
    .panel-header,
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .kpi-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .user-summary {
        gap: 8px;
    }

    .user-summary small {
        display: none;
    }

    .user-menu-text {
        display: none;
    }

    .personnel-table {
        min-width: 960px;
    }

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

    .attendance-bulk-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .document-filter-form,
    .training-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-parameter-filter,
    .payroll-afp-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .payroll-workflow-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .attendance-bulk-actions {
        justify-content: flex-start;
    }

    .training-agenda-item {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .training-agenda-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .company-logo-panel {
        justify-items: start;
        grid-template-columns: auto minmax(0, 1fr);
        text-align: left;
    }

    .company-logo-preview {
        grid-row: span 2;
        width: 112px;
        height: 112px;
    }

    .personnel-sheet {
        grid-template-columns: 1fr;
    }

    .personnel-sheet-summary {
        justify-items: start;
        grid-template-columns: auto minmax(0, 1fr);
        text-align: left;
    }

    .personnel-sheet-photo {
        grid-row: span 4;
        width: 104px;
        height: 104px;
    }

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

@media (max-width: 576px) {
    .auth-card {
        padding: 22px;
    }

    .login-card {
        border-radius: 14px;
    }

    .login-hero {
        min-height: 260px;
    }

    .login-hero-overlay,
    .login-panel {
        padding: 24px;
    }

    .login-brand {
        margin-bottom: 24px;
    }

    .login-brand img {
        max-height: 62px;
    }

    .login-title h2 {
        font-size: 1.45rem;
    }

    .search-form,
    .table-actions,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .kpi-card strong {
        font-size: 1.7rem;
    }

    .personnel-sheet-summary,
    .personnel-sheet-grid {
        grid-template-columns: 1fr;
    }

    .personnel-sheet-summary {
        justify-items: center;
        text-align: center;
    }

    .personnel-sheet-photo {
        grid-row: auto;
    }

    .company-logo-panel {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .company-logo-preview {
        grid-row: auto;
    }

    .attendance-bulk-toolbar {
        grid-template-columns: 1fr;
    }

    .document-kpi-grid,
    .document-filter-form,
    .training-filter-form,
    .payroll-parameter-filter,
    .payroll-afp-filter {
        grid-template-columns: 1fr;
    }

    .payroll-workflow {
        grid-template-columns: 1fr;
    }

    .payroll-workflow-actions {
        flex-direction: column;
    }

    .attendance-bulk-actions {
        flex-direction: column;
    }

    .personnel-import-pattern {
        align-items: stretch;
        flex-direction: column;
    }

    .training-agenda-item {
        grid-template-columns: 1fr;
    }

    .training-agenda-actions,
    .training-agenda-actions .btn,
    .training-agenda-actions form {
        width: 100%;
    }

    .training-agenda-actions {
        flex-direction: column;
    }
}
