@import url('assets/fonts/css/satoshi.css');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&display=swap');

:root {
    --sidebar-width: 260px;
    --primary-color: #3b82f6;
    --bg-dark: #1e293b;
    --bg-light: #f1f5f9;
    --text-muted: #94a3b8;
    --ok: #16a34a;
    --danger: #dc2626;
    --border: #e2e8f0;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    font-family: "Satoshi-Regular", "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: #334155;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-dark);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px 10px;
    font-size: 18px;
    font-family: "Satoshi-Bold", "Satoshi-Regular", sans-serif;
    font-weight: 700;
}

.sidebar-brand {
    padding: 0 20px 25px;
    font-size: 14px;
    color: var(--text-muted);
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-user {
    margin: 0 16px 18px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
}

.sidebar-user strong {
    font-size: 14px;
    margin-bottom: 4px;
    font-family: "Satoshi-Bold", "Satoshi-Regular", sans-serif;
}

.sidebar-user span {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: var(--transition);
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(1px);
}

.sidebar-nav a.active {
    background-color: var(--primary-color);
    color: #fff;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
}

.page-header {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.page-header-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.page-header-actions .filter-actions-btn {
    min-width: 0;
    padding: 10px 18px;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    font-size: 13px;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
}

.header-link:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

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

.treasury-directory-status-filter {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
}

.treasury-directory-status-filter a {
    padding: 8px 16px;
    font-size: 13px;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    border: none;
    background: transparent;
    transition: var(--transition);
}

.treasury-directory-status-filter a:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.treasury-directory-status-filter a.is-active {
    background: var(--primary-color);
    color: #fff;
}

.treasury-directory-status-filter a.is-active:hover {
    background: #2563eb;
    color: #fff;
}

.page-header-actions .header-link {
    width: auto !important;
    background: #fff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    padding: 8px 10px !important;
}

.title {
    font-size: 28px;
    font-family: "Satoshi-Bold", "Satoshi-Regular", sans-serif;
    font-weight: 700;
    color: #1e293b;
}

.muted {
    color: #64748b;
    font-size: 13px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kpi-title {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
}

.kpi-value {
    font-size: 28px;
    font-family: "Satoshi-Bold", "Satoshi-Regular", sans-serif;
    font-weight: 700 !important;
    color: #0f172a;
}

.kpi-card {
    border-left: 5px solid #3b82f6;
}

.kpi-card.green {
    border-left-color: #10b981;
}

.kpi-card.orange {
    border-left-color: #f59e0b;
}

.kpi-card.purple {
    border-left-color: #8b5cf6;
}

.section-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    color: #64748b;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
}

form.inline {
    display: grid;
    gap: 10px;
}

/* Hisobotlar: sana + tezkor tugmalar bir qatorda, ixcham ko‘rinish */
form#report-date-form.inline {
    display: block;
}

.report-date-toolbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 8px 10px;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 2px;
}

.report-date-toolbar .report-date-range-fields {
    display: flex;
    align-items: flex-end;
    flex: 0 0 auto;
    gap: 6px 10px;
}

.report-date-toolbar .report-date-range-sep {
    padding-bottom: 10px;
    color: #64748b;
    font-size: 14px;
    user-select: none;
}

.report-date-toolbar .report-date-field {
    flex: 0 0 auto;
    max-width: 260px;
}

.report-date-toolbar .report-date-field input[type="date"] {
    width: auto;
    min-width: 11.5rem;
    max-width: 100%;
}

.report-date-toolbar .report-date-submit {
    flex: 0 0 auto;
    align-self: flex-end;
}

.report-date-toolbar .report-date-submit button[type="submit"] {
    width: auto;
    white-space: nowrap;
}

.report-date-toolbar button.report-preset {
    flex: 0 0 auto;
    width: auto;
    min-width: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    font-size: 14px;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    line-height: 1.2;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: none;
}

