﻿body {
    margin: 0;
    padding: 2px;
    font-family: "Segoe UI", sans-serif;
    background: #eef2f5;
    color: #1f2937;
}

body,
table,
input,
select,
button {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-shell {
    max-width: 100%;
    padding-bottom: 6px;
}

.top-login-bar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 2px 5px;
}

.brand-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
}

.app-logo-mini {
    width: 17px;
    height: 17px;
    object-fit: contain;
    flex-shrink: 0;
}

.app-title-mini {
    font-size: .76rem;
    line-height: 1;
    color: #0f172a;
    letter-spacing: .1px;
}

.summary-mini {
    padding-left: 1px;
    font-size: .57rem;
    line-height: 1.2;
    color: #6b7280;
}

.app-card {
    border: 0;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
    background: #fff;
}

.card-header,
.card-body,
.modal-header,
.modal-body,
.modal-footer {
    padding: 8px !important;
}

.action-card {
    margin-bottom: 6px;
}

    .action-card .card-body {
        padding: 7px !important;
    }

.top-action-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.main-action-row-compact,
.action-session-wrap,
.result-action-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.main-action-row-compact,
.action-session-wrap {
    justify-content: flex-end;
}

.btn-main,
.btn-sub,
.result-action-row .btn {
    box-shadow: none !important;
    white-space: nowrap;
}

.btn-main {
    min-height: 31px;
    padding: 4px 10px;
    font-size: 11.5px;
    line-height: 1;
    border-radius: 9px;
    font-weight: 700;
}

.btn-sub {
    min-height: unset !important;
    padding: 4px 9px;
    font-size: 11px;
    line-height: 1;
    border-radius: 8px;
    font-weight: 700;
}

.btn-soft {
    background: #f5f7fa;
    border-color: #e2e8f0;
    color: #334155;
}

.btn-more-mini {
    min-width: 54px;
    padding-left: 10px;
    padding-right: 10px;
}

.action-session-wrap {
    width: 100%;
}

.action-session-box {
    width: 100%;
    max-width: 265px;
}

.action-refresh-btn {
    min-width: 48px;
}

.more-action-box {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
    padding: 6px;
    border: 1px solid #edf1f5;
    border-radius: 10px;
    background: #fafbfc;
}

.guide-modal-body {
    color: #1f2937;
}

.guide-step-list {
    display: grid;
    gap: 8px;
}

.guide-stage-title {
    margin-top: 4px;
    padding: 7px 9px;
    border-left: 4px solid #198754;
    border-radius: 8px;
    background: #ecfdf3;
    color: #14532d;
    font-size: .9rem;
    font-weight: 900;
    line-height: 1.2;
}

.guide-step {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 8px;
    padding: 9px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.guide-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1;
}

.guide-step-title {
    margin-bottom: 2px;
    color: #0f5132;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.2;
}

.guide-step-text {
    color: #374151;
    font-size: .76rem;
    line-height: 1.35;
}

.guide-note-box {
    margin-top: 9px;
    padding: 8px 9px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #78350f;
    font-size: .74rem;
    line-height: 1.35;
}

.main-card {
    margin-top: 0;
}

.mobile-tab-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px !important;
}

    .mobile-tab-menu .nav-item {
        width: 100%;
    }

    .mobile-tab-menu .nav-link {
        min-height: 34px;
        padding: 6px 4px !important;
        border-radius: 9px;
        font-size: .79rem;
        border: 1px solid transparent;
    }

        .mobile-tab-menu .nav-link.active {
            box-shadow: none;
        }

.inner-card {
    overflow: hidden;
}

.section-header {
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
}

.support-header {
    background: rgba(13, 110, 253, .07);
}

.section-head-wrap,
.result-top-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.main-box-title,
.support-box-title {
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.15;
    color: #198754;
}

.worker-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 220px;
    margin-left: auto;
}

    .worker-search-box .form-control,
    .worker-search-box .btn {
        min-height: 31px;
        font-size: 11.5px;
        border-radius: 8px;
    }

.table-card-body {
    padding: 6px !important;
}

.support-card-body {
    padding: 8px !important;
}

.table-mobile-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5eaf0;
    border-radius: 11px;
    background: #fff;
}

.app-table-main,
.result-table-mobile {
    width: 100%;
    min-width: 980px;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10px;
}

    .app-table-main thead th,
    .result-table-mobile thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        vertical-align: middle;
        white-space: nowrap;
        border-bottom-width: 1px;
    }

    .app-table-main th,
    .app-table-main td,
    .result-table-mobile th,
    .result-table-mobile td {
        padding: 3px 4px;
        text-align: center;
        vertical-align: middle;
        border-color: #dde5ee;
    }

    .app-table-main thead th {
        background: #fff;
        color: #14532d;
        font-size: 10.5px;
        font-weight: 800;
    }

    .app-table-main thead tr:first-child th {
        padding-top: 6px;
        padding-bottom: 6px;
    }

