﻿body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
    margin: 0;
    padding: 1rem;
}


.lao_note {
    color: #6c757d;
    font-weight: 600;
}

body, table, input {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bg_header {
    background-color: rgb(240 240 240) !important;
    font-weight: 600;
}

.bg_water {
    background-color: rgb(189 202 255) !important;
    color: rgb(20 40 120) !important;
    font-weight: 600;
}

.bg_impurity {
    background-color: rgb(196 240 210) !important;
    color: rgb(20 100 60) !important;
    font-weight: 600;
}

.bg_water_sub {
    background-color: rgb(220 228 255) !important;
    font-weight: 600;
}

.bg_impurity_sub {
    background-color: rgb(228 250 236) !important;
    font-weight: 600;
}

thead th {
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
    table-layout: fixed;
}

#table_data {
    min-width: 1480px;
    table-layout: auto;
}

#table_data th,
#table_data td {
    white-space: nowrap;
    word-break: normal;
}

#table_data thead tr:nth-child(2) th {
    min-width: 120px;
}

.div_search_worker {
    width: 100%;
    max-width: 520px;
}

th,
td {
    padding: 6px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
}

thead th {
    background-color: #198754;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

tbody tr:hover {
    background-color: #eef8f1;
}

table input {
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

    table input:focus {
        border-color: #198754;
        background-color: #f9fff9;
        outline: none;
    }

td:nth-child(2) input,
td:nth-child(3) input {
    border: none;
    font-weight: 600;
    cursor: default;
    width: 100%;
    font-size: 11px;
    line-height: 1.1;
}

td:nth-child(2) input {
    color: #000000;
    text-align: left;
    padding-left: 4px;
}

td:nth-child(3) input {
    color: #000000;
    text-align: center;
    padding: 4px 2px;
}

td:nth-child(1),
th:nth-child(1) {
    min-width: 40px;
    width: 40px;
    font-size: 11px;
}

td:nth-child(2),
th:nth-child(2) {
    min-width: 140px;
}

td:nth-child(3),
th:nth-child(3) {
    min-width: 100px;
}

.button_row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

    .button_row > button {
        min-width: 120px;
    }

pre {
    background: #f8f9fa;
    padding: 12px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre-wrap;
    margin-top: 1rem;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 768px) {
    table {
        table-layout: auto;
        font-size: 11px;
        overflow: visible;
    }

    th,
    td {
        padding: 4px 4px;
        white-space: normal;
        word-break: break-word;
    }

        td:nth-child(1),
        td:nth-child(2),
        td:nth-child(3),
        td:nth-child(4),
        td:nth-child(5),
        td:nth-child(6),
        td:nth-child(7),
        td:nth-child(8),
        td:nth-child(9),
        td:nth-child(10),
        th:nth-child(1),
        th:nth-child(2),
        th:nth-child(3),
        th:nth-child(4),
        th:nth-child(5),
        th:nth-child(6),
        th:nth-child(7),
        th:nth-child(8),
        th:nth-child(9),
        th:nth-child(10) {
            font-size: 10px;
        }

            td:nth-child(2) input,
            td:nth-child(3) input {
                background-color: #f5f8fa;
                border: 1px solid #dee2e6;
                font-weight: 600;
                cursor: default;
                width: 100%;
                font-size: 11px;
                line-height: 1.3;
                color: #212529;
            }


        td:nth-child(2) {
            min-width: 122px;
        }

        td:nth-child(3) {
            min-width: 60px;
        }

    .button_row > button {
        flex: 1 1 48%;
    }

    h3 {
        font-size: 1.1rem;
    }
    #summary_info {
        font-size: 0.7rem;
    }

    #modal_fetch_data .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }

    #modal_fetch_data .modal-content {
        padding: 0.5rem;
        font-size: 13px;
    }

    #modal_fetch_data .modal-header h5 {
        font-size: 0.8rem;
        text-align: center;
        width: 100%;
    }

    #modal_fetch_data .modal-body {
        padding: 0.75rem;
    }

    #modal_fetch_data .form-group,
    #modal_fetch_data .input-group,
    #modal_fetch_data select,
    #modal_fetch_data input {
        width: 100% !important;
        font-size: 13px;
        margin-bottom: 0.5rem;
    }

        #modal_fetch_data .input-group > * {
            flex: 1 1 auto;
        }

    #modal_fetch_data .btn {
        /*width: 100%;*/
        margin-top: 0.5rem;
    }

    thead tr:first-child th:first-child,
    tbody td:first-child {
        position: sticky;
        left: 0;
        background: #f8f9fa;
        z-index: 2;
        border-right: 1px solid #dee2e6;
    }

    tbody td:nth-child(1) {
        z-index: 1;
    }

    thead tr:first-child th:first-child {
        z-index: 3;
    }

    #modal_result_data .btn-group button {
        font-size: 10px;
        font-weight: 600;
    }

    .button_row {
        margin-top: 51px;
    }

    .p_description {
        font-size: 11px;
    }

    table th:nth-child(6),
    table td:nth-child(6), 
    table th:nth-child(7),
    table td:nth-child(7), 
    table th:nth-child(8),
    table td:nth-child(8) 
    {
        min-width: 80px; 
        white-space: nowrap;
    }

    input.readonly-cell {
        background-color: #f5f8fa;
        border: 1px solid #ccc;
        font-weight: 600;
        font-size: 11px;
        color: #212529;
        text-align: left;
        padding-left: 4px;
        pointer-events: none;
    }
}