.report-date-toolbar button.report-preset:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* Hisobotlar: kirim/chiqim — .row grid emas, tugmalar kontent bo‘yicha */
.report-popup-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.report-popup-actions button {
    width: auto;
    min-width: unset;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #64748b;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
}

input,
select,
textarea,
button {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 14px;
    font-family: inherit;
    color: #334155;
    background-color: #ffffff;
}

select {
    cursor: pointer;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

button {
    cursor: pointer;
    border: none;
    background-color: #3b82f6;
    color: #fff;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    padding: 9px 16px;
    transition: background-color 0.2s ease;
    box-shadow: none;
}

button:hover {
    background-color: #2563eb;
}

.filter-actions-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

button.btn-success {
    background-color: #16a34a;
}

button.btn-success:hover {
    background-color: #15803d;
}

a.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    padding: 9px 16px;
    box-sizing: border-box;
    background-color: #16a34a;
    color: #fff;
    transition: background-color 0.2s ease;
}

a.btn-success:hover {
    background-color: #15803d;
}

button.btn-neutral,
a.btn-neutral {
    background-color: #475569;
    color: #fff;
}

button.btn-neutral:hover,
a.btn-neutral:hover {
    background-color: #334155;
}

a.btn-neutral {
    text-decoration: none;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    padding: 9px 16px;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

button.btn-warning {
    background-color: #d97706;
}

button.btn-warning:hover {
    background-color: #b45309;
}

button.btn-danger {
    background-color: #dc2626;
}

button.btn-danger:hover {
    background-color: #b91c1c;
}

.treasury-file-upload {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.treasury-file-upload-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

label.treasury-file-upload-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: auto;
    max-width: 100%;
    margin: 0;
    padding: 9px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    color: #fff;
    background-color: #475569;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

label.treasury-file-upload-trigger:hover {
    background-color: #334155;
}

.treasury-file-upload:focus-within label.treasury-file-upload-trigger {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.treasury-file-upload-filename {
    flex: 1 1 160px;
    min-width: 0;
    font-size: 13px;
    word-break: break-word;
}

.icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1;
    border: none;
    background-color: transparent !important;
    box-shadow: none;
    color: #3b82f6;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.icon-btn i {
    pointer-events: none;
    color: currentColor;
}

.icon-btn:hover {
    background-color: transparent !important;
    color: #2563eb;
    opacity: 0.92;
}

.icon-btn.danger {
    color: #dc2626;
}

.icon-btn.danger:hover {
    color: #b91c1c;
}

.icon-btn.edit {
    color: #d97706;
}

.icon-btn.edit:hover {
    color: #b45309;
}

.icon-btn.qr {
    color: #7c3aed;
}

.icon-btn.qr:hover {
    color: #5b21b6;
}

.icon-btn.toggle {
    color: #64748b;
}

.icon-btn.toggle:hover {
    color: #334155;
}

.icon-btn.toggle.toggle-on {
    color: #16a34a;
}

.icon-btn.toggle.toggle-on:hover {
    color: #15803d;
}

.icon-btn.toggle.toggle-off {
    color: #ca8a04;
}

.icon-btn.toggle.toggle-off:hover {
    color: #a16207;
}

.row-actions-menu {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.row-actions-trigger.icon-btn {
    color: #64748b;
}

.row-actions-trigger.icon-btn:hover {
    color: #0f172a;
}

.row-actions-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 220px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    z-index: 60;
}

.row-actions-dropdown form {
    margin: 0;
}

.row-actions-dropdown .row-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 0;
    background-color: transparent !important;
    color: #334155;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1.3;
    box-shadow: none;
}

.row-actions-dropdown button.row-action-item:hover,
.row-actions-dropdown a.row-action-item:hover {
    background: #f1f5f9 !important;
}

.row-actions-dropdown .row-action-item i {
    width: 20px;
    text-align: center;
    color: currentColor;
    flex-shrink: 0;
}

.row-actions-dropdown .row-action-item--danger {
    color: #b91c1c;
}

.row-actions-dropdown .row-action-item--danger:hover {
    background: #fef2f2 !important;
}

.saved-reports-table {
    width: 100%;
    border-collapse: collapse;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hidden {
    display: none !important;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
    line-height: 1.35;
    white-space: nowrap;
}

/* Fallback for any dynamic chip that doesn't have a specific color */
.badge[class*="chip-"] {
    background: #f8fafc;
    color: #64748b;
}

/* Specific overrides for known types */
.chip-guide {
    background: #dbeafe;
    color: #1e40af;
}
.chip-photographer {
    background: #fce7f3;
    color: #9d174d;
}
.chip-seller, .chip-sotuvchi {
    background: #dcfce7;
    color: #166534;
}

/* Oxirgi amaliyotlar: yo'nalish / manba / holat chip */
.txn-chip {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.35;
}

/* Department chips with distinct colors */
.department-chip--viewer {
    background: #e0e7ff;
    color: #3730a3;
}
.department-chip--treasurer {
    background: #dcfce7;
    color: #166534;
}
.department-chip--head {
    background: #dbeafe;
    color: #1e40af;
}
.department-chip--accountant {
    background: #fce7f3;
    color: #9d174d;
}
.department-chip--economist {
    background: #fef3c7;
    color: #b45309;
}

.department-chip {
    display: inline-block;
    margin: 0 6px 6px 0;
    vertical-align: middle;
}

.txn-chip--income {
    background: #dcfce7;
    color: #166534;
}

.txn-chip--expense {
    background: #fee2e2;
    color: #991b1b;
}

.txn-chip--unknown {
    background: #f1f5f9;
    color: #475569;
}

.txn-chip--manba-donation_box {
    background: #e0f2fe;
    color: #0369a1;
}

.txn-chip[class*="--manba-partner_"] {
    background: #f8fafc;
    color: #64748b;
}

.txn-chip--manba-partner_guide {
    background: #dbeafe;
    color: #1e40af;
}

.txn-chip--manba-partner_photographer {
    background: #fce7f3;
    color: #9d174d;
}

.txn-chip--manba-partner_seller,
.txn-chip--manba-partner_sotuvchi {
    background: #dcfce7;
    color: #166534;
}

.txn-chip--manba-partner_unknown {
    background: #f1f5f9;
    color: #475569;
}

.txn-chip--manba-bank_deposit {
    background: #fef3c7;
    color: #b45309;
}

.txn-chip--manba-emergency_expense {
    background: #ffedd5;
    color: #c2410c;
}

.txn-chip--manba-other {
    background: #f1f5f9;
    color: #334155;
}

/* Oxirgi amaliyotlar: ob'ekt (quti / gid / fotograf) */
.txn-chip--obekt-box {
    background: #cffafe;
    color: #0e7490;
}

.txn-chip--obekt-guide,
.txn-chip--obekt-gid {
    background: #eff6ff;
    color: #1e40af;
}

.txn-chip--obekt-photo,
.txn-chip--obekt-photographer,
.txn-chip--obekt-photograf {
    background: #fdf2f7;
    color: #9d174d;
}

.txn-chip--obekt-seller,
.txn-chip--obekt-sotuvchi {
    background: #f0fdf4;
    color: #166534;
}

.txn-chip--obekt-person_unknown {
    background: #f1f5f9;
    color: #475569;
}

.txn-chip--obekt-bank_note {
    background: #fef9c3;
    color: #a16207;
}

.txn-chip--obekt-emergency_note {
    background: #ffedd5;
    color: #c2410c;
}

.txn-chip--obekt-neutral {
    background: #f1f5f9;
    color: #64748b;
}

.txn-chip--obekt-box,
.txn-chip--obekt-guide,
.txn-chip--obekt-gid,
.txn-chip--obekt-photo,
.txn-chip--obekt-photographer,
.txn-chip--obekt-photograf,
.txn-chip--obekt-person_unknown,
.txn-chip--obekt-bank_note,
.txn-chip--obekt-emergency_note,
.txn-chip--obekt-neutral {
    white-space: normal;
    word-break: break-word;
    text-align: left;
    max-width: 100%;
}

.txn-chip--status-confirmed {
    background: #dcfce7;
    color: #166534;
}

.txn-chip--status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.txn-chip--status-frozen {
    background: #ecfeff;
    color: #0891b2;
    border: 1px solid #cffafe;
}

.txn-chip--status-unknown {
    background: #e2e8f0;
    color: #475569;
}

/* Boshqaruv: xodim lavozimi «Administrator» — oxirgi amaliyotlar chipi bilan bir xil asos */
.txn-chip.txn-chip--staff-dept-full {
    background: #e0e7ff;
    color: #3730a3;
}

.chip-guide {
    background: #dbeafe;
    color: #1e40af;
}

.chip-photo {
    background: #ede9fe;
    color: #5b21b6;
}

/* To'lov turi (xodimlar ro'yxatidagi badge bilan bir xil asos) */
.chip-pay-cash {
    background: #dcfce7;
    color: #166534;
}

.chip-pay-card {
    background: #dbeafe;
    color: #1e40af;
}

.chip-pay-bank_transfer {
    background: #ede9fe;
    color: #5b21b6;
}

.chip-pay-default {
    background: #f1f5f9;
    color: #475569;
}

.table-avatar {
    width: 44px;
    height: 58px;
    object-fit: cover;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #e2e8f0;
}

.partner-role-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 12px;
}

.partner-role-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #334155;
}

