:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b91c1c;
    --warning: #a16207;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Tahoma, Arial, sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.sidebar {
    width: 280px;
    flex: 0 0 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #111827;
    color: #fff;
    padding: 20px 14px;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #111827;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

.brand {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 18px;
    padding: 0 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark,
.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(20, 184, 166, .16);
    color: #5eead4;
    font-size: 16px;
    overflow: hidden;
}

.side-nav {
    display: grid;
    gap: 9px;
}

.nav-group {
    border-radius: 10px;
    overflow: hidden;
}

.nav-group summary {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-left: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform .18s ease, border-color .18s ease;
    justify-self: center;
}

.nav-group[open] summary::after {
    transform: rotate(-45deg);
    border-color: #ffffff;
}

.nav-group summary:hover {
    background: #1f2937;
    color: #fff;
}

.nav-group[open] summary {
    background: rgba(15, 118, 110, .18);
    color: #fff;
}

.nav-group-links {
    display: grid;
    gap: 3px;
    padding: 5px 12px 8px 0;
    border-right: 1px solid rgba(148, 163, 184, .24);
    margin-right: 22px;
}

.nav-link {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 38px;
    color: #d1d5db;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
}

.nav-dashboard {
    min-height: 44px;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, .04);
    font-weight: 700;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .06);
    color: #99f6e4;
    font-size: 13px;
    line-height: 1;
}

.nav-link:hover {
    background: #1f2937;
    color: #fff;
}

.nav-link.active {
    background: #0f766e;
    color: #fff;
    box-shadow: inset 3px 0 0 #5eead4;
}

.nav-link.active .nav-icon,
.nav-group[open] summary .nav-icon {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.main {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    margin: 0 0 18px;
    font-size: 24px;
}

.page-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.page-heading .page-title {
    margin: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 16px;
}

.panel-summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
}

.grid {
    display: grid;
    gap: 14px;
}

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

.report-filter-form {
    align-items: end;
}

.report-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.report-summary {
    margin-bottom: 16px;
}

.report-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.report-heading h2 {
    margin: 0;
    font-size: 18px;
}

.report-table {
    min-width: 1120px;
}

.report-table tfoot th {
    background: #f1f5f9;
    font-weight: 700;
}

.bank-accounts-table {
    min-width: 1320px;
}

.bank-accounts-table th:nth-child(1),
.bank-accounts-table td:nth-child(1) {
    width: 70px;
}

.bank-accounts-table th:nth-child(2),
.bank-accounts-table td:nth-child(2),
.bank-accounts-table th:nth-child(3),
.bank-accounts-table td:nth-child(3) {
    width: 220px;
}

