.followup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.followup-header h2 {
    margin: 0 0 6px;
}

.followup-subtitle {
    margin: 0;
    color: var(--text-secondary);
}

.followup-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.followup-summary-card {
    position: relative;
    overflow: hidden;
    min-height: 76px;
    padding: 10px 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.followup-summary-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #2563eb;
    content: '';
}

.followup-summary-card:nth-child(n + 3)::before {
    background: #f59e0b;
}

.followup-summary-card:nth-child(5)::before {
    background: #ef4444;
}

.followup-summary-card:nth-child(6)::before {
    background: #10b981;
}

.followup-summary-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.25;
}

.followup-summary-card strong {
    display: block;
    margin-top: 5px;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.followup-summary-card small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
}

.followup-action-bar {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.followup-panel-filter-bar {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.followup-panel-filter-bar .search-box {
    flex: 1 1 320px;
    max-width: 460px;
}

.followup-payment-filter-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.followup-payment-search-group {
    display: flex;
    align-items: center;
    flex: 1 1 420px;
    min-width: 280px;
    max-width: 560px;
    gap: 4px;
}

.followup-payment-filter-control {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.followup-payment-filter-bar .search-box,
.followup-payment-filter-bar select {
    width: 100%;
    max-width: none;
    min-height: 40px;
    box-sizing: border-box;
}

.followup-payment-filter-bar select {
    min-width: 0;
    padding: 8px 4px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.followup-payment-search-control {
    flex: 1 1 auto;
    max-width: none;
}

.followup-payment-status-control {
    flex: 0 0 180px;
    margin-left: auto;
}

.followup-payment-month-control {
    flex: 0 0 150px;
}

.followup-payment-search {
    gap: 6px;
}

.followup-payment-search > i {
    flex: 0 0 auto;
}

.followup-payment-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    box-shadow: none;
}

.followup-payment-reset-btn i {
    margin-right: 0;
    font-size: 16px;
}

.followup-payment-export-wrap {
    position: relative;
    flex: 0 0 36px;
}

.followup-payment-export-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-color: #15803d;
    background: #15803d;
    color: #fff;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.2);
}

.followup-payment-export-trigger:hover,
.followup-payment-export-trigger:focus-visible {
    border-color: #166534;
    background: #166534;
    color: #fff;
}

.followup-payment-export-trigger i {
    display: block;
    margin-right: 0;
    font-size: 16px;
    line-height: 1;
}

.followup-payment-export-menu {
    position: fixed;
    z-index: 5000;
    display: grid;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-lg);
}

.followup-payment-export-menu[hidden] {
    display: none;
}

.followup-payment-export-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.followup-payment-export-menu button:hover,
.followup-payment-export-menu button:focus-visible {
    background: var(--primary-light);
    color: var(--primary);
    outline: none;
}

.followup-payment-export-menu button > i {
    width: 16px;
    color: var(--text-secondary);
    text-align: center;
}

@media (max-width: 640px) {
    .followup-payment-filter-bar {
        flex-wrap: wrap;
    }

    .followup-payment-search-group {
        flex-basis: 100%;
        max-width: none;
    }

    .followup-payment-search-control {
        max-width: none;
    }

    .followup-payment-status-control,
    .followup-payment-month-control {
        flex: 1 1 180px;
    }

    .followup-payment-status-control {
        margin-left: 0;
    }
}

@media (max-width: 420px) {
    .followup-payment-status-control,
    .followup-payment-month-control {
        flex-basis: 100% !important;
    }

    .followup-payment-reset-btn {
        margin-left: auto;
    }
}

.followup-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.followup-filters select {
    min-height: 42px;
    min-width: 170px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.followup-admin-export-btn {
    min-height: 36px;
    padding: 6px 10px;
    white-space: nowrap;
}

#btn-refresh-followup-admin {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
}

.followup-admin-export-btn.btn-loading {
    pointer-events: none;
}

.followup-list-widget,
.followup-detail-widget,
.followup-payment-widget,
.followup-management-widget {
    margin-top: 12px;
}

.followup-tabs {
    display: inline-flex;
    gap: 4px;
    margin: 4px 0 0;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.followup-tabs::-webkit-scrollbar {
    display: none;
}

.followup-tab {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.followup-tab.active {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.followup-tab-label-mobile {
    display: none;
}

.followup-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.followup-management-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.followup-management-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.followup-management-toolbar > span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.followup-management-toolbar .followup-filters {
    justify-content: flex-end;
}

.followup-management-toolbar .followup-filters select {
    min-width: 150px;
}

.followup-management-kpis div {
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.followup-management-kpis span {
    display: block;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.followup-management-kpis strong {
    display: block;
    margin-top: 6px;
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1.15;
}

.followup-management-insights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.followup-management-insights span {
    min-height: 38px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fff1c2;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.followup-management-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.followup-management-card {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
}

.followup-management-card h3 {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.25;
}

.followup-management-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.followup-management-detail-header h3 {
    margin-bottom: 4px;
}

.followup-management-detail-header span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.followup-management-detail-header .followup-filters {
    justify-content: flex-end;
}

.followup-management-detail-header .followup-filters select {
    min-width: 142px;
}

.followup-chart-box {
    height: 280px;
    min-height: 280px;
}

.followup-chart-box-wide {
    height: 340px;
    min-height: 340px;
}

.followup-management-table-wrap {
    margin-top: 10px;
    overflow-x: auto;
}

.followup-management-mini-table,
.followup-management-status-table {
    min-width: 0;
    font-size: 12px;
}

.followup-management-status-table {
    width: 100%;
    table-layout: fixed;
}

.followup-management-status-table th:first-child,
.followup-management-status-table td:first-child {
    width: 52%;
}

.followup-management-status-table th:nth-child(2),
.followup-management-status-table td:nth-child(2),
.followup-management-status-table th:nth-child(3),
.followup-management-status-table td:nth-child(3) {
    width: 24%;
}

.followup-management-mini-table th,
.followup-management-mini-table td,
.followup-management-status-table th,
.followup-management-status-table td {
    padding: 8px 10px;
}

.followup-management-mini-table th:nth-child(n + 2),
.followup-management-mini-table td:nth-child(n + 2),
.followup-management-status-table th:nth-child(n + 2),
.followup-management-status-table td:nth-child(n + 2) {
    text-align: center;
    font-weight: 700;
}

.followup-management-detail-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.followup-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.followup-pagination-actions,
.followup-pagination-actions label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.followup-pagination-actions select {
    min-height: 32px;
    padding: 4px 28px 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-main);
    font: inherit;
}

.followup-pagination-actions .btn-icon {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
}

.followup-pagination-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.followup-list-widget .table-responsive,
.followup-management-card > .table-responsive {
    max-height: min(68vh, 760px);
    overflow: auto;
    scrollbar-gutter: stable;
}

.followup-payment-widget .table-responsive {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-gutter: auto;
}

.followup-list-widget thead th,
.followup-payment-widget thead th,
.followup-management-card > .table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 2px solid var(--border);
    background-color: #e8eef8;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
    color: var(--text-main);
    font-weight: 800;
}

body.dark-theme .followup-list-widget thead th,
body.dark-theme .followup-payment-widget thead th,
body.dark-theme .followup-management-card > .table-responsive thead th {
    background-color: #27364a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.32);
}

.followup-management-card > .table-responsive .followup-management-detail-table th {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    line-height: 1.2;
}

.followup-management-detail-table td {
    font-size: 12px;
    font-weight: 400;
    vertical-align: top;
}

.followup-management-detail-table th,
.followup-management-detail-table td {
    padding: 10px 5px;
}

.followup-management-detail-table th:nth-child(1),
.followup-management-detail-table td:nth-child(1) {
    width: 4%;
}

.followup-management-detail-table th:nth-child(2),
.followup-management-detail-table td:nth-child(2) {
    width: 9%;
    white-space: nowrap;
}

.followup-management-detail-table th:nth-child(3),
.followup-management-detail-table td:nth-child(3) {
    width: 19%;
}

.followup-management-detail-table th:nth-child(4),
.followup-management-detail-table td:nth-child(4) {
    width: 12%;
}

.followup-management-detail-table th:nth-child(5),
.followup-management-detail-table td:nth-child(5) {
    width: 18%;
}

.followup-management-detail-table th:nth-child(6),
.followup-management-detail-table td:nth-child(6) {
    width: 13%;
}

.followup-management-detail-table th:nth-child(7),
.followup-management-detail-table td:nth-child(7) {
    width: 12%;
}

.followup-management-detail-table th:nth-child(8),
.followup-management-detail-table td:nth-child(8) {
    width: 8%;
    white-space: nowrap;
}

.followup-management-detail-table th:nth-child(9),
.followup-management-detail-table td:nth-child(9) {
    width: 5%;
}

.followup-management-detail-table td:nth-child(3),
.followup-management-detail-table td:nth-child(5),
.followup-management-detail-table td:nth-child(6),
.followup-management-detail-table td:nth-child(7) {
    overflow-wrap: anywhere;
}

.followup-management-detail-table td:nth-child(6) {
    text-align: left;
    vertical-align: middle;
}

.followup-management-detail-table td:nth-child(7) {
    text-align: center;
    vertical-align: middle;
}

.followup-management-detail-table td:nth-child(1),
.followup-management-detail-table td:nth-child(2),
.followup-management-detail-table td:nth-child(8),
.followup-management-detail-table td:nth-child(9) {
    text-align: center;
    vertical-align: middle;
}

.followup-management-detail-table td:nth-child(3) strong,
.followup-management-detail-table td:nth-child(3) span {
    display: block;
}

.followup-management-detail-table td:nth-child(3) span {
    margin-top: 3px;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .followup-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .followup-panel-filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .followup-panel-filter-bar .search-box {
        max-width: none;
    }

    .followup-filters {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .followup-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.followup-table {
    min-width: 980px;
    table-layout: fixed;
}

.followup-table th {
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    vertical-align: middle;
}

.followup-table td {
    font-size: 12px;
    line-height: 1.25;
    vertical-align: middle;
}

.followup-table th,
.followup-table td {
    padding: 8px 8px;
}

.followup-table td:nth-child(3) {
    text-align: left;
}

.followup-payment-table {
    min-width: 1180px;
    font-size: 12px;
    table-layout: fixed;
}

.followup-payment-table th {
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: normal;
    text-align: center;
}

.followup-payment-table th,
.followup-payment-table td {
    padding: 8px 6px;
}

.followup-payment-table td {
    font-size: 12px;
    line-height: 1.25;
}

.followup-table td:nth-child(3) strong,
.followup-table td:nth-child(3) span {
    display: block;
}

.followup-table td:nth-child(3) span {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.25;
}

.followup-table td:nth-child(5) small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
}

.followup-table th:nth-child(1),
.followup-table td:nth-child(1),
.followup-table th:nth-child(2),
.followup-table td:nth-child(2),
.followup-table th:nth-child(5),
.followup-table td:nth-child(5),
.followup-table td:nth-child(6) {
    text-align: center;
}

.followup-table th:nth-child(1),
.followup-table td:nth-child(1) {
    width: 44px;
}

.followup-table th:nth-child(2),
.followup-table td:nth-child(2) {
    width: 94px;
    white-space: nowrap;
}

.followup-table th:nth-child(3),
.followup-table td:nth-child(3) {
    width: 360px;
}

.followup-table th:nth-child(4),
.followup-table td:nth-child(4) {
    width: 150px;
}

.followup-table th:nth-child(5),
.followup-table td:nth-child(5) {
    width: 108px;
}

.followup-table th:nth-child(6),
.followup-table td:nth-child(6) {
    width: 70px;
}

.followup-table th:nth-child(7),
.followup-table td:nth-child(7) {
    width: 118px;
    text-align: center;
}

.followup-table td:nth-child(3) strong,
.followup-table .followup-area-manager {
    font-size: 11px;
    line-height: 1.25;
}

.followup-table .followup-status {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 10px;
}

.followup-table .followup-pic-select {
    display: block;
    min-width: 96px;
    min-height: 30px;
    margin: 0 auto;
    padding: 5px 8px;
    font-size: 11px;
    text-align: center;
}

.followup-area-manager {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
    white-space: normal;
}

.followup-area-manager span {
    display: block;
}

.followup-payment-table .followup-area-manager {
    font-size: 11px;
    line-height: 1.25;
}

.followup-payment-table td:nth-child(3) strong,
.followup-payment-table td:nth-child(3) span {
    display: block;
}

.followup-payment-table td:nth-child(3) strong {
    font-size: 11px;
    line-height: 1.25;
}

.followup-payment-table td:nth-child(3) span {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.25;
}

.followup-payment-table th:nth-child(1),
.followup-payment-table td:nth-child(1) {
    width: 3%;
    text-align: center;
    white-space: nowrap;
}

.followup-payment-table th:nth-child(2),
.followup-payment-table td:nth-child(2) {
    width: 7%;
    white-space: nowrap;
}

.followup-payment-table th:nth-child(3),
.followup-payment-table td:nth-child(3) {
    width: 20%;
}

.followup-payment-table th:nth-child(4),
.followup-payment-table td:nth-child(4) {
    width: 10%;
}

.followup-payment-table th:nth-child(5),
.followup-payment-table td:nth-child(5) {
    width: 8%;
    text-align: center;
}

.followup-payment-table th:nth-child(6),
.followup-payment-table td:nth-child(6) {
    width: 10%;
    white-space: nowrap;
}

.followup-payment-table th:nth-child(7),
.followup-payment-table td:nth-child(7) {
    width: 9%;
    white-space: nowrap;
}

.followup-payment-table th:nth-child(8),
.followup-payment-table td:nth-child(8) {
    width: 8%;
    text-align: center;
}

.followup-payment-table th:nth-child(9),
.followup-payment-table td:nth-child(9) {
    width: 10%;
    white-space: nowrap;
}

.followup-payment-table th:nth-child(10),
.followup-payment-table td:nth-child(10) {
    width: 10%;
    text-align: center;
}

.followup-payment-table th:nth-child(11),
.followup-payment-table td:nth-child(11) {
    width: 5%;
    text-align: center;
    white-space: nowrap;
}

.followup-payment-table td:nth-child(6),
.followup-payment-table td:nth-child(7),
.followup-payment-table td:nth-child(9) {
    text-align: right;
}

.followup-money-cell {
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.followup-money-cell.is-minus {
    color: #b91c1c;
}

.followup-money-cell.is-surplus {
    color: #15803d;
}

.followup-payment-paid-input {
    width: 104px;
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
}

.followup-payment-date-input {
    width: 100px;
    min-height: 32px;
    padding: 5px 6px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
}

.followup-payment-paid-input:focus,
.followup-payment-date-input:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.followup-payment-paid-display,
.followup-payment-date-display {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.followup-payment-date-cell {
    text-align: center;
}

.followup-payment-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 108px;
    padding: 5px 9px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.followup-payment-status.outstanding {
    border-color: rgba(185, 28, 28, 0.2);
    background-color: rgba(185, 28, 28, 0.08);
    color: #b91c1c;
}

.followup-payment-status.partial {
    border-color: rgba(217, 119, 6, 0.2);
    background-color: rgba(217, 119, 6, 0.1);
    color: #b45309;
}

.followup-payment-status.complete-payment {
    border-color: rgba(37, 99, 235, 0.18);
    background-color: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.followup-payment-status.surplus {
    border-color: rgba(22, 163, 74, 0.2);
    background-color: rgba(22, 163, 74, 0.1);
    color: #15803d;
}

.followup-payment-status.billing-not-issued {
    border-color: rgba(100, 116, 139, 0.22);
    background-color: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.followup-billing-file-cell,
.followup-payment-evidence-cell,
.followup-payment-action-cell,
.followup-payment-manage-cell {
    vertical-align: middle;
    text-align: center;
}

.followup-payment-table .followup-billing-file-cell,
.followup-payment-table .followup-payment-evidence-cell,
.followup-payment-table .followup-payment-action-cell,
.followup-payment-table .followup-payment-manage-cell {
    line-height: 1;
}

.followup-billing-upload-btn,
.followup-payment-evidence-btn,
.followup-payment-edit-btn,
.followup-payment-save-btn,
.followup-payment-cancel-btn,
.followup-billing-upload-state,
.followup-payment-evidence-state,
.followup-payment-readonly-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    vertical-align: middle;
}

.followup-billing-upload-btn i,
.followup-payment-evidence-btn i,
.followup-payment-edit-btn i,
.followup-payment-save-btn i,
.followup-payment-cancel-btn i,
.followup-billing-upload-state i,
.followup-payment-evidence-state i,
.followup-payment-readonly-action i {
    font-size: 16px;
    line-height: 1;
}

.followup-billing-upload-btn.has-file,
.followup-payment-evidence-btn.has-evidence,
.followup-billing-upload-state.has-file,
.followup-payment-evidence-state.has-evidence {
    border-color: rgba(22, 163, 74, 0.24);
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
}

.followup-billing-upload-state,
.followup-payment-evidence-state,
.followup-payment-readonly-action {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
}

.followup-payment-action-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.followup-payment-manage-trigger {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    font-size: 17px;
}

.followup-payment-manage-trigger[aria-expanded="true"] {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.followup-payment-manage-popover {
    position: fixed;
    z-index: 5000;
    display: grid;
    min-width: 230px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.followup-payment-manage-popover[hidden] {
    display: none;
}

.followup-payment-manage-menu-item {
    width: 100%;
    min-height: 44px;
    padding: 7px 9px;
    border: 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.followup-payment-manage-menu-item > i {
    width: 18px;
    font-size: 17px;
    text-align: center;
}

.followup-payment-manage-menu-item > span,
.followup-payment-manage-menu-item strong,
.followup-payment-manage-menu-item small {
    display: block;
}

.followup-payment-manage-menu-item strong {
    font-size: 12px;
    font-weight: 600;
}

.followup-payment-manage-menu-item small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10px;
}

.followup-payment-manage-menu-item.has-file > i,
.followup-payment-manage-menu-item.has-file small {
    color: #15803d;
}

.followup-payment-manage-menu-item:hover,
.followup-payment-manage-menu-item:focus-visible {
    background: var(--bg-color);
    outline: none;
}

.followup-payment-manage-menu-item:disabled {
    cursor: default;
    opacity: 0.72;
}

.followup-pic-select {
    width: 100%;
    min-width: 150px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.followup-pic-select:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.followup-detail-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.followup-detail-title-wrap h3 {
    margin: 0 0 4px;
    color: var(--text-primary);
    font-size: 18px;
}

.followup-detail-title-wrap p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.followup-detail-table {
    min-width: 1180px;
}

.followup-detail-table th,
.followup-detail-table td {
    padding: 9px 10px;
}

.followup-detail-table th {
    font-size: 10px;
    line-height: 1.25;
}

.followup-detail-table td {
    font-size: 11px;
    line-height: 1.3;
}

.followup-detail-table th:nth-child(1),
.followup-detail-table td:nth-child(1),
.followup-detail-table th:nth-child(5),
.followup-detail-table td:nth-child(5),
.followup-detail-table th:nth-child(6),
.followup-detail-table td:nth-child(6),
.followup-detail-table th:nth-child(8),
.followup-detail-table td:nth-child(8),
.followup-detail-table th:nth-child(9),
.followup-detail-table td:nth-child(9),
.followup-detail-table th:nth-child(10),
.followup-detail-table td:nth-child(10),
.followup-detail-table th:nth-child(11),
.followup-detail-table td:nth-child(11) {
    width: 1%;
    white-space: nowrap;
}

.followup-detail-table th:nth-child(2),
.followup-detail-table td:nth-child(2) {
    width: 86px;
    white-space: normal;
}

.followup-detail-table th:nth-child(3),
.followup-detail-table td:nth-child(3) {
    width: 168px;
}

.followup-detail-table th:nth-child(4),
.followup-detail-table td:nth-child(4) {
    min-width: 270px;
}

.followup-detail-table th:nth-child(7),
.followup-detail-table td:nth-child(7) {
    min-width: 260px;
}

.followup-detail-table td:nth-child(11) {
    min-width: 108px;
    color: var(--text-secondary);
    font-size: 11px;
}

.followup-note-cell,
.followup-evidence-cell {
    text-align: center;
}

.followup-note-btn,
.followup-evidence-btn {
    min-width: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.followup-note-btn i,
.followup-evidence-btn i {
    font-size: 16px;
    line-height: 1;
}

.followup-note-btn {
    position: relative;
}

.followup-note-btn.has-note {
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.followup-note-dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--bg-primary);
    border-radius: 999px;
    background: #2563eb;
}

.followup-note-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.followup-note-modal-content,
.followup-billing-modal-content,
.followup-payment-edit-modal-content {
    width: min(520px, calc(100vw - 32px));
}

.followup-payment-edit-context {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
}

.followup-payment-edit-context strong {
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.35;
}

.followup-payment-edit-context span {
    color: var(--text-secondary);
    font-size: 11px;
}

.followup-payment-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.followup-payment-edit-field-wide {
    grid-column: 1 / -1;
}

.followup-payment-edit-field > span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.followup-payment-edit-field input {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
}

.followup-payment-edit-field input:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.followup-payment-edit-field small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.35;
}

.followup-payment-edit-readonly-field {
    padding: 10px 12px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.06);
}

.followup-payment-edit-readonly-field strong {
    display: block;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.25;
}

@media (max-width: 560px) {
    .followup-payment-edit-grid {
        grid-template-columns: 1fr;
    }

    .followup-payment-edit-field-wide {
        grid-column: auto;
    }
}

.followup-note-field span,
.followup-billing-field span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.followup-note-field textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

.followup-note-field textarea:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.followup-billing-field input {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
}

.followup-billing-field input:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.followup-note-meta,
.followup-billing-meta {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.followup-billing-preview {
    display: grid;
    gap: 12px;
    max-height: min(520px, calc(100vh - 260px));
    overflow: hidden;
}

.followup-billing-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.followup-billing-summary strong {
    color: var(--text-primary);
}

.followup-billing-unmapped {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(217, 119, 6, 0.3);
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.08);
    color: var(--text-primary);
    font-size: 12px;
}

.followup-billing-mapping-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 0.9fr);
    align-items: center;
    gap: 10px;
}

.followup-billing-mapping-row select {
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
}

.followup-billing-mapping-readonly {
    color: var(--text-secondary);
    font-size: 11px;
}

.followup-billing-preview-table-wrap {
    max-height: 280px;
    overflow: auto;
    overscroll-behavior: contain;
}

.followup-billing-preview-table {
    min-width: 640px;
}

.followup-billing-preview-table th,
.followup-billing-preview-table td {
    font-size: 11px;
    white-space: nowrap;
}

.followup-billing-preview-table th:last-child,
.followup-billing-preview-table td:last-child {
    text-align: right;
}

@media (max-width: 560px) {
    .followup-billing-mapping-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

.followup-item-code {
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    line-height: 1.35;
    white-space: nowrap;
}

.followup-item-reference {
    line-height: 1.35;
}

.followup-item-name,
.followup-item-meta {
    display: block;
}

.followup-item-name {
    color: var(--text-primary);
    font-weight: 700;
}

.followup-item-meta {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 11px;
}

.followup-description {
    min-width: 260px;
    max-width: 360px;
    white-space: normal;
    line-height: 1.35;
}

.followup-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.followup-status.open {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.followup-status.waiting-payment {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.followup-status.waiting-admin-update {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.followup-status.closed {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.followup-status-select {
    min-height: 30px;
    min-width: 94px;
    padding: 4px 24px 4px 9px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
}

.followup-status-select.open {
    border-color: rgba(37, 99, 235, 0.18);
    background-color: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.followup-status-select.closed {
    border-color: rgba(22, 163, 74, 0.2);
    background-color: rgba(22, 163, 74, 0.1);
    color: #15803d;
}

.followup-verified-cell {
    line-height: 1.35;
}

.followup-verified-user,
.followup-verified-time {
    display: block;
}

.followup-verified-user {
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
}

.followup-verified-time {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 10px;
    white-space: nowrap;
}

.followup-view-detail-btn,
.followup-detail-table .btn-icon {
    display: inline-flex;
    align-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
}

@media (max-width: 900px) {
    .followup-header,
    .followup-action-bar,
    .followup-list-meta,
    .followup-management-toolbar,
    .followup-management-detail-header {
        align-items: stretch;
        flex-direction: column;
    }

    .followup-detail-header {
        display: flex;
        align-items: stretch;
        flex-direction: column;
    }

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

    .followup-management-kpis,
    .followup-management-grid,
    .followup-management-insights {
        grid-template-columns: 1fr;
    }

    .followup-filters,
    .followup-filters select,
    .followup-filters .btn {
        width: 100%;
    }

    .followup-panel-filter-bar .search-box {
        flex: 0 0 auto;
        min-height: 42px;
    }
}

@media (max-width: 520px) {
    .followup-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .followup-chart-box,
    .followup-chart-box-wide {
        height: 260px;
        min-height: 260px;
    }

    .followup-pagination {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .followup-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        overflow: visible;
    }

    .followup-tab {
        min-width: 0;
        padding-inline: 8px;
        font-size: 12px;
    }

    .followup-tab-label-desktop {
        display: none;
    }

    .followup-tab-label-mobile {
        display: inline;
    }

    .followup-pagination-actions {
        justify-content: space-between;
        width: 100%;
    }

    .followup-list-widget .table-responsive {
        max-height: none;
        overflow: auto;
    }

    .followup-payment-widget .followup-payment-table,
    .followup-payment-widget .followup-payment-table tbody,
    .followup-payment-widget .followup-payment-table tr,
    .followup-payment-widget .followup-payment-table td {
        display: block;
        width: 100%;
    }

    .followup-payment-widget .followup-payment-table {
        min-width: 0;
    }

    .followup-payment-widget .followup-payment-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .followup-payment-widget .followup-payment-table tbody {
        display: grid;
        gap: 10px;
    }

    .followup-payment-widget .followup-payment-table tr {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 8px 12px;
        padding: 14px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-card);
    }

    .followup-payment-widget .followup-payment-table td {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        padding: 0;
        border: 0;
        text-align: left !important;
    }

    .followup-payment-widget .followup-payment-table td::before {
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .followup-payment-widget .followup-payment-table td:first-child {
        display: none;
    }

    .followup-payment-widget .followup-payment-table td:nth-child(3) {
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
    }

    .followup-payment-widget .followup-payment-table td:nth-child(6),
    .followup-payment-widget .followup-payment-table td:nth-child(7),
    .followup-payment-widget .followup-payment-table td:nth-child(9) {
        text-align: left !important;
    }

    .followup-payment-widget .followup-payment-table .followup-payment-manage-cell {
        justify-items: start;
    }

    .followup-payment-widget .followup-payment-table .followup-payment-manage-trigger,
    .followup-payment-widget .followup-payment-table .followup-billing-upload-btn,
    .followup-payment-widget .followup-payment-table .followup-payment-evidence-btn,
    .followup-payment-widget .followup-payment-table .followup-payment-edit-btn,
    .followup-payment-widget .followup-payment-table .followup-payment-save-btn,
    .followup-payment-widget .followup-payment-table .followup-payment-cancel-btn,
    .followup-payment-widget .followup-payment-table .followup-billing-upload-state,
    .followup-payment-widget .followup-payment-table .followup-payment-evidence-state,
    .followup-payment-widget .followup-payment-table .followup-payment-readonly-action {
        min-width: 40px;
        width: 40px;
        min-height: 40px;
        height: 40px;
    }

    .followup-payment-widget .btn-icon {
        min-width: 40px;
        width: 40px;
        min-height: 40px;
        height: 40px;
    }

    .followup-payment-widget .table-responsive,
    .followup-management-card > .table-responsive {
        background:
            linear-gradient(90deg, var(--bg-card) 30%, transparent),
            linear-gradient(270deg, var(--bg-card) 30%, transparent) 100% 0,
            linear-gradient(90deg, rgba(15, 23, 42, 0.12), transparent),
            linear-gradient(270deg, rgba(15, 23, 42, 0.12), transparent) 100% 0;
        background-attachment: local, local, scroll, scroll;
        background-repeat: no-repeat;
        background-size: 36px 100%, 36px 100%, 14px 100%, 14px 100%;
    }

    .followup-payment-table th:nth-child(3),
    .followup-payment-table td:nth-child(3),
    .followup-management-detail-table th:nth-child(3),
    .followup-management-detail-table td:nth-child(3) {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--bg-card);
        box-shadow: 1px 0 0 var(--border);
    }

    .followup-payment-widget .followup-payment-table td:nth-child(3) {
        position: static;
        left: auto;
        z-index: auto;
        background: transparent;
        box-shadow: none;
    }

    .followup-payment-table thead th:nth-child(3),
    .followup-management-detail-table thead th:nth-child(3) {
        z-index: 3;
        background: var(--bg-color);
    }

}
