/* ═══════════════════════════════════════════════════════════
   Uzam Traders – Salaries & Bulk Payments System Stylesheet
   Same design language as UT_Accounts
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #0f1117;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-header: #0d1020;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --text-primary: #e8ecff;
    --text-secondary: #a0aac8;
    --text-muted: #94abb3;
    --green: #00e896;
    --green-dim: rgba(0, 232, 150, 0.12);
    --red: #ff4d6d;
    --red-dim: rgba(255, 77, 109, 0.12);
    --blue: #4d9fff;
    --blue-dim: rgba(77, 159, 255, 0.12);
    --purple: #a855f7;
    --purple-dim: rgba(168, 85, 247, 0.12);
    --amber: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.12);
    --yellow: #facc15;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ─── HEADER ─── */
.app-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4d9fff, #7c3aed);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.brand-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-sub {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}

.header-meta {
    text-align: right;
}

.header-company {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.header-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── MAIN ─── */
.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* ─── HERO SEARCH ─── */
.search-hero {
    padding: 48px 0 36px;
}

.search-hero-inner {
    text-align: center;
    max-width: 780px;
    margin: 0 auto;
}

.search-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* Search Box */
.search-box-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.search-box-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.search-by-wrap {
    flex-shrink: 0;
}

.search-by-select {
    height: 48px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    min-width: 150px;
}

.search-by-select option {
    background: #1a1e2e;
    color: var(--text-primary);
}

.search-by-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-dim);
}

.search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 42px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-dim);
    background: rgba(255, 255, 255, 0.09);
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.search-clear-btn:hover {
    color: var(--red);
}