.bank-accounts-table th:nth-child(9),
.bank-accounts-table td:nth-child(9),
.bank-accounts-table th:nth-child(10),
.bank-accounts-table td:nth-child(10) {
    width: 95px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.stat strong {
    display: block;
    font-size: 26px;
}

.dashboard-page {
    width: 100%;
    max-width: 1240px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

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

.panel-heading h2 {
    margin: 0;
    font-size: 18px;
}

.page-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-heading-row .page-title {
    margin-bottom: 0;
}

.selected-withdrawal-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 1100px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    padding: 9px 14px;
    cursor: pointer;
    font: inherit;
}

.button:hover,
button:hover {
    background: var(--primary-dark);
}

.button.ghost {
    background: #eef2f7;
    color: var(--text);
}

.button.danger,
button.danger {
    background: var(--danger);
}

.button.danger:hover,
button.danger:hover {
    background: #991b1b;
}

.button:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.small-button {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 34px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 10px;
    font: inherit;
    background: #fff;
}

input[type="date"],
input[data-revenue-date-picker="1"],
.flatpickr-input {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}

input[type="date"]::-webkit-datetime-edit {
    direction: ltr;
    unicode-bidi: isolate;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    direction: ltr;
}

.flatpickr-calendar {
    font-family: Tahoma, Arial, sans-serif;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
    overflow: hidden;
}

.flatpickr-calendar .flatpickr-current-month {
    direction: ltr;
}

.flatpickr-months {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.flatpickr-months .flatpickr-month {
    height: 44px;
    color: #0f172a;
}

.flatpickr-current-month {
    padding-top: 7px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.flatpickr-current-month input.cur-year {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-weight: 700;
    height: 30px;
}

.flatpickr-current-month input.cur-year {
    direction: ltr;
    text-align: center;
    width: 68px;
}

.flatpickr-current-month .numInputWrapper {
    width: 78px;
}

.flatpickr-current-month .cur-month {
    margin: 0;
    padding: 0 8px;
    line-height: 30px;
    min-width: 74px;
    text-align: center;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: var(--primary);
    fill: var(--primary);
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    color: var(--primary-dark);
}

.flatpickr-weekdays {
    background: #ffffff;
}

span.flatpickr-weekday {
    color: #475569;
    font-weight: 700;
}

.flatpickr-day {
    border-radius: 6px;
    color: #111827;
    font-weight: 500;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
    background: #ecfdf5;
    border-color: #99f6e4;
}

.flatpickr-day.today {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.revenue-date-picker-footer {
    display: flex;
    justify-content: center;
    padding: 8px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}

.revenue-date-picker-footer .revenue-date-clear {
    width: 100%;
    min-height: 34px;
}

input[readonly] {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

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

.manual-summary-form {
    margin-top: 16px;
}

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

.form-actions {
    display: flex;
    justify-content: flex-start;
}

.manual-transfer-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 31px;
}

.manual-transfer-check input {
    width: auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px 12px;
    align-items: stretch;
}

.checkbox-grid .inline-check {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
}

.checkbox-grid .inline-check:hover {
    border-color: rgba(15, 118, 110, 0.35);
    background: #f8fbfb;
}

.checkbox-grid .inline-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.inline-row-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 8px;
    align-items: center;
    min-width: 520px;
}

.inline-row-form input,
.inline-row-form select {
    height: 34px;
    padding: 6px 8px;
}

.inline-row-form .inline-check {
    margin: 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.alert {
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.alert.success {
    background: #ecfdf5;
    color: #065f46;
}

.alert.error {
    background: #fef2f2;
    color: var(--danger);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.filters-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-actions {
    display: flex;
    align-items: end;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 14px 0;
}

.dashboard-cards.compact-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 28px;
    color: var(--text);
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 14px;
}

.report-panel h2 {
    margin-top: 0;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: right;
    vertical-align: top;
}

th {
    background: #f9fafb;
}

.compact-table th,
.compact-table td {
    padding: 8px;
    vertical-align: middle;
}

.data-entry-table {
    table-layout: fixed;
}

.data-entry-table th,
.data-entry-table td {
    white-space: nowrap;
}

.table-input {
    height: 38px;
    padding: 7px 9px;
}

.center-cell {
    text-align: center;
}

.action-cell {
    width: 92px;
    text-align: center;
}

.action-cell button {
    min-width: 72px;
    padding: 8px 12px;
}

.nowrap {
    white-space: nowrap;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.transactions-table {
    min-width: 1280px;
    table-layout: fixed;
}

.plain-transactions-table {
    min-width: 1600px;
    table-layout: fixed;
}

.receipts-table {
    min-width: 1180px;
}

.settings-image-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    min-width: 180px;
    min-height: 90px;
    padding: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.settings-image-preview img {
    max-width: 220px;
    max-height: 120px;
    object-fit: contain;
}

.plain-transactions-table th,
.plain-transactions-table td {
    vertical-align: top;
}

.plain-transactions-table th:nth-child(1),
.plain-transactions-table td:nth-child(1) { width: 110px; }
.plain-transactions-table th:nth-child(2),
.plain-transactions-table td:nth-child(2) { width: 185px; }
.plain-transactions-table th:nth-child(3),
.plain-transactions-table td:nth-child(3),
.plain-transactions-table th:nth-child(4),
.plain-transactions-table td:nth-child(4),
.plain-transactions-table th:nth-child(5),
.plain-transactions-table td:nth-child(5) { width: 95px; }
.plain-transactions-table th:nth-child(6),
.plain-transactions-table td:nth-child(6) { width: 150px; }
.plain-transactions-table th:nth-child(7),
.plain-transactions-table td:nth-child(7) { width: 360px; }
.plain-transactions-table th:nth-child(14),
.plain-transactions-table td:nth-child(14) { width: 260px; }

.details-cell {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.number-cell {
    direction: ltr;
    text-align: right;
    white-space: nowrap;
}

.text-cell {
    white-space: normal;
    overflow-wrap: anywhere;
}

.grid-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}

.grid-search {
    max-width: 360px;
    min-width: 260px;
}

.revenue-ag-grid {
    height: calc(100vh - 230px);
    min-height: 520px;
    width: 100%;
    --ag-font-family: Tahoma, Arial, sans-serif;
    --ag-font-size: 14px;
    --ag-background-color: #ffffff;
    --ag-foreground-color: #111827;
    --ag-header-background-color: #eef6f5;
    --ag-header-foreground-color: #0f172a;
    --ag-header-height: 46px;
    --ag-row-height: 44px;
    --ag-border-color: #e5e7eb;
    --ag-row-border-color: #eef2f7;
    --ag-row-hover-color: #f0fdfa;
    --ag-selected-row-background-color: #ccfbf1;
    --ag-odd-row-background-color: #fbfcfd;
    --ag-wrapper-border-radius: 8px;
    --ag-input-border-color: #d1d5db;
    --ag-input-focus-border-color: var(--primary);
    --ag-checkbox-checked-color: var(--primary);
    --ag-range-selection-border-color: var(--primary);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.compact-revenue-grid {
    height: 430px;
    min-height: 360px;
}

.grid-fullscreen-active {
    overflow: hidden;
}

.grid-panel-fullscreen {
    position: fixed;
    inset: 8px;
    z-index: 3000;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
}

.grid-panel-fullscreen .grid-toolbar {
    flex: 0 0 auto;
}

.grid-panel-fullscreen .revenue-ag-grid {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

.revenue-ag-grid.ag-theme-quartz {
    --ag-control-panel-background-color: #ffffff;
    --ag-subheader-background-color: #f8fafc;
    --ag-secondary-foreground-color: #475569;
    --ag-range-selection-border-color: var(--primary);
}

.revenue-ag-grid .ag-root,
.revenue-ag-grid .ag-body-viewport,
.revenue-ag-grid .ag-center-cols-viewport {
    background: #ffffff;
}

.revenue-ag-grid .ag-header-cell-label {
    justify-content: flex-start;
    gap: 6px;
}

.revenue-ag-grid .ag-header-cell,
.revenue-ag-grid .ag-header-group-cell {
    border-left: 1px solid #dbe6e4;
    font-weight: 700;
    padding-inline: 12px;
}

.revenue-ag-grid .ag-header-cell-text {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
    letter-spacing: 0;
    line-height: 1.4;
    white-space: normal;
}

.revenue-ag-grid .ag-cell {
    line-height: 1.45;
    border-left: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    padding-inline: 12px;
    color: #111827;
    font-size: 14px;
}

.revenue-ag-grid .ag-row {
    border-bottom: 1px solid #eef2f7;
}

.revenue-ag-grid .ag-row-even {
    background: #ffffff;
}

.revenue-ag-grid .ag-row-odd {
    background: #fbfcfd;
}

.revenue-ag-grid .ag-row-hover {
    background: #f0fdfa !important;
}

.revenue-ag-grid .ag-row-selected {
    background: #dffcf7 !important;
}

.revenue-ag-grid .ag-floating-filter {
    background: #f8fafc;
    border-top: 1px solid #dbe6e4;
}

.revenue-ag-grid .ag-floating-filter-input,
.revenue-ag-grid .ag-input-field-input {
    min-height: 30px;
    border-radius: 6px;
    font-size: 13px;
}

.revenue-ag-grid .ag-floating-filter input:not([type="number"]),
.revenue-ag-grid .ag-filter input:not([type="number"]) {
    direction: rtl;
    unicode-bidi: plaintext;
}

.revenue-ag-grid .ag-header-icon,
.revenue-ag-grid .ag-sort-indicator-icon {
    color: #64748b;
}

.revenue-ag-grid .ag-pinned-right-header,
.revenue-ag-grid .ag-pinned-right-cols-container {
    border-left: 2px solid #dbe6e4;
}

.revenue-ag-grid .ag-pinned-left-header,
.revenue-ag-grid .ag-pinned-left-cols-container {
    border-right: 2px solid #dbe6e4;
}

.revenue-ag-grid .ag-number-cell {
    direction: ltr;
    justify-content: flex-end;
    font-family: Tahoma, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}

.revenue-ag-grid .ag-editable-cell {
    background: #f8fffe;
    cursor: pointer;
}

.revenue-ag-grid .ag-editable-cell::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-left: 1.5px solid #64748b;
    border-bottom: 1.5px solid #64748b;
    margin-inline-start: 8px;
    transform: rotate(-45deg);
    vertical-align: middle;
}

.ag-project-editor {
    width: 100%;
    height: 100%;
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 4px 8px;
    font: inherit;
    background: #ffffff;
}

.revenue-ag-grid .ag-long-text {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    align-items: flex-start;
    padding-top: 6px;
}

.revenue-ag-grid .ag-paging-panel {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    color: #334155;
    font-size: 13px;
    min-height: 46px;
}

.revenue-ag-grid .ag-root-wrapper {
    border: 0;
}

.ag-column-picker {
    position: relative;
}

.ag-column-picker summary {
    list-style: none;
    cursor: pointer;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 8px 36px 8px 12px;
    font-weight: 700;
    min-width: 118px;
    position: relative;
}

.ag-column-picker summary::before {
    content: "";
    position: absolute;
    right: 13px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: translateY(-65%) rotate(45deg);
}

.ag-column-picker summary::-webkit-details-marker {
    display: none;
}

.ag-column-picker-menu {
    position: absolute;
    z-index: 100;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
    padding: 12px;
}

.ag-column-picker-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #111827;
}

.ag-column-picker-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.ag-column-picker-list {
    max-height: 360px;
    overflow: auto;
    display: grid;
    gap: 4px;
    padding-left: 4px;
}

.ag-column-check {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border-radius: 6px;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
    color: #1f2937;
}

.ag-column-check:hover {
    background: #f8fafc;
}

.ag-column-check input {
    width: auto;
    margin: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.status-unclassified {
    background: #f1f5f9;
    color: #475569;
}

.status-auto_classified {
    background: #ecfdf5;
    color: #047857;
}

.status-needs_review {
    background: #fffbeb;
    color: #a16207;
}

.status-manually_classified {
    background: #eff6ff;
    color: #1d4ed8;
}

.ag-empty-message {
    color: #475569;
    font-weight: 700;
}

.swal-rtl-popup {
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    border-radius: 10px;
}

.swal-confirm-button {
    background: var(--primary) !important;
    border-radius: 8px !important;
}

.swal-cancel-button {
    background: #e5e7eb !important;
    color: #1f2937 !important;
    border-radius: 8px !important;
}

.ts-wrapper {
    width: 100%;
}

.ts-control {
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 7px 10px;
    font: inherit;
    direction: rtl;
}

.ts-control input {
    min-width: 110px;
}

.ts-dropdown {
    direction: rtl;
    text-align: right;
    font-family: Tahoma, Arial, sans-serif;
    border-radius: 8px;
    border-color: #d1d5db;
    z-index: 4500;
}

.ts-dropdown .option {
    padding: 8px 10px;
}

.ts-dropdown .active {
    background: #f0fdfa;
    color: #0f172a;
}

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

.dual-date-grid input {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}

.field-hint {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 720px) {
    .dual-date-grid {
        grid-template-columns: 1fr;
    }
}
.deployment-steps {
    margin: 0;
    padding: 0 22px 0 0;
    line-height: 2;
    color: var(--text);
}

.deployment-output {
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    overflow: auto;
    max-height: 320px;
}
/* Keep the sidebar scroll separate from the page content scroll. */
html,
body {
    height: 100%;
}

body:has(.app-shell) {
    overflow: hidden;
}

.app-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    position: relative;
    direction: ltr;
    scrollbar-gutter: stable;
}

.sidebar > * {
    direction: rtl;
}

.main {
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

@supports not selector(body:has(.app-shell)) {
    body {
        overflow: hidden;
    }

    body:has(.login-page) {
        overflow: auto;
    }
}
.deployment-wizard {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.deployment-main-step {
    position: sticky;
    top: 18px;
}

.deployment-main-step h2 {
    margin: 8px 0 8px;
    color: var(--text);
}

.deployment-main-step p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.8;
}

.deployment-mode-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 700;
    font-size: 13px;
}

.deployment-health-grid {
    display: grid;
    gap: 8px;
}

.deployment-health-grid div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
}

.deployment-health-grid span {
    color: var(--muted);
    font-size: 13px;
}

.deployment-health-grid strong {
    color: var(--text);
    font-size: 14px;
}

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

.deployment-step-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.deployment-step-card.current {
    border-color: #0f766e;
    box-shadow: 0 8px 22px rgba(15, 118, 110, .12);
}

.deployment-step-card.done {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.deployment-step-card.locked {
    opacity: .64;
    background: #f8fafc;
}

.deployment-step-number {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #334155;
    font-weight: 800;
}

.deployment-step-card.current .deployment-step-number {
    background: #0f766e;
    color: #fff;
}

.deployment-step-card.done .deployment-step-number {
    background: #14b8a6;
    color: #fff;
}

.deployment-step-content h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 18px;
}

.deployment-step-content p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.8;
}

.deployment-manual-note {
    display: inline-flex;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fffbeb;
    color: #92400e;
    font-weight: 700;
    font-size: 13px;
}

.deployment-focus-panel p {
    margin-top: 0;
    color: var(--muted);
}

.deployment-step-card button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

@media (max-width: 980px) {
    .deployment-wizard {
        grid-template-columns: 1fr;
    }

    .deployment-main-step {
        position: static;
    }
}
.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
}

.brand-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.35;
}
.deployment-status-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
    gap: 18px;
    align-items: center;
}

.deployment-status-strip h2 {
    margin: 10px 0 6px;
    font-size: 26px;
}

.deployment-status-strip p {
    margin: 0;
    color: var(--muted);
}

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

.deployment-wizard.single-column {
    display: block;
}

.deployment-inline-alert {
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-weight: 800;
    border: 1px solid transparent;
}

.deployment-inline-alert.success {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.deployment-inline-alert.error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.deployment-path-grid {
    display: grid;
    gap: 10px;
}

.deployment-path-grid div {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.deployment-path-grid span {
    color: var(--muted);
    font-size: 13px;
}

.deployment-path-grid strong {
    direction: ltr;
    text-align: left;
    font-size: 15px;
    overflow-wrap: anywhere;
    color: var(--text);
}

.compact-info-grid .stat-card strong {
    font-size: 20px;
}

.permission-editor summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary);
}

.permission-editor form {
    margin-top: 12px;
    display: grid;
    gap: 14px;
    min-width: 720px;
}

.permission-module {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.permission-module h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

@media (max-width: 980px) {
    .deployment-status-strip {
        grid-template-columns: 1fr;
    }

    .deployment-path-grid div {
        grid-template-columns: 1fr;
    }
}