.partner-role-option:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.partner-role-option input {
    margin: 0;
    width: auto;
}

.partner-role-option:has(input:checked) {
    border-color: #3b82f6;
    background: #dbeafe;
    color: #1e40af;
}

.employee-row {
    cursor: default;
}

.txn-row {
    cursor: default;
}

/* Chek DOM chop etish uchun; ekranda ko'rinmaydi */
.treasury-receipt-host {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 320px;
    z-index: -1;
    pointer-events: none;
    overflow: visible;
}

.treasury-receipt-host .treasury-receipt {
    margin: 0;
    box-shadow: none;
}

.txn-detail-modal-card {
    width: min(100%, 520px);
    max-height: min(90vh, 720px);
    overflow-y: auto;
    font-family: "Satoshi-Regular", "Inter", "Segoe UI", sans-serif;
}

.txn-detail-modal-card h3 {
    font-family: "Satoshi-Bold", "Satoshi-Regular", sans-serif;
    font-weight: 700;
    color: #1e293b;
}

.txn-detail-table-wrap {
    width: 100%;
    margin: 0 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.txn-detail-table-wrap .txn-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.txn-detail-table th {
    text-align: left;
    font-weight: 500;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    color: #64748b;
    padding: 10px 12px;
    width: 38%;
    max-width: 42%;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.txn-detail-table td {
    text-align: left;
    font-weight: 400;
    font-family: "Satoshi-Regular", "Inter", sans-serif;
    color: #0f172a;
    padding: 10px 12px;
    vertical-align: top;
    word-break: break-word;
    border-bottom: 1px solid var(--border);
}

.txn-detail-table tr:last-child th,
.txn-detail-table tr:last-child td {
    border-bottom: none;
}

.txn-detail-receipt-preview img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
}

.txn-detail-receipt-preview-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
}