tfoot tr {
    background-color: #f8f9fa;
    font-weight: bold;
}

#modal_sync_data {
    background: #0000004d;
}

#moda_reset_token {
    background: #0000004d;
}

table {
    font-family: 'Segoe UI', 'Roboto', 'Inter', 'Tahoma', sans-serif;
    font-size: 0.85rem;
}

#table_data input {
    font-family: inherit;
}

input[disabled] {
    color: #000 !important;
    opacity: 1 !important; 
    -webkit-text-fill-color: #000 !important; 
    background-color: transparent !important; 
    border: none;
    font-weight: 600;
    cursor: default;
    pointer-events: none;
}
.daily-attendance-shell {
    background: #ecfff7;
    padding: 0.75rem 0 0;
    font-size: 13px;
}

.daily-category-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.daily-tab-btn {
    border: 1px solid #d4dde5;
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 6px 6px 0 0;
}

    .daily-tab-btn.active {
        background: #1da37c;
        color: #fff;
        border-color: #1da37c;
    }

.daily-info-btn {
    margin-left: auto;
    border-color: #0d6efd;
    color: #0d6efd;
}

.switch-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 150px;
    padding: 0.75rem 0.9rem;
    border: 1px solid #d6e4dd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    user-select: none;
}

    .switch-card input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.switch-ui {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #d1d5db;
    position: relative;
    flex: 0 0 auto;
}

    .switch-ui::after {
        content: "";
        position: absolute;
        width: 18px;
        height: 18px;
        top: 2px;
        left: 2px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        transition: transform 0.15s ease;
    }

.switch-card input:checked + .switch-ui {
    background: #198754;
}

    .switch-card input:checked + .switch-ui::after {
        transform: translateX(16px);
    }

.switch-content {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #334155;
}

.attendance-modal {
    background: #fff;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #198754;
    font-size: 16px;
    font-weight: 700;
}

.input-group-custom label {
    display: block;
    margin-bottom: 0.35rem;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.input-icon {
    position: relative;
}

    .input-icon > i {
        position: absolute;
        top: 50%;
        left: 0.75rem;
        transform: translateY(-50%);
        color: #64748b;
        z-index: 2;
        pointer-events: none;
    }

    .input-icon .form-control {
        padding-left: 2.15rem;
    }

.daily-legend-card {
    background: #fff;
    border: 1px solid #b9c7d2;
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 1.5rem;
}

.daily-legend-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #78909c;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.daily-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin: 0.8rem 0;
}

.daily-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #4b5563;
    font-size: 13px;
    font-weight: 400;
    background: #f8fafc;
    border-radius: 4px;
    padding-right: 0.45rem;
}

    .daily-legend-item b {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 28px;
        height: 28px;
        border-radius: 4px 0 0 4px;
        text-transform: uppercase;
        font-weight: 600;
    }

.daily-note {
    background: #ccefff;
    border: 1px solid #7dd3fc;
    color: #005f8c;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 13px;
    font-weight: 600;
}

.daily-data-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.daily-data-head {
    background: #249f7c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
}

.daily-title {
    font-size: 13px;
    font-weight: 600;
}

    .daily-title span span,
    #daily_attendance_title {
        color: inherit;
    }

.daily-search {
    width: 220px;
}