.group-header-cup,
.group-header-sub {
    background: #eaf8ef !important;
    color: #198754 !important;
    font-weight: 800;
}

.group-header-cup-sub {
    background: #f4fbf6 !important;
    color: #dc3545 !important;
    font-weight: 800;
    min-width: 48px;
}

.group-header-sub {
    min-width: 56px;
}

.bg_header {
    background: #dbe7ff !important;
}

.bg_header_support {
    background: #d1e7dd !important;
}

.th-stt {
    font-size: 11px !important;
    font-weight: 900 !important;
}

.th-worker-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.05;
}

    .th-worker-wrap > span {
        font-size: 11px;
        font-weight: 800;
    }

.th-plot {
    font-size: 9.5px !important;
    color: #64748b !important;
}

.first_row {
    z-index: 7 !important;
}

.invisible {
    display: none !important;
}

.app-table-main tbody tr:nth-child(even) td,
.result-table-mobile tbody tr:nth-child(even) td {
    background: #fbfcfd;
}

.app-table-main tbody tr:hover td,
.result-table-mobile tbody tr:hover td {
    background: #eefaf2;
}

.app-table-main td:nth-child(1),
.app-table-main th:nth-child(1) {
    width: 44px;
    min-width: 44px;
}

.app-table-main td:nth-child(2),
.app-table-main th:nth-child(2) {
    min-width: 138px;
    max-width: 138px;
}

.app-table-main td:nth-child(6),
.app-table-main td:nth-child(7),
.app-table-main td:nth-child(8),
.app-table-main td:nth-child(9),
.app-table-main td:nth-child(10),
.app-table-main td:nth-child(11),
.app-table-main td:nth-child(12),
.app-table-main td:nth-child(13),
.app-table-main th:nth-child(6),
.app-table-main th:nth-child(7),
.app-table-main th:nth-child(8),
.app-table-main th:nth-child(9),
.app-table-main th:nth-child(10),
.app-table-main th:nth-child(11),
.app-table-main th:nth-child(12),
.app-table-main th:nth-child(13) {
    min-width: 35px;
}

.app-table-main td:nth-child(14),
.app-table-main th:nth-child(14) {
    min-width: 88px;
}

.app-table-main tbody td:nth-child(1) {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 900;
    color: #111827;
}

.app-table-main tbody td:nth-child(2),
.app-table-main tbody td:nth-child(2) input,
.app-table-main tbody td:nth-child(2) span {
    text-align: left !important;
    line-height: 1.15;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #111827 !important;
}

.app-table-main tbody td:nth-child(5),
.app-table-main tbody td:nth-child(5) input,
.app-table-main tbody td:nth-child(5) span {
    font-size: 8px !important;
    line-height: 1.1;
    font-weight: 700 !important;
    color: #64748b !important;
    white-space: normal;
    word-break: break-word;
}

.app-table-main input,
.result-table-mobile input,
.mobile-control,
.search-select-toggle {
    width: 100%;
    min-width: 100px;
    min-height: 30px;
    padding: 2px 5px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #d5dde6;
    border-radius: 7px;
    background: #fff;
    box-shadow: none !important;
}

    .app-table-main input:focus,
    .result-table-mobile input:focus,
    .mobile-control:focus,
    .form-select:focus,
    .form-control:focus,
    .search-select-toggle:focus {
        outline: none;
        box-shadow: none;
        border-color: #198754;
        background: #fcfffd;
    }

.app-table-main td:nth-child(2) input,
.app-table-main td:nth-child(3) input,
.app-table-main td:nth-child(4) input,
.app-table-main td:nth-child(5) input {
    min-height: auto;
    padding: 0;
    border: none;
    background: transparent;
}

.app-table-main td:nth-child(3),
.app-table-main td:nth-child(4) {
    font-size: 9px;
}

input[disabled],
select[disabled] {
    color: #111827 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #111827 !important;
    background: transparent !important;
    border: none !important;
    font-weight: 700;
    cursor: default;
    pointer-events: none;
}

.sticky-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding-top: 7px;
    background: linear-gradient(to top, #fff 75%, rgba(255, 255, 255, 0));
}

.save-main-btn {
    min-height: 34px;
    border-radius: 9px;
    font-size: 12px;
    box-shadow: none !important;
}

.support-label,
.support-group-title {
    font-size: .79rem;
}

.support-group-title {
    margin-bottom: 8px;
    font-weight: 800;
    color: #0d6efd;
}