.txn-detail-receipt-preview-link:hover {
    text-decoration: underline;
}

.txn-detail-receipt-preview-path {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
}

.txn-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

tr.employee-row td:last-child {
    cursor: default;
}

.camera-modal--id-card {
    padding: 24px 16px;
    overflow: auto;
    align-items: flex-start;
    justify-content: center;
}

.employee-id-card-png-modal-card {
    position: relative;
    width: min(100%, 560px);
    /* Skroll faqat preview ichida; kartada overflow bo‘lmasa yopish tugmasi kesilmaydi */
    overflow: visible;
}

.employee-id-card-png-preview-wrap {
    max-height: min(70vh, 620px);
    overflow: auto;
    text-align: center;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 8px;
}

.employee-id-card-png-img {
    max-width: 100%;
    height: auto;
    vertical-align: top;
}

.employee-id-card-modal {
    position: relative;
    width: 1063px;
    max-width: none;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    flex-shrink: 0;
}

.employee-id-card-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.employee-id-card-modal__close:hover {
    background: #f8fafc;
    color: #0f172a;
}

.employee-id-card {
    --id-card-w: 1063px;
    --id-card-h: 709px;
    /* Barcha matn qatorlari: bir xil qator balandligi va bloklar orasidagi vertikal bo‘shliq */
    --id-card-text-line-height: 1.45;
    --id-card-text-line-gap: 10px;
    --id-card-blue: #1d4e89;
    --id-card-gold: #b8925a;
    /* Rasm va QR ramkasi: 3×4 (en × balandlik, masalan 210×280) */
    --id-card-frame-w: 210px;
    --id-card-frame-h: 280px;
    --id-card-frame-border-w: 4px;
    --id-card-frame-border: var(--id-card-frame-border-w) solid var(--id-card-blue);
    --id-card-qr-max: 176px;
    --id-card-qr-lift: -22px;
    --id-card-photo-inner-nudge: 2px;
    width: var(--id-card-w);
    height: var(--id-card-h);
    box-sizing: border-box;
    border-radius: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #1a1a1a;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    display: flex;
    flex-direction: column;
    text-align: left;
    font-family: "Montserrat", system-ui, sans-serif;
    font-weight: 700;
}