.daily-count {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 0.35rem 0.8rem;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.daily-table-wrap {
    overflow: auto;
    max-height: 62vh;
    border-top: 1px solid #18825f;
}

.daily-attendance-table {
    min-width: 1180px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    font-weight: 400;
}

    .daily-attendance-table th,
    .daily-attendance-table td {
        border-bottom: 1px solid #38a77f;
        padding: 7px 8px;
        background: #fff;
        vertical-align: middle;
    }

    .daily-attendance-table thead th {
        position: sticky;
        top: 0;
        z-index: 6;
        background: #f8fafc;
        color: #64748b;
        text-align: center;
        font-weight: 600;
    }

    .daily-attendance-table thead tr:nth-child(2) th {
        top: 63px;
    }

.daily-type-header {
    min-width: 135px;
    color: var(--daily-color) !important;
    background: var(--daily-bg) !important;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.daily-shift-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 8px;
}

    .daily-shift-actions button {
        border: 1px solid #3b9cff;
        background: #eaf7ff;
        color: #0d6efd;
        border-radius: 4px;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
        padding: 4px 0;
    }

        .daily-shift-actions button + button {
            border-color: #f59e0b;
            background: #fff7db;
            color: #f59e0b;
        }

.daily-all-header {
    background: var(--daily-bg) !important;
}

    .daily-all-header button {
        width: 100%;
        border: 0;
        border-radius: 4px;
        background: #35bc91;
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        padding: 5px 0;
    }

    .daily-type-header.header-disabled,
    .daily-all-header.header-disabled,
    .daily-radio-cell.cell-disabled {
        background: #f1f5f9 !important;
        color: #94a3b8 !important;
        opacity: 0.72;
    }

    .daily-shift-actions button:disabled,
    .daily-all-header button:disabled,
    .daily-radio:disabled,
    .daily-radio.disabled {
        cursor: not-allowed;
        opacity: 0.48;
    }

.daily-radio-cell.cell-disabled .daily-radio {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.daily-sticky {
    position: sticky;
    z-index: 8;
}

.daily-col-index {
    left: 0;
    min-width: 45px;
    width: 45px;
}

.daily-col-name {
    left: 45px;
    min-width: 210px;
    width: 210px;
}

.daily-worker-name {
    font-weight: 600;
    color: #000;
}

.daily-attendance-table thead .daily-col-index,
.daily-attendance-table thead .daily-col-name {
    z-index: 10;
    background: #f8fafc !important;
}

.daily-attendance-table tbody .daily-col-index,
.daily-attendance-table tbody .daily-col-name {
    background: #fff !important;
}

.daily-col-shift {
    min-width: 70px;
    font-weight: 600;
}

.daily-shift-badge {
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    font-size: 13px;
}

    .daily-shift-badge.morning {
        background: #dff2ff;
        color: #0074ad;
    }

    .daily-shift-badge.afternoon {
        background: #fff0d2;
        color: #b66300;
    }

.daily-radio-cell {
    text-align: center;
}

.daily-radio {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--daily-color);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .daily-radio.active::after {
        content: "";
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: var(--daily-color);
    }

        .daily-radio.multi.active::after {
            border-radius: 3px;
        }

.daily-data-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
}

#table_result_attendance {
    table-layout: fixed;
    min-width: 760px;
}

    #table_result_attendance th,
    #table_result_attendance td {
        vertical-align: middle;
        white-space: normal;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    #table_result_attendance .result-attendance-col-index {
        width: 52px;
    }

    #table_result_attendance .result-attendance-col-name {
        width: 220px;
    }

    #table_result_attendance .result-attendance-col-code {
        width: 95px;
    }

    #table_result_attendance .result-attendance-col-action {
        width: 62px;
    }

    #table_result_attendance .result-attendance-col-type {
        width: auto;
    }

.result-action-group {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem;
}

    .result-action-group > .btn {
        border-radius: 0.25rem !important;
    }

@media (max-width: 768px) {
    .daily-data-head,
    .daily-data-foot {
        align-items: stretch;
        flex-direction: column;
    }

    .daily-search {
        width: 100%;
    }

    .daily-attendance-table {
        font-size: 12px;
    }

    #table_result_attendance {
        min-width: 720px;
        font-size: 12px;
    }

        #table_result_attendance th,
        #table_result_attendance td {
            padding: 0.35rem 0.4rem;
        }

        #table_result_attendance .result-attendance-col-index {
            width: 44px;
        }

        #table_result_attendance .result-attendance-col-name {
            width: 145px;
        }

        #table_result_attendance .result-attendance-col-code {
            width: 68px;
        }

        #table_result_attendance .result-attendance-col-action {
            width: 52px;
        }

        #table_result_attendance .result-attendance-col-type {
            min-width: 78px;
        }

    .result-action-group {
        width: 100%;
        justify-content: stretch;
    }

        .result-action-group > .btn {
            flex: 1 1 150px;
            white-space: normal;
        }
}
