* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    background: #f5f7fa;
    color: #1f2937;
}

.layout {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 230px;
    background: #111827;
    color: white;
    padding: 24px 16px;
}

.brand {
    margin-bottom: 32px;
    padding: 0 10px;
}

.brand-main {
    font-size: 22px;
    font-weight: 700;
}

.brand-sub {
    margin-top: 3px;
    font-size: 13px;
    opacity: 0.65;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    display: block;
    padding: 11px 12px;
    border-radius: 7px;
    color: #d1d5db;
    text-decoration: none;
}

.nav-item:hover {
    background: #1f2937;
}

.nav-item.active {
    background: #374151;
    color: white;
}

.nav-item.disabled {
    opacity: 0.45;
    cursor: default;
}

.main {
    flex: 1;
}

.topbar {
    height: 64px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user {
    font-size: 14px;
}

.logout-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #4b5563;
}

.content {
    padding: 30px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
}

.page-subtitle {
    color: #6b7280;
    margin-top: 5px;
    margin-bottom: 26px;
}

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

.card,
.panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
}

.card-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.card-detail {
    font-size: 13px;
    color: #6b7280;
    margin-top: 7px;
}

.status-ok {
    font-size: 20px;
    font-weight: 700;
}

.status-error {
    font-size: 20px;
    font-weight: 700;
}

.panel {
    margin-top: 20px;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
}

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

.module {
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.module span {
    font-size: 12px;
    color: #6b7280;
}


/* LOGIN */

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #eef2f7;
}

.login-card {
    width: 380px;
    background: white;
    padding: 34px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.login-logo {
    font-size: 26px;
    font-weight: 700;
}

.login-subtitle {
    color: #6b7280;
    margin-top: 5px;
    margin-bottom: 28px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 14px 0 6px;
}

input {
    width: 100%;
    padding: 11px;
    border-radius: 7px;
    border: 1px solid #d1d5db;
    font-size: 15px;
}

.primary-button {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    border: 0;
    border-radius: 7px;
    background: #111827;
    color: white;
    font-size: 15px;
    cursor: pointer;
}

.error-box {
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
}


@media (
    max-width: 850px
) {

    .sidebar {
        width: 180px;
    }

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

}


/* ==========================================================
   WF-FAST-02B — EMPLOYEE MANAGEMENT
   ========================================================== */

.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.button-link,
.primary-action-button {
    display: inline-block;
    padding: 10px 16px;
    border: 0;
    border-radius: 7px;
    background: #111827;
    color: white;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

.secondary-button-link {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: white;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
}

.table-panel {
    padding: 0;
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: #f9fafb;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
}

.data-table td {
    font-size: 14px;
}

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

.table-action a {
    color: #111827;
    font-weight: 600;
    text-decoration: none;
}

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

.badge-ok {
    background: #dcfce7;
}

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

.empty-state {
    padding: 50px 30px;
    text-align: center;
}

.empty-state p {
    color: #6b7280;
}

.form-panel {
    max-width: 900px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
}

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

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

.form-field label {
    margin-top: 0;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: white;
    font-size: 14px;
}

.field-help {
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.success-box {
    margin-bottom: 20px;
    padding: 12px;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    background: #dcfce7;
}

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

.detail-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    padding: 17px;
}

.detail-label {
    margin-bottom: 7px;
    color: #6b7280;
    font-size: 12px;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
}

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

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 11px;
    border-bottom: 1px solid #f3f4f6;
}

.detail-list span {
    color: #6b7280;
}


@media (
    max-width: 900px
) {

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

}


@media (
    max-width: 650px
) {

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

    .page-actions {
        flex-direction: column;
    }

}


/* WF-FAST-02C */

.employee-actions {
    display: flex;
    gap: 9px;
    align-items: center;
}

.employee-actions form {
    margin: 0;
}

.danger-button {
    display: inline-block;
    padding: 10px 16px;
    border: 0;
    border-radius: 7px;
    background: #991b1b;
    color: white;
    cursor: pointer;
    font-size: 14px;
}


/* ==========================================================
   WF-FAST-02C
   ========================================================== */

.employee-actions {
    display: flex;
    gap: 9px;
    align-items: center;
}

.employee-actions form {
    margin: 0;
}

.danger-button {
    display: inline-block;
    padding: 10px 16px;
    border: 0;
    border-radius: 7px;
    background: #991b1b;
    color: white;
    cursor: pointer;
    font-size: 14px;
}


/* ==========================================================
   WF-FAST-03C — ATTENDANCE
   ========================================================== */

.setup-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.setup-nav a {
    padding: 8px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
}

.filter-grid {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-grid select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: white;
}

.checkbox-field {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-field label {
    display: flex;
    gap: 7px;
    align-items: center;
    margin: 0;
}

.checkbox-field input {
    width: auto;
}

.filter-button {
    align-self: end;
}

.attendance-summary {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    margin: 20px 0;
}

.summary-number {
    font-size: 28px;
    font-weight: 700;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
}

.panel-title-row .panel-title {
    margin-bottom: 0;
}

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

.table-muted {
    color: #6b7280;
    font-size: 12px;
}

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

.edit-box,
.record-edit {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 12px 0;
    background: #fafafa;
}

.edit-box summary,
.record-edit summary {
    cursor: pointer;
    padding: 14px;
}

.compact-form {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.form-button-cell {
    display: flex;
    align-items: end;
}

.weekday-field {
    grid-column: 1 / -1;
}

.weekday-check {
    display: inline-flex;
    gap: 5px;
    margin-right: 12px;
    align-items: center;
}

.weekday-check input {
    width: auto;
}

.inline-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin-bottom: 15px;
}

.inline-form select {
    flex: 1;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
}


@media (
    max-width: 1000px
) {

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

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

}


@media (
    max-width: 650px
) {

    .filter-grid,
    .attendance-summary {
        grid-template-columns: 1fr;
    }

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

}


/* ==========================================================
   WF-FAST-04 — LEAVE
   ========================================================== */

.leave-request-detail {
    padding: 0 16px 16px 16px;
}

.decision-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.decision-grid textarea {
    width: 100%;
}

.balance-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 10px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
}

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


/* ==========================================================
   WF-FAST-05 — PAYROLL
   ========================================================== */

.payroll-two-column {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.payroll-status-header {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    align-items: flex-start;
}

.payroll-big-status {
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
}

.payroll-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.payroll-totals > div {
    min-width: 100px;
}

.payroll-totals span {
    display: block;
    font-size: 12px;
    opacity: 0.7;
}

.payroll-totals strong {
    display: block;
    margin-top: 4px;
    font-size: 17px;
}

.payroll-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.payroll-action-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.payroll-action-form input {
    min-width: 220px;
}

@media (max-width: 850px) {

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

    .payroll-status-header {
        flex-direction: column;
    }

    .payroll-action-form {
        flex-direction: column;
        align-items: stretch;
    }
}