.search-btn {
    height: 48px;
    padding: 0 24px;
    background: linear-gradient(135deg, var(--blue), #7c3aed);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 16px rgba(77, 159, 255, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(77, 159, 255, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* Quick tags */
.search-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.search-tag-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-tag {
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.search-tag:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.search-tag.active {
    background: var(--blue-dim);
    border-color: var(--blue);
    color: var(--blue);
}

/* ─── RESULTS SECTION ─── */
.results-section {
    padding-bottom: 40px;
}

/* Stats Bar */
.results-stats {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    font-size: 18px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 12px;
}

/* Empty state */
.empty-state,
.no-results-state {
    text-align: center;
    padding: 80px 24px;
}

.empty-icon {
    font-size: 64px;
    color: var(--blue);
    opacity: 0.4;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-sub {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

/* ─── RESULT CARDS ─── */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.record-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    align-items: stretch;
}

.record-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.record-card-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px;
    min-width: 58px;
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.record-date-month {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--blue);
    letter-spacing: 0.5px;
}

.record-date-day {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.record-date-year {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.record-card-body {
    flex: 1;
    padding: 14px 16px;
    min-width: 0;
}

.record-card-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.record-beneficiary {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    /* Allow wrapping — do NOT truncate the name */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.record-amount {
    font-size: 16px;
    font-weight: 800;
    color: var(--amber);
    white-space: nowrap;
    flex-shrink: 0;
}

.record-amount .currency {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.7;
    margin-right: 3px;
}

.record-card-mid {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.record-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.record-badge-type-out {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(255, 77, 109, 0.2);
}

.record-badge-type-in {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(0, 232, 150, 0.2);
}

/* Transferred badge — teal-green, distinct from deposit green */
.record-badge-type-transferred {
    background: rgba(0, 201, 167, 0.13);
    color: #00c9a7;
    border: 1px solid rgba(0, 201, 167, 0.35);
}

.record-reference {
    font-size: 11px;
    color: var(--blue);
    font-family: monospace;
    opacity: 0.85;
}

/* File Title chip — shown in place of old BULK/batch-id labels */
.record-file-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    background: var(--purple-dim);
    color: var(--purple);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.record-card-bot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.record-bank-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.record-bank-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
}

.record-bank-name {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.record-account {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.record-acctitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Actions */
.record-card-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: var(--transition);
}

.action-btn-view {
    color: var(--blue);
    border-color: rgba(77, 159, 255, 0.3);
    background: var(--blue-dim);
}

.action-btn-view:hover {
    background: rgba(77, 159, 255, 0.25);
    transform: scale(1.08);
}

.action-btn-download {
    color: var(--green);
    border-color: rgba(0, 232, 150, 0.3);
    background: var(--green-dim);
}

.action-btn-download:hover {
    background: rgba(0, 232, 150, 0.25);
    transform: scale(1.08);
}

/* ─── PAGINATION ─── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--blue);
    color: var(--blue);
}

.page-btn.active {
    background: var(--blue-dim);
    border-color: var(--blue);
    color: var(--blue);
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-info {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 8px;
}

/* ─── MODAL ─── */
/* modal-glass is applied DIRECTLY on .modal-content, so target it directly */
.modal-content.modal-glass,
.modal-glass {
    background: #141826 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 16px !important;
    color: var(--text-primary) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75) !important;
}

/* Force dark on every inner section so Bootstrap white doesn't bleed through */
.modal-content.modal-glass .modal-header,
.modal-glass .modal-header {
    background: rgba(26, 32, 56, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border-radius: 16px 16px 0 0 !important;
}

.modal-content.modal-glass .modal-body,
.modal-glass .modal-body {
    background: #141826 !important;
    color: var(--text-primary) !important;
}

.modal-content.modal-glass .modal-footer,
.modal-glass .modal-footer {
    background: rgba(26, 32, 56, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border-radius: 0 0 16px 16px !important;
}

/* Ensure all text inside modal is light */
.modal-glass *,
.modal-content.modal-glass * {
    color: inherit;
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary) !important;
}

/* View modal content rows */
.tx-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    gap: 10px;
}

.tx-detail-row:last-child {
    border-bottom: none;
}

.tx-detail-label {
    font-size: 11px;
    color: #8a96b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    flex-shrink: 0;
    min-width: 120px;
}

.tx-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #e8ecff;
    text-align: right;
    word-break: break-word;
    flex: 1;
}

.type-badge-out {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 50px;
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(255, 77, 109, 0.3);
    font-weight: 700;
}

.type-badge-in {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 50px;
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(0, 232, 150, 0.3);
    font-weight: 700;
}

/* Transferred — teal modal badge */
.type-badge-transferred {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    background: rgba(0, 201, 167, 0.13);
    color: #00c9a7;
    border: 2px solid rgba(0, 201, 167, 0.45);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    box-shadow: 0 0 18px rgba(0, 201, 167, 0.12);
}

.amount-big {
    font-size: 22px;
    font-weight: 800;
    color: var(--amber);
}

.amount-big .currency-big {
    font-size: 14px;
    margin-right: 4px;
}

/* ─── RECEIPT TEMPLATE (print/img) ─── */
#receipt-template {
    font-family: 'Inter', Arial, sans-serif;
    color: #1a1a1a;
    background: #fff;
    padding: 40px;
    width: 600px;
    max-width: 100%;
    font-size: 12pt;
    position: fixed;
    left: -9999px;
    top: 0;
}

.receipt-header {
    margin-bottom: 24px;
}

.receipt-logo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.receipt-brand-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #4d9fff, #7c3aed);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.receipt-company {
    font-size: 20pt;
    font-weight: 800;
    color: #111;
    margin: 0;
}

.receipt-owner {
    font-size: 11pt;
    color: #555;
    margin: 4px 0 0;
}

.receipt-title {
    font-size: 15pt;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin: 16px 0 4px;
}

.receipt-generated {
    font-size: 10pt;
    color: #888;
    text-align: center;
    margin: 0;
}

.receipt-divider {
    border: none;
    height: 2px;
    background: #e5e7eb;
    margin: 20px 0;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
}

.receipt-table td {
    padding: 10px 12px;
    font-size: 11pt;
}

.receipt-table tr:nth-child(odd) {
    background: #f9fafb;
}

.receipt-table .receipt-label {
    font-weight: 700;
    color: #374151;
    width: 38%;
}

.receipt-table .receipt-value {
    color: #1f2937;
}

.receipt-table .receipt-amount-row td {
    padding: 14px 12px;
    font-size: 14pt;
    font-weight: 800;
    background: #eff6ff;
    color: #1d4ed8;
    border-top: 2px solid #bfdbfe;
}

.receipt-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 9.5pt;
    color: #888;
}

.receipt-footer p {
    margin: 4px 0;
}

/* ─── TOAST ─── */
.toast {
    background: #131825;
    border: 1px solid var(--border-light);
}

.toast-header {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

/* ─── BUTTONS ─── */
.btn-outline-secondary {
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-outline-primary {
    border-color: var(--blue);
    color: var(--blue);
}

.btn-outline-primary:hover {
    background: var(--blue-dim);
    color: var(--blue);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .search-box-row {
        flex-wrap: wrap;
    }

    .search-by-wrap {
        width: 100%;
    }

    .search-by-select {
        width: 100%;
    }

    .search-input-wrap {
        width: 100%;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }

    .header-meta {
        display: none;
    }

    .record-card-actions {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 10px 14px;
        justify-content: flex-end;
    }

    .record-card {
        flex-wrap: wrap;
    }

    .stat-divider {
        display: none;
    }

    .record-card-top {
        flex-wrap: wrap;
        gap: 4px;
    }

    /* On mobile: beneficiary takes full width, amount goes to its own line */
    .record-beneficiary {
        width: 100%;
        flex: none;
        font-size: 14px;
    }

    .record-amount {
        font-size: 15px;
    }

    /* Make the date column slightly narrower on mobile */
    .record-card-date {
        min-width: 50px;
        padding: 10px;
    }

    .record-date-day {
        font-size: 18px;
    }

    .record-date-month {
        font-size: 9px;
    }

    .record-date-year {
        font-size: 9px;
    }

    .record-card-body {
        padding: 10px 12px;
    }

    .search-title {
        font-size: 20px;
    }

    .search-hero {
        padding: 32px 0 24px;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 0 12px 40px;
    }

    .header-inner {
        padding: 0 12px;
    }
}