.employee-id-card__head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    height: 190px;
    box-sizing: border-box;
    padding: 10px 28px;
    background: var(--id-card-blue);
    color: #ffffff;
    font-family: "Montserrat", system-ui, sans-serif;
    font-weight: 800;
    text-align: center;
}

.employee-id-card__rule {
    flex-shrink: 0;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #8f6f3d 0%, #c9a66a 35%, #d4b07a 50%, #c9a66a 65%, #8f6f3d 100%);
}

.employee-id-card__rule--after-head {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.employee-id-card__rule--before-foot {
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

.employee-id-card__head-title {
    display: block;
    font-size: 34px;
    font-weight: 800;
    line-height: var(--id-card-text-line-height);
    letter-spacing: 0.035em;
    text-transform: uppercase;
    font-family: "Montserrat", system-ui, sans-serif;
}

.employee-id-card__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #ffffff;
}

.employee-id-card__main {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--id-card-frame-w) var(--id-card-frame-w) minmax(236px, 1fr);
    gap: 32px 40px;
    padding: 28px 40px 28px;
    align-items: center;
}

.employee-id-card__foot {
    flex-shrink: 0;
    height: 60px;
    background: var(--id-card-blue);
}

.employee-id-card__photo-wrap {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    position: relative;
}

.employee-id-card__photo-frame {
    width: var(--id-card-frame-w);
    height: var(--id-card-frame-h);
    box-sizing: border-box;
    border: var(--id-card-frame-border);
    background: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.employee-id-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% calc(50% + var(--id-card-photo-inner-nudge));
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: block;
}

.employee-id-card__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transform: translateY(var(--id-card-photo-inner-nudge));
    background: #e2e8f0;
    color: #475569;
    font-size: 4.875rem;
    font-weight: 800;
    font-family: "Montserrat", system-ui, sans-serif;
    letter-spacing: 0.04em;
}

