/* Cari yönetim: kart -> fatura -> ödeme dağılımı. DataTables yerel dosyalardan yüklenir. */
.finance-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
}
.finance-form .wide {
    grid-column: 1/-1;
}
.finance-form [hidden] {
    display: none !important;
}
.finance-form label {
    font-size: 13px;
}
.finance-page .panel {
    min-width: 0;
}
.finance-table {
    overflow-x: auto;
    max-width: 100%;
}
.finance-table table {
    min-width: 700px;
}
.finance-table small {
    display: block;
    max-width: 260px;
    white-space: normal;
    color: var(--muted);
    font-size: 11px;
}
.finance-table .actions {
    min-width: 140px;
}
.finance-table td {
    vertical-align: middle;
    white-space: normal;
}
.finance-table th {
    white-space: nowrap;
}
.finance-table div.dt-container {
    padding: 2px;
}
.finance-table div.dt-container .dt-layout-row {
    gap: 18px;
    margin: 0 0 18px;
}
.finance-table .dt-search label,
.finance-table .dt-length label {
    display: inline;
    font-weight: 500;
    margin: 0;
}
.finance-table input.dt-input {
    min-width: 150px;
    width: 190px;
}
.finance-table select.dt-input {
    width: auto;
    min-width: 65px;
}
.finance-table .dt-paging-button {
    min-height: 34px;
}
.account-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.account-hero h2 {
    font-size: 24px;
}
.account-hero p {
    margin: 4px 0;
}
.matching {
    margin-top: 16px;
    max-height: 380px;
    overflow: auto;
}
.match-amount {
    min-width: 130px !important;
    max-width: 170px;
}
.statement-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}
.statement-filters label {
    margin: 0;
}
.statement-mail {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}
.statement-mail .checkbox {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.statement-mail input[type='checkbox'] {
    width: auto;
    min-height: 0;
}
.statement-wrap {
    overflow-x: auto;
    margin-top: 22px;
}
.statement-paper table {
    white-space: normal;
}
.statement-paper p {
    overflow-wrap: anywhere;
}
.smtp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
    gap: 24px;
}
.smtp-grid select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
}
@media (max-width: 800px) {
    .finance-form {
        grid-template-columns: minmax(0, 1fr);
    }
    .account-hero {
        align-items: flex-start;
        flex-direction: column;
    }
    .finance-page .detailstats {
        grid-template-columns: minmax(0, 1fr);
    }
    .finance-table div.dt-container .dt-layout-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .finance-table input.dt-input {
        max-width: 180px;
    }
    .statement-paper {
        padding: 12px !important;
        min-width: 620px;
    }
    .smtp-grid {
        grid-template-columns: 1fr;
    }
}
@media print {
    .no-print,
    .sidebar,
    .topbar,
    .panel-footer {
        display: none !important;
    }
    .statement-wrap {
        padding: 0 !important;
        overflow: visible;
        border: 0;
        box-shadow: none;
    }
    .statement-paper {
        max-width: none !important;
        min-width: 0 !important;
        padding: 0 !important;
    }
    .statement-paper th,
    .statement-paper td {
        font-size: 10px;
    }
    .statement-paper thead {
        display: table-header-group;
    }
    .statement-paper tr {
        break-inside: avoid;
    }
    .workspace {
        margin: 0 !important;
    }
    .panel-main {
        padding: 0 !important;
    }
}

/* İşlem hücreleri: yatay/dikey merkez ve tüm satırlarda aynı buton ölçüsü. */
.finance-table th.finance-actions,
.finance-table td.finance-actions {
    text-align: center !important;
    vertical-align: middle;
}
.finance-table .finance-actions .actions {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}
.finance-table .finance-actions .actions > button,
.finance-table .finance-actions .actions > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 86px;
    width: 86px;
    min-height: 38px;
    height: 38px;
    padding: 6px 10px;
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    box-sizing: border-box;
    white-space: nowrap;
}
.department-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.department-layout > .card {
    margin: 0;
    min-width: 0;
}
.department-layout table {
    min-width: 400px;
}
.department-layout input[type='checkbox'] {
    width: auto;
}
@media (max-width: 950px) {
    .department-layout {
        grid-template-columns: 1fr;
    }
}