.support-group-title-wire {
    color: #198754;
}

.support-panel {
    height: 100%;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, .05);
    border-radius: 11px;
}

.support-panel-cup {
    background: rgba(13, 110, 253, .07);
}

.support-panel-wire {
    background: rgba(25, 135, 84, .07);
}

.input-mini-label {
    margin-bottom: 3px;
    font-size: .69rem;
}

.result-filter-box {
    min-width: 180px;
}

.result-action-row .btn {
    min-height: 31px;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 8px;
}

.result-title-box {
    padding: 6px 8px;
    background: rgba(13, 110, 253, .08);
    border-radius: 8px;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-alert {
    margin-bottom: 6px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: .71rem;
}

.list-group-item {
    padding: 6px !important;
}

tfoot tr {
    background: #f8f9fa;
    font-weight: 800;
}

#modal_sync_data,
#moda_reset_token {
    background: rgba(0, 0, 0, .3);
}

.btn-xs {
    padding: 1px 5px;
    font-size: 9.5px;
    line-height: 1.2;
    border-radius: 6px;
}

pre {
    margin-top: 6px;
    padding: 6px;
    overflow-x: auto;
    white-space: pre-wrap;
    font-size: 11px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.search-select-box {
    position: relative;
    width: 100%;
}

.search-select-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left !important;
    padding-left: 10px;
    padding-right: 10px;
    cursor: pointer;
}

.search-select-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.search-select-arrow {
    margin-left: 8px;
    color: #64748b;
    flex-shrink: 0;
}

.search-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 40;
    display: none;
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
    overflow: hidden;
}

.search-select-box.open .search-select-dropdown {
    display: block;
}

.search-select-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #edf2f7;
    background: #f8fafc;
}

.search-select-list {
    max-height: 220px;
    overflow-y: auto;
}

.search-select-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    color: #111827;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
}

    .search-select-item:hover,
    .search-select-item.active {
        background: #eefaf2;
        color: #198754;
    }

.search-select-empty {
    display: none;
    padding: 10px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.search-select-native {
    display: none;
}

#div_search,
#div_search .col-12,
#div_search .col-lg-6 {
    text-align: left;
}

    #div_search .support-label {
        display: block;
        text-align: left;
    }

    #worker_id,
    #tree_part,
    #div_search .form-select,
    #div_search .mobile-control {
        text-align: left !important;
        text-align-last: left !important;
        padding-left: 10px;
    }

@media (max-width: 991.98px) {
    body {
        padding: 2px;
    }

    .app-shell {
        padding-bottom: 5px;
    }

    .summary-mini {
        font-size: .54rem;
    }

    .btn-main,
    .btn-sub,
    .btn-soft,
    #modal_fetch_data .btn,
    #modal_fetch_data .form-control,
    #modal_fetch_data .form-select,
    #modal_result_data .btn,
    #modal_sync_data .btn,
    #moda_reset_token .btn,
    #confirm_modal .btn,
    #modal_conflict_data .btn {
        min-height: 30px;
        font-size: 11px;
    }

    .worker-search-box {
        max-width: 100%;
    }

    .app-table-main {
        min-width: 920px;
        font-size: 9px;
    }

    .result-table-mobile {
        min-width: 940px;
        font-size: 9px;
    }

        .app-table-main th,
        .app-table-main td,
        .result-table-mobile th,
        .result-table-mobile td {
            padding: 2px 3px;
        }

        .app-table-main thead th,
        .result-table-mobile thead th {
            padding: 4px 2px;
            font-size: 11px !important;
        }

    .app-table-main td:nth-child(1),
    .app-table-main th:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 6;
        width: 42px;
        min-width: 42px;
        border-right: 1px solid #dbe3ec;
    }

    .app-table-main td:nth-child(2),
    .app-table-main th:nth-child(2) {
        position: sticky;
        left: 42px;
        z-index: 5;
        min-width: 126px;
        max-width: 126px;
        border-right: 1px solid #dbe3ec;
    }

    .app-table-main thead th:nth-child(1),
    .app-table-main thead th:nth-child(2) {
        z-index: 8;
        font-size: 12px;
    }

    .app-table-main tbody td:nth-child(1) {
        background: #f8fafc !important;
        font-size: 11.5px;
    }

    .app-table-main tbody td:nth-child(2),
    .app-table-main tbody td:nth-child(2) input,
    .app-table-main tbody td:nth-child(2) span,
    .app-table-main tbody td:nth-child(5),
    .app-table-main tbody td:nth-child(5) input,
    .app-table-main tbody td:nth-child(5) span {
        font-size: 9px !important;
    }

    .app-table-main input,
    .result-table-mobile input,
    .mobile-control,
    .search-select-toggle {
        min-height: 29px;
        padding: 2px 4px;
        font-size: 12px;
    }

    .group-header-cup-sub {
        min-width: 44px;
    }

    .group-header-sub {
        min-width: 50px;
    }
}