.employee-id-card__qr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.employee-id-card__qr-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: var(--id-card-frame-w);
    height: var(--id-card-frame-h);
    box-sizing: border-box;
    padding: 2px 10px 8px;
    background: #ffffff;
    border: var(--id-card-frame-border);
}

.employee-id-card__qr-mount {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin-top: var(--id-card-qr-lift);
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.employee-id-card__qr-mount img,
.employee-id-card__qr-mount canvas {
    display: block;
    max-width: min(100%, var(--id-card-qr-max));
    max-height: min(100%, var(--id-card-qr-max));
    width: auto !important;
    height: auto !important;
}

.employee-id-card__qr-id {
    margin: var(--id-card-qr-lift) 0 0;
    flex: 0 0 auto;
    width: 100%;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #000000;
    font-family: "Montserrat", system-ui, sans-serif;
}

.employee-id-card__qr-mount .muted {
    font-family: "Montserrat", system-ui, sans-serif;
    font-weight: 700;
    font-size: 14px;
}

.employee-id-card__details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    gap: var(--id-card-text-line-gap);
    align-self: center;
    justify-content: center;
}

.employee-id-card__name {
    margin: 0;
    font-size: 33px;
    font-weight: 800;
    color: #000000;
    line-height: var(--id-card-text-line-height);
    font-family: "Montserrat", system-ui, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.employee-id-card__role {
    margin: 0;
    align-self: stretch;
    font-size: 19px;
    font-weight: 800;
    line-height: var(--id-card-text-line-height);
    letter-spacing: 0.06em;
    color: #000000;
    font-family: "Montserrat", system-ui, sans-serif;
    text-transform: uppercase;
}

/* «SHARTNOMA ASOSIDAGI FOTOGRAF» — biroz kattaroq shrift; matn alpha ~0.8 */
.employee-id-card__role--photographer {
    font-size: 20.5px;
    line-height: var(--id-card-text-line-height);
    letter-spacing: 0.055em;
    color: rgba(0, 0, 0, 0.8);
}

.status {
    margin-top: 8px;
    font-size: 13px;
}

.status.ok {
    color: var(--ok);
}

.status.error {
    color: var(--danger);
}

.camera-box {
    width: min(100%, 205px);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
}

.employee-form-layout {
    display: grid;
    grid-template-columns: minmax(220px, 240px) minmax(360px, 1fr);
    gap: 12px;
    align-items: start;
}

.employee-form-layout > div {
    min-width: 0;
}

.employee-form-layout input,
.employee-form-layout select {
    width: 100%;
}

.camera-box video,
.camera-box img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.camera-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2500;
}

.camera-modal-card {
    width: min(100%, 420px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

/* PNG modal: yopish (×) tugmasi va sarlavha bir-biriga chiqib qolmasin */
.camera-modal-card.employee-id-card-png-modal-card {
    padding: 48px 16px 16px 16px;
}

.operation-form-modal-card {
    width: min(100%, 720px);
    max-height: min(92vh, 900px);
    overflow-y: auto;
}

.treasury-partner-filter {
    margin-bottom: 10px;
}

.treasury-partner-filter label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-weight: 500;
}

.treasury-partner-filter input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: "Satoshi-Regular", "Inter", sans-serif;
}

.treasury-partner-filter input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.login-layout {
    min-height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 40%),
        #f1f5f9;
    padding: 16px;
}

.login-wrap {
    width: min(430px, 100%);
}

.login-password-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-password-field {
    position: relative;
    display: block;
    width: 100%;
}

.login-password-field input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 44px;
}

.login-password-toggle {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.login-password-toggle:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}

.login-password-toggle:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.login-password-toggle i {
    font-size: 15px;
    pointer-events: none;
}

/* Tizim jurnali (terminal) */
.treasury-log-page .card + .card {
    margin-top: 16px;
}

.treasury-reset-page .card + .card {
    margin-top: 16px;
}

.treasury-log-page .treasury-log-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.treasury-log-filters-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.treasury-log-filter-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 0 0 auto;
}