/* İçerikle ilişkili Excel işlemleri ve kategorili navigasyon. */
.sidebar .nav-group {
    display: grid;
    gap: 3px;
    padding: 12px 0;
    border-top: 1px solid #e5edeb;
}
.sidebar .nav-group:first-child {
    border-top: 0;
    padding-top: 0;
}
.sidebar .nav-group .nav-label {
    margin: 0;
    padding: 5px 16px 7px;
    color: #607d76;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 1.2px;
}
.bulk-intro p {
    margin: 8px 0;
    line-height: 1.65;
    font-size: 13px;
}
.bulk-target {
    padding: 12px;
    background: #edf6f2;
    border-radius: 8px;
}
.bulk-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.bulk-steps span {
    background: #edf4f2;
    color: #276458;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
}
.bulk-summary {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 14px;
    background: #f3f7f5;
    border-radius: 8px;
}
.bulk-preview {
    max-height: 340px;
    overflow: auto;
}
.bulk-preview table {
    min-width: 600px;
}
.bulk-preview td:last-child {
    white-space: normal;
    min-width: 250px;
}
.bulk-confirm {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 18px !important;
}
.bulk-confirm input {
    width: auto !important;
}
.account-hero > .actions {
    max-width: 470px;
    justify-content: flex-end;
    margin: 0;
}
.finance-page .heading > .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin: 0;
}
.finance-page .heading > .actions button {
    font-size: 12px;
}
.finance-form ~ small {
    color: var(--muted);
}
@media (max-width: 800px) {
    .account-hero > .actions,
    .finance-page .heading > .actions {
        justify-content: flex-start;
        width: 100%;
    }
    .bulk-steps {
        gap: 5px;
    }
}

/* İşçi tablosunun görünüm tercihleri ve alacak kırılımı. */
.worker-columns {
    margin-bottom: 18px;
    border: 1px solid #dbe7e2;
    border-radius: 10px;
    background: #f8fbf9;
}
.worker-columns > summary {
    cursor: pointer;
    padding: 13px 16px;
    font-weight: 600;
    color: #315f55;
}
.worker-columns-body {
    padding: 0 16px 16px;
}
.worker-columns-body > p {
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}
#workerColumnOptions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 6px 24px;
    margin: 14px 0;
}
.worker-column-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #e2ebe6;
    padding: 7px 0;
}
.worker-column-option label {
    display: flex !important;
    gap: 8px;
    align-items: center;
    margin: 0 !important;
    font-weight: 500 !important;
    font-size: 12px;
}
.worker-column-option input {
    width: 16px !important;
    min-height: 16px !important;
    accent-color: #287460;
}
.worker-column-option > div {
    display: flex;
    gap: 4px;
}
.worker-column-option button {
    padding: 5px 10px !important;
}
.worker-column-option button:disabled {
    opacity: 0.35;
    cursor: default;
}
.worker-detail-cell {
    min-width: 260px;
}
.worker-accrual-details {
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow: auto;
    padding-right: 5px;
}
.worker-accrual-item {
    padding: 9px 11px;
    background: #f2f7f4;
    border: 1px solid #e2ebe5;
    border-radius: 8px;
}
.worker-accrual-item > strong {
    display: block;
    font-size: 12px;
    overflow-wrap: anywhere;
}
.worker-accrual-item > div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    font-size: 11px;
    margin-top: 5px;
    color: #61766f;
}
.worker-accrual-item b {
    white-space: nowrap;
}
.worker-settled {
    color: #28745a;
    font-weight: 600;
}
#workersTable th[draggable='true'] {
    cursor: grab;
}
#workersTable th[draggable='true']:active {
    cursor: grabbing;
}

