:root {
    --brand-red: #d71920;
    --brand-red-dark: #a80f15;
    --brand-ink: #162033;
    --brand-muted: #64748b;
    --brand-bg: #f4f6f9;
    --brand-card: #ffffff;
    --brand-border: #e2e8f0;
    --brand-soft-red: #fff0f1;
    --shadow-soft: 0 14px 35px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(215, 25, 32, 0.08), transparent 32rem),
        linear-gradient(180deg, #ffffff 0%, var(--brand-bg) 42%, #eef2f7 100%);
    color: var(--brand-ink);
    font-family: "Segoe UI", Arial, sans-serif;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-navbar {
    min-height: 74px;
    background: linear-gradient(135deg, #111827 0%, #1f2937 52%, #500c10 100%);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.navbar-brand {
    color: #ffffff !important;
    text-decoration: none;
}

.brand-logo-wrap {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.brand-logo {
    max-width: 35px;
    max-height: 35px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, 0.78) !important;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 999px;
    padding: 0.55rem 0.85rem !important;
    transition: all 0.18s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
}

.app-navbar .user-pill {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.app-toggler {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: none !important;
}

.app-toggler i {
    font-size: 1.5rem;
}

.dropdown-menu {
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    overflow: hidden;
}

.dropdown-item {
    font-weight: 500;
    padding: 0.62rem 1rem;
}

.dropdown-item:active {
    background-color: var(--brand-red);
}

.app-main {
    flex: 1;
}

.app-footer {
    padding: 1rem 0;
    color: var(--brand-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--brand-border);
    background: #720523;
}

.footer-note {
    color: #f392ac;
}

.footer-copyright {
    color: #f392ac;
}

.message-stack {
    margin-bottom: 1rem;
}

.app-alert {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.card,
.app-card {
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
}

.app-card-header {
    padding: 1.2rem 1.3rem;
    border-bottom: 1px solid var(--brand-border);
    background: linear-gradient(180deg, #ffffff, #fbfcfe);
    border-radius: 22px 22px 0 0;
}

.app-card-body {
    padding: 1.3rem;
}

.page-title {
    font-weight: 850;
    color: var(--brand-ink);
    letter-spacing: -0.03em;
}

.page-subtitle {
    color: var(--brand-muted);
    max-width: 760px;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--brand-soft-red);
    color: var(--brand-red-dark);
    font-size: 0.78rem;
    font-weight: 750;
    margin-bottom: 0.55rem;
}

.btn-primary {
    background: var(--brand-red);
    border-color: var(--brand-red);
    box-shadow: 0 10px 18px rgba(215, 25, 32, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-red-dark);
    border-color: var(--brand-red-dark);
}

.btn-outline-primary {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.btn-outline-primary:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: #cbd5e1;
    padding: 0.65rem 0.8rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 0.2rem rgba(215, 25, 32, 0.12);
}

.table {
    vertical-align: middle;
}

.table thead th {
    color: #334155;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fafc;
}

.badge-soft-success {
    color: #047857;
    background: #d1fae5;
}

.badge-soft-warning {
    color: #92400e;
    background: #fef3c7;
}

.badge-soft-danger {
    color: #b91c1c;
    background: #fee2e2;
}

.badge-soft-info {
    color: #0369a1;
    background: #e0f2fe;
}

.action-tile {
    display: block;
    height: 100%;
    padding: 1.2rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--brand-border);
    color: var(--brand-ink);
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    transition: all 0.18s ease;
}

.action-tile:hover {
    transform: translateY(-2px);
    color: var(--brand-ink);
    border-color: rgba(215, 25, 32, 0.35);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
}

.action-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft-red);
    color: var(--brand-red);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 991.98px) {
    .app-navbar .navbar-nav {
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .app-navbar .nav-link {
        border-radius: 12px;
    }
}

@media (max-width: 575.98px) {
    .brand-subtitle {
        display: none;
    }

    .brand-title {
        font-size: 0.92rem;
    }

    .brand-logo-wrap {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
}

.page-heading {
    max-width: 900px;
}

.field-control input,
.field-control select,
.field-control textarea {
    width: 100%;
}

.upload-note {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(215, 25, 32, 0.18);
    background: linear-gradient(180deg, #fff7f7, #ffffff);
    border-radius: 18px;
    color: #334155;
}

.upload-note-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.process-step {
    display: flex;
    gap: 0.85rem;
    padding: 0.95rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.process-step:last-of-type {
    border-bottom: 0;
}

.process-step-no {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    flex: 0 0 auto;
}

.process-step strong {
    display: block;
    font-size: 0.93rem;
    color: #0f172a;
    margin-bottom: 0.15rem;
}

.process-step p {
    margin: 0;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.45;
}

.busy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.busy-overlay.show {
    display: flex;
}

.busy-card {
    width: min(430px, 100%);
    padding: 2rem;
    border-radius: 24px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.busy-spinner {
    width: 58px;
    height: 58px;
    margin: 0 auto 1.1rem;
    border-radius: 999px;
    border: 5px solid #fee2e2;
    border-top-color: #d71920;
    animation: payrollSpin 0.9s linear infinite;
}

.app-progress {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #fee2e2;
}

.app-progress .progress-bar {
    background-color: #d71920;
}

@keyframes payrollSpin {
    to {
        transform: rotate(360deg);
    }
}

.settings-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.settings-tip {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.86rem;
}

.settings-tip i {
    color: #d71920;
    margin-top: 0.12rem;
}

.app-table {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
}

.app-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-table tbody td {
    border-color: #eef2f7;
    font-size: 0.92rem;
}

.empty-state-small {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    color: #94a3b8;
    padding: 1.2rem;
    font-weight: 600;
}

.empty-state-small i {
    font-size: 1.2rem;
}

.profile-note {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(215, 25, 32, 0.16);
    background: linear-gradient(180deg, #fff7f7, #ffffff);
    border-radius: 18px;
    color: #334155;
}

.profile-note-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.profile-summary-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: 28px;
    background: linear-gradient(135deg, #111827, #d71920);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.profile-summary-list {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    text-align: left;
}

.profile-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.profile-summary-item:last-child {
    border-bottom: 0;
}

.profile-summary-item span {
    color: #64748b;
    font-size: 0.86rem;
}

.profile-summary-item strong {
    color: #0f172a;
    font-size: 0.88rem;
    text-align: right;
}

.dashboard-hero {
    padding: 2rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.25), transparent 34%),
        linear-gradient(135deg, #111827, #7f1d1d 52%, #d71920);
    color: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    position: relative;
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    right: -80px;
    bottom: -120px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.dashboard-title {
    font-weight: 900;
    letter-spacing: -0.04em;
    font-size: clamp(2rem, 3vw, 3rem);
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.82);
    max-width: 760px;
    font-size: 1rem;
    line-height: 1.65;
}

.section-label-light {
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.hero-action-btn {
    position: relative;
    z-index: 1;
    font-weight: 800;
    color: #991b1b;
    border-radius: 16px;
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.18);
}

.workflow-card {
    padding: 1.35rem;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
    transition: 0.2s ease;
}

.workflow-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.1);
}

.workflow-icon {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    background: #fee2e2;
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.workflow-step {
    display: inline-flex;
    margin-bottom: 0.4rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.workflow-card h5 {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.45rem;
}

.workflow-card p {
    color: #64748b;
    margin: 0;
    line-height: 1.55;
    font-size: 0.92rem;
}

.dashboard-table td {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.period-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    font-weight: 800;
    white-space: nowrap;
}

.file-cell {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #334155;
    max-width: 360px;
}

.file-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.badge-soft-muted {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

.empty-dashboard-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-dashboard-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 24px;
    background: #fee2e2;
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.empty-dashboard-state h5 {
    font-weight: 800;
    color: #0f172a;
}

.empty-dashboard-state p {
    color: #64748b;
    margin-bottom: 1.25rem;
}

@media (max-width: 767.98px) {
    .dashboard-hero {
        padding: 1.5rem;
        border-radius: 22px;
    }

    .dashboard-table {
        min-width: 820px;
    }
}

.confirm-action-card {
    overflow: hidden;
}

.confirm-summary {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.15rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border: 1px solid #e2e8f0;
}

.confirm-summary-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: #fee2e2;
    color: #b91c1c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    flex: 0 0 auto;
}

.confirm-details {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
}

.confirm-detail-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.confirm-detail-item:last-child {
    border-bottom: 0;
}

.confirm-detail-item span {
    color: #64748b;
    font-size: 0.88rem;
}

.confirm-detail-item strong {
    color: #0f172a;
    font-size: 0.9rem;
    text-align: right;
    word-break: break-word;
}

.premium-warning {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffbeb, #ffffff);
    border: 1px solid #fde68a;
    color: #78350f;
}

.premium-warning-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #fef3c7;
    color: #b45309;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.premium-warning p {
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.5;
}

.batch-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.batch-info-item {
    padding: 1rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.batch-info-item span {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.batch-info-item strong {
    color: #0f172a;
    font-size: 0.95rem;
    word-break: break-word;
}

.batch-action-card {
    position: relative;
    min-height: 185px;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.25rem;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    text-decoration: none;
    color: #0f172a;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
    transition: 0.2s ease;
    overflow: hidden;
}

.batch-action-card:hover {
    transform: translateY(-3px);
    color: #0f172a;
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.12);
}

.batch-action-card::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    right: -48px;
    bottom: -48px;
    border-radius: 999px;
    opacity: 0.12;
}

.batch-action-success::after {
    background: #16a34a;
}

.batch-action-primary::after {
    background: #2563eb;
}

.batch-action-warning::after {
    background: #f59e0b;
}

.batch-action-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.batch-action-success .batch-action-icon {
    background: #dcfce7;
    color: #15803d;
}

.batch-action-primary .batch-action-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.batch-action-warning .batch-action-icon {
    background: #fef3c7;
    color: #b45309;
}

.batch-action-card span {
    display: inline-flex;
    margin-bottom: 0.35rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.batch-action-card h5 {
    font-weight: 850;
    margin-bottom: 0.35rem;
}

.batch-action-card p {
    color: #64748b;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.batch-action-arrow {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: #94a3b8;
}

.action-name-cell {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    white-space: nowrap;
}

.batch-actions-table td {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

@media (max-width: 991.98px) {
    .batch-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .batch-actions-table {
        min-width: 850px;
    }
}

.auth-page {
    min-height: calc(100vh - 190px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-logo {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: linear-gradient(135deg, #111827, #d71920);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    flex: 0 0 auto;
}

.auth-submit-btn {
    height: 46px;
    border-radius: 14px;
    font-weight: 800;
}

.auth-footer-note {
    padding: 0.85rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.86rem;
    text-align: center;
}

.success-card {
    overflow: hidden;
}

.success-icon {
    width: 84px;
    height: 84px;
    border-radius: 28px;
    background: #dcfce7;
    color: #15803d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.7rem;
    box-shadow: 0 18px 42px rgba(21, 128, 61, 0.16);
}

@media (max-width: 576px) {
    .auth-page {
        align-items: flex-start;
        padding: 1.25rem 0.75rem;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .auth-brand {
        align-items: flex-start;
    }

    .auth-logo {
        width: 50px;
        height: 50px;
        border-radius: 16px;
        font-size: 1.4rem;
    }

    .auth-brand h3 {
        font-size: 1.25rem;
    }
}