@media (max-width: 575.98px) {
    body {
        padding: 1px !important;
    }

    .container-fluid,
    .card-body,
    .card-header,
    .modal-body,
    .modal-header,
    .modal-footer {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .top-login-bar {
        padding-bottom: 4px;
    }

    .app-logo-mini {
        width: 16px;
        height: 16px;
    }

    .app-title-mini {
        font-size: .72rem;
    }

    .summary-mini {
        margin-bottom: 0;
        font-size: .51rem;
    }

    .main-action-row-compact {
        gap: 4px;
    }

    .btn-main,
    .btn-sub,
    .btn-soft,
    .worker-search-box .form-control,
    .worker-search-box .btn,
    #modal_fetch_data .form-control,
    #modal_fetch_data .form-select,
    #modal_fetch_data .btn,
    #modal_result_data .btn,
    #modal_sync_data .btn,
    #moda_reset_token .btn,
    #confirm_modal .btn,
    #modal_conflict_data .btn {
        min-height: 29px;
        padding: 4px 7px;
        font-size: 10.5px;
        border-radius: 7px;
    }

    .btn-more-mini {
        min-width: 50px;
    }

    .mobile-tab-menu {
        gap: 5px;
        margin-bottom: 7px !important;
    }

        .mobile-tab-menu .nav-link {
            min-height: 31px;
            padding: 5px 4px !important;
            font-size: .75rem;
            border-radius: 7px;
        }

    .main-box-title,
    .support-box-title {
        font-size: .78rem;
    }

    .support-label,
    .support-group-title {
        font-size: .73rem;
    }

    .input-mini-label {
        font-size: .65rem;
    }

    .app-table-main {
        min-width: 880px;
        font-size: 8px;
    }

    .result-table-mobile {
        min-width: 900px;
        font-size: 8px;
    }

        .app-table-main thead th,
        .result-table-mobile thead th {
            padding: 3px 1px;
            font-size: 8px;
        }

    .app-table-main td:nth-child(1),
    .app-table-main th:nth-child(1) {
        width: 38px;
        min-width: 38px;
        left: 0;
    }

    .app-table-main td:nth-child(2),
    .app-table-main th:nth-child(2) {
        min-width: 96px;
        max-width: 96px;
        left: 38px;
    }

    .group-header-cup-sub {
        min-width: 40px;
    }

    .group-header-sub {
        min-width: 46px;
    }

    .app-table-main tbody td:nth-child(1) {
        font-size: 13px;
    }

    .app-table-main tbody td:nth-child(2),
    .app-table-main tbody td:nth-child(2) input,
    .app-table-main tbody td:nth-child(2) span {
        font-size: 10px !important;
    }

    .app-table-main tbody td:nth-child(5),
    .app-table-main tbody td:nth-child(5) input,
    .app-table-main tbody td:nth-child(5) span {
        font-size: 8.5px !important;
    }

    .app-table-main input,
    .result-table-mobile input,
    .mobile-control,
    .search-select-toggle {
        min-height: 31px;
        padding: 1px 3px;
        font-size: 14.5px;
        border-radius: 6px;
    }

    .save-main-btn {
        min-height: 31px;
        font-size: 11px;
    }

    .result-action-row {
        gap: 4px;
    }

        .result-action-row .btn {
            min-height: 27px;
            padding: 3px 6px;
            font-size: 10px;
        }

    .result-title-box {
        padding: 5px 7px;
        font-size: .63rem;
    }

    .app-alert {
        padding: 6px 7px;
        font-size: .67rem;
    }

    .card {
        border-radius: 9px;
    }
}
.app-table-main input::placeholder,
.result-table-mobile input::placeholder,
.mobile-control::placeholder,
.form-control::placeholder,
.search-select-search-wrap input::placeholder {
    color: #9ca3af !important;
    font-weight: 400 !important;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .app-table-main tbody tr:nth-child(odd) td:nth-child(1),
    .app-table-main tbody tr:nth-child(odd) td:nth-child(2) {
        background: #fff !important;
    }

    .app-table-main tbody tr:nth-child(even) td:nth-child(1),
    .app-table-main tbody tr:nth-child(even) td:nth-child(2) {
        background: #fbfcfd !important;
    }

    .app-table-main thead th:nth-child(1),
    .app-table-main thead th:nth-child(2) {
        background: #fff !important;
    }
    .th-worker-wrap{
        flex-direction:row
    }
}