/* Örnek HTML'nin kompakt işçi kartları düzeni; yalnız bu sayfaya uygulanır. */
#workers .heading h1 {
    font-size: 23px;
    letter-spacing: 0;
}
#workers .heading {
    margin-bottom: 18px;
}
#workers .heading > .actions {
    max-width: none;
}
#workers .worker-toolbar {
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
#workers .worker-toolbar > input {
    width: 260px;
}
#workers .worker-toolbar > select {
    width: 180px;
}
#workers .worker-toolbar input,
#workers .worker-toolbar select {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
}
#workers .worker-columns {
    position: relative;
    flex: none;
    margin: 0;
    border: 0;
    background: none;
}
#workers .worker-columns > summary {
    list-style: none;
    padding: 10px 13px;
    background: #eaf1f7;
    border: 1px solid #dce5ef;
    border-radius: 7px;
    font-size: 13px;
}
#workers .worker-columns > summary::-webkit-details-marker {
    display: none;
}
#workers .worker-columns-body {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 300px;
    max-width: calc(100vw - 40px);
    max-height: 65vh;
    overflow: auto;
    background: #fff;
    border: 1px solid #dce5ef;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 12px 32px #17334622;
    z-index: 20;
}
#workers #workerColumnOptions {
    display: block;
    margin: 8px 0;
}
#workers .worker-columns-body > p {
    margin: 8px 0;
}
#workers .panel {
    padding: 17px;
    border-radius: 10px;
}
#workers .dt-search {
    display: none;
}
#workers .finance-table table {
    border-collapse: collapse;
}
#workersTable th {
    background: #f5f8fc;
    font-size: 12px;
    padding: 11px 12px;
}
#workersTable td {
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
}
#workersTable .actions {
    flex-wrap: nowrap;
    gap: 6px;
}
#workersTable .actions button {
    padding: 8px 10px;
    font-size: 12px;
}
#workersTable tbody tr:hover {
    background: #f8fbff;
}
#workers .worker-name {
    display: flex;
    align-items: center;
    gap: 6px;
}
#workers .arrowbtn {
    background: none;
    border: 0;
    padding: 4px 5px;
    color: #246784;
    cursor: pointer;
}
#workers .worker-accrual-details {
    gap: 3px;
    max-height: 210px;
}
#workers .worker-accrual-item {
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}
#workers .worker-accrual-item > strong {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}
#workers .worker-accrual-item > div {
    margin: 0;
    font-size: 12px;
    gap: 8px;
}
#workers .worker-accrual-item b {
    font-weight: 600;
}
#workers .worker-history {
    background: #f4f8fd;
    border-left: 3px solid #4d8baa;
    padding: 12px 14px;
    white-space: normal;
}
#workers .worker-history-scroll {
    overflow: auto;
    margin-top: 10px;
}
#workers .worker-history table {
    min-width: 480px;
}
@media (max-width: 800px) {
    #workers .worker-toolbar > input {
        width: 100%;
        max-width: none;
    }
    #workers .worker-toolbar > select {
        flex: 1;
        min-width: 130px;
    }
    #workers .worker-columns-body {
        right: auto;
        left: 0;
    }
    #workers .panel {
        padding: 12px;
    }
    #workers .heading > .actions {
        justify-content: flex-start;
    }
}

/* Sütun seçici: sabit başlık/altlık, tek satırlı kontroller; sürükleme ayrı tutamaçta. */
#workers .worker-columns-body {
    width: 350px;
    padding: 0;
    overflow: hidden;
    max-height: none;
    box-shadow: 0 16px 48px #19392f26;
    border-color: #d5e4dd;
}
#workers .column-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #f6faf8;
    border-bottom: 1px solid #e2ebe6;
}
#workers .column-panel-heading strong {
    display: block;
    font-size: 14px;
    color: #234d40;
}
#workers #workerColumnCount {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #6a8178;
}
#workers .column-panel-close {
    background: transparent;
    color: #61766c;
    border: 0;
    font-size: 23px;
    padding: 2px 7px;
    line-height: 1;
}
#workers .worker-columns-body > p {
    margin: 12px 18px;
    font-size: 11px;
    line-height: 1.6;
}
#workers #workerColumnOptions {
    display: block;
    margin: 0;
    padding: 0 12px;
    max-height: min(400px, 45vh);
    overflow-y: auto;
}
#workers .worker-column-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 60px;
    align-items: center;
    gap: 8px;
    padding: 9px 6px;
    border: 0;
    border-bottom: 1px solid #eef2ef;
    border-radius: 5px;
}
#workers .worker-column-option:hover {
    background: #f4f8f5;
}
#workers .column-position {
    font-size: 10px;
    color: #93a59c;
    font-variant-numeric: tabular-nums;
}
#workers .worker-column-option label {
    min-width: 0;
    cursor: pointer;
    color: #304d41;
    gap: 9px;
}
#workers .worker-column-option.is-hidden label {
    color: #83918a;
}
#workers .worker-column-option input {
    margin: 0;
    flex: none;
    width: 16px !important;
    height: 16px;
    min-height: 16px !important;
}
#workers .column-order-buttons {
    display: flex;
    gap: 3px;
}
#workers .column-order-buttons button {
    width: 28px;
    height: 28px;
    min-height: 0;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e9e3;
    border-radius: 6px;
    background: #fff;
    color: #547463;
    font-size: 14px;
}
#workers .column-order-buttons button:hover:not(:disabled) {
    background: #e5f1e9;
    color: #1d6041;
}
#workers .column-order-buttons button:disabled {
    opacity: 0.25;
}
#workers .column-panel-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid #e2ebe6;
    background: #f8fbf9;
}
#workers .column-panel-footer button {
    font-size: 12px;
    padding: 8px 13px;
}
#workersTable th[data-worker-column] {
    cursor: pointer;
}
#workersTable th[data-worker-column='detail'] {
    cursor: default;
}
#workersTable .worker-column-grip {
    display: inline-block;
    float: left;
    font-size: 15px;
    line-height: 20px;
    margin-right: 6px;
    color: #92a39b;
    cursor: grab;
    user-select: none;
}
#workersTable .worker-column-grip:active {
    cursor: grabbing;
}
#workersTable th.dt-ordering-asc,
#workersTable th.dt-ordering-desc {
    background: #e8f2eb;
    color: #205d43;
}