.treasury-log-filter-item--search input {
    min-width: 260px;
}

.treasury-log-filters-row label {
    font-size: 12px;
    color: #64748b;
    display: block;
    margin-bottom: 0;
}

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

.treasury-log-terminal-wrap {
    padding: 0;
    overflow: hidden;
}

.treasury-log-terminal-hint {
    padding: 10px 14px;
    border-bottom: 1px solid #1e293b;
    background: #0b0f14;
    font-size: 12px;
}

.treasury-reset-phrase {
    margin: 0 0 8px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.treasury-terminal {
    margin: 0;
    padding: 14px 16px;
    min-height: 360px;
    max-height: min(70vh, 680px);
    overflow: auto;
    background: #0b0f14;
    color: #86efac;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.treasury-toast-host {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.treasury-toast {
    min-width: 220px;
    max-width: min(90vw, 420px);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #0f172a;
    color: #f8fafc;
    font-family: "Satoshi-Medium", "Satoshi-Regular", sans-serif;
    font-size: 13px;
    line-height: 1.35;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.treasury-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.treasury-toast--success {
    background: #14532d;
    border-color: #166534;
    color: #dcfce7;
}

.treasury-toast--error {
    background: #7f1d1d;
    border-color: #b91c1c;
    color: #fee2e2;
}

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

    .section-grid {
        grid-template-columns: 1fr;
    }

    .row {
        grid-template-columns: 1fr;
    }

    .employee-form-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header,
    .sidebar-brand,
    .sidebar-user,
    .sidebar-nav span,
    .nav-divider {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        padding: 14px;
    }
}

/* Boshqaruv: xodim qatori — profil modali */
.staff-row-profile {
    cursor: pointer;
    transition: background 0.15s ease;
}

.staff-row-profile:hover {
    background: rgba(59, 130, 246, 0.07);
}

.staff-row-profile-name {
    color: var(--primary-color);
    font-weight: 600;
}

.staff-row-actions {
    cursor: default;
}

.staff-profile-modal-body {
    font-size: 14px;
    line-height: 1.55;
}

.staff-profile-hero {
    text-align: center;
    margin-bottom: 2px;
}

.staff-profile-hero .staff-profile-photo-wrap {
    margin-bottom: 12px;
}

.staff-profile-hero-text {
    padding: 0 4px;
}

.staff-profile-hero-name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.staff-profile-hero-role {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.staff-profile-photo-wrap {
    text-align: center;
    margin-bottom: 14px;
}

.staff-profile-photo {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    border: 1px solid var(--border);
    object-fit: cover;
}

.staff-profile-section-title {
    margin: 18px 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.staff-profile-modal-body > .staff-profile-section-title:first-child,
.staff-profile-hero + .staff-profile-section-title {
    margin-top: 0;
}

.staff-profile-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg, #fff);
}

.staff-profile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.staff-profile-table tbody tr:not(:last-child) th,
.staff-profile-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--border);
}

.staff-profile-table-subhead-row th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.045);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.staff-profile-table th[scope="row"] {
    width: 38%;
    max-width: 200px;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
}

.staff-profile-table td {
    padding: 10px 12px;
    vertical-align: top;
    word-break: break-word;
}

.staff-profile-td-num {
    width: 2.25rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
    font-weight: 500;
}

.staff-profile-permissions-card {
    margin-top: 18px;
    padding: 14px 16px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.staff-profile-card-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #0f172a);
}

.staff-profile-permissions-list {
    margin: 0;
    padding-left: 1.35em;
    font-size: 14px;
    line-height: 1.55;
}

.staff-profile-permissions-list li {
    margin: 0.25em 0;
}

.staff-profile-updated {
    margin: 14px 0 0;
    font-size: 12px;
}

.staff-profile-note {
    margin-top: 12px;
    font-size: 13px;
}