/* Araç çubuğundaki metin alanı genişliği, sütun checkboxlarına uygulanmaz. */
#workers .worker-column-option input[type='checkbox'] {
    min-width: 16px !important;
    max-width: 16px !important;
    padding: 0 !important;
    flex: 0 0 16px;
}
#workers .worker-column-option label > span {
    white-space: nowrap;
    font-size: 12px;
}
#workers .worker-column-option label {
    overflow: hidden;
}
/* İşçi cari hesabındaki aramalı seçim alanı. */
:is(#workerCurrent, #invoiceCurrent) .worker-current-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 420px;
    max-width: 100%;
    min-width: 0;
}
#workerCurrent .worker-current-toolbar {
    align-items: flex-end;
}
#workerCurrent .worker-current-toolbar > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
}
#workerCurrent #sortWC {
    min-height: 44px;
    width: 240px;
    max-width: 100%;
}
:is(#workerCurrent, #invoiceCurrent) .select2-container {
    max-width: 100%;
    font-size: 13px;
}
:is(#workerCurrent, #invoiceCurrent) .select2-selection--single {
    height: 44px;
    border: 1px solid #d6e1dd;
    border-radius: 8px;
    background: #fff;
}
:is(#workerCurrent, #invoiceCurrent) .select2-selection__rendered {
    line-height: 42px;
    padding-left: 12px;
    color: #243b44;
}
:is(#workerCurrent, #invoiceCurrent) .select2-selection__arrow {
    height: 42px;
    right: 8px;
}
:is(#workerCurrent, #invoiceCurrent) .select2-container--focus .select2-selection,
:is(#workerCurrent, #invoiceCurrent) .select2-container--open .select2-selection {
    border-color: #147b70;
    box-shadow: 0 0 0 3px #147b7015;
}
.select2-dropdown {
    border-color: #d6e1dd;
    border-radius: 8px;
    font: 13px var(--app-font);
    box-shadow: 0 8px 24px #173e4415;
}
.select2-search--dropdown .select2-search__field {
    min-width: 0;
    width: 100%;
    padding: 10px;
    border: 1px solid #d6e1dd !important;
    border-radius: 6px;
    font: inherit;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #147b70;
}
/* Cari hesapta her alacağın ödemeleri aynı satırda gösterilir. */
:is(#workerMoves, #currentMoves) .worker-accrual-payments {
    display: block;
}
:is(#workerMoves, #currentMoves) .worker-accrual-payment {
    display: block;
    padding: 2px 0;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.6;
}
:is(#workerMoves, #currentMoves) .worker-payment-date {
    font-variant-numeric: tabular-nums;
}
:is(#workerMoves, #currentMoves) .worker-accrual-payment strong {
    font-variant-numeric: tabular-nums;
}
:is(#workerMoves, #currentMoves) .worker-payment-note {
    color: #73858a;
    font-size: 11px;
}
:is(#workerMoves, #currentMoves) .worker-payment-cancel {
    margin-left: 8px;
    min-height: 0;
    padding: 2px 0;
    background: transparent;
    color: #a44444;
    font-size: 11px;
}
:is(#workerMoves, #currentMoves) .is-cancelled strong {
    text-decoration: line-through;
    color: #a44444;
}
:is(#workerMoves, #currentMoves) .worker-accrual-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 11px;
    background: #f1f4f7;
    color: #617084;
}
:is(#workerMoves, #currentMoves) .worker-accrual-status.settled {
    background: #e6f3ec;
    color: #205d43;
}
:is(#workerMoves, #currentMoves) .worker-accrual-status.partial {
    background: #fff3d9;
    color: #8a611b;
}
:is(#workerMoves, #currentMoves) .worker-accrual-status.cancelled {
    background: #fdeaea;
    color: #a44444;
}
.worker-cancelled-payments {
    margin-top: 16px;
    color: #73858a;
}

#currentMoves .invoice-payment-actions {
    display: inline-flex;
    gap: 8px;
    margin-left: 10px;
    vertical-align: baseline;
}
#currentMoves .invoice-payment-actions button {
    min-height: 0;
    padding: 2px 0;
    background: transparent;
    color: #246784;
    font-size: 11px;
}
#currentMoves .invoice-payment-actions button.danger {
    color: #a44444;
}
