/* ═══════════════════════════════════════════════════════════
   Uzam Traders Pvt. Ltd. — Accounts System Stylesheet
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --bg-main: #0f1117;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-sidebar: #0d1020;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --text-primary: #e8ecff;
    /* brighter primary text */
    --text-secondary: #a0aac8;
    --text-muted: #94abb3;
    /* brighter muted for better contrast */
    --green: #00e896;
    --green-dim: rgba(0, 232, 150, 0.15);
    --red: #ff4d6d;
    --red-dim: rgba(255, 77, 109, 0.15);
    --blue: #4d9fff;
    --blue-dim: rgba(77, 159, 255, 0.15);
    --purple: #a855f7;
    --purple-dim: rgba(168, 85, 247, 0.15);
    --amber: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.15);
    --yellow: #facc15;
    --yellow-dim: rgba(250, 204, 21, 0.15);
    --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 {
    height: 100%;
    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);
}

/* ─── PIN SCREEN ─── */
.pin-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: radial-gradient(ellipse at 50% 0%, #1a1040 0%, #0a0c18 60%, #050710 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-card {
    text-align: center;
    padding: 48px 40px 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    width: 360px;
    max-width: 95vw;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

.pin-logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #4d9fff, #7c3aed);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 12px 32px rgba(77, 159, 255, 0.35);
}

.pin-logo h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pin-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pin-dots-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    transition: var(--transition);
    background: transparent;
}

.pin-dot.active {
    background: linear-gradient(135deg, #4d9fff, #7c3aed);
    border-color: transparent;
    box-shadow: 0 0 12px rgba(77, 159, 255, 0.5);
    transform: scale(1.15);
}

.pin-dot.error {
    border-color: var(--red);
    background: var(--red-dim);
}

.pin-error {
    color: var(--red);
    font-size: 13px;
    margin-bottom: 12px;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.pin-key {
    height: 60px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.pin-key:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.pin-key:active {
    transform: translateY(0) scale(0.96);
}

.pin-key-clear {
    color: var(--amber);
    font-size: 16px;
}

.pin-key-del {
    color: var(--red);
    font-size: 16px;
}

.pin-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ─── LAYOUT ─── */
#main-app {
    display: flex;
    min-height: 100vh;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.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: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-sub {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    list-style: none;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0;
    transition: var(--transition);
    font-weight: 500;
    font-size: 13.5px;
    border-left: 3px solid transparent;
}

.sidebar-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    color: var(--blue);
    background: var(--blue-dim);
    border-left-color: var(--blue);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 16px;
}

.sidebar-section-title {
    padding: 6px 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    font-size: 28px;
    color: var(--blue);
}

.fw-600 {
    font-weight: 600;
}

.sidebar-lock-btn {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.sidebar-lock-btn:hover {
    color: var(--red);
    border-color: var(--red);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

/* ─── TOP BAR ─── */
.topbar {
    height: var(--topbar-h);
    padding: 0 24px;
    background: rgba(13, 16, 32, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    flex: 1;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.topbar-balance-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--blue-dim);
    border: 1px solid rgba(77, 159, 255, 0.25);
    border-radius: 50px;
    white-space: nowrap;
}

.pill-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pill-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
}

.topbar-date {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ─── PAGES ─── */
.page-wrapper {
    flex: 1;
    padding: 28px 24px;
    max-width: 1440px;
    width: 100%;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.dash-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ─── KPI CARDS ─── */
.kpi-card {
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    background: var(--bg-card);
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-balance::before {
    background: linear-gradient(90deg, #4d9fff, #7c3aed);
}

.kpi-in::before {
    background: linear-gradient(90deg, #00e896, #06b6d4);
}

.kpi-out::before {
    background: linear-gradient(90deg, #ff4d6d, #f97316);
}

.kpi-month::before {
    background: linear-gradient(90deg, #a855f7, #ec4899);
}

.kpi-icon {
    font-size: 22px;
    margin-bottom: 10px;
    opacity: 0.85;
}

.kpi-balance .kpi-icon {
    color: var(--blue);
}

.kpi-in .kpi-icon {
    color: var(--green);
}

.kpi-out .kpi-icon {
    color: var(--red);
}

.kpi-month .kpi-icon {
    color: var(--purple);
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.kpi-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ─── MINI KPI ─── */
.mini-kpi {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.mini-kpi-in {
    border-color: rgba(0, 232, 150, 0.2);
    background: var(--green-dim);
}

.mini-kpi-out {
    border-color: rgba(255, 77, 109, 0.2);
    background: var(--red-dim);
}

.mini-kpi-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-kpi-value {
    font-size: 17px;
    font-weight: 800;
    margin-top: 2px;
}

.mini-kpi-in .mini-kpi-value {
    color: var(--green);
}

.mini-kpi-out .mini-kpi-value {
    color: var(--red);
}

/* ─── GLASS CARDS ─── */
.card-glass {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.card-glass-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.card-glass-body {
    padding: 20px;
}

.card-glass-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

/* ─── FILTER BAR ─── */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.filter-bar .form-control,
.filter-bar .form-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-light);
    color: var(--text-primary);
    font-size: 13px;
    flex: 1;
    min-width: 120px;
}

.filter-bar .form-control::placeholder {
    color: var(--text-secondary);
}

.filter-bar .form-control:focus,
.filter-bar .form-select:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.15);
    color: var(--text-primary);
}

.filter-bar .form-select option {
    background: #1a1e2e;
    color: var(--text-primary);
}

/* ─── TABLES (desktop) ─── */
.table {
    color: var(--text-primary);
    font-size: 13px;
    background-color: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--text-primary);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: var(--text-primary);
}

.table thead th {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 14px;
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
    color: var(--text-primary);
}

.table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--border-light);
    padding: 10px 14px;
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-muted) !important;
}

#dash-date {
    color: var(--text-secondary);
    font-weight: 500;
}

.small,
small {
    font-size: 12px;
}

/* ─── MOBILE CARD-STYLE ROWS ─── */
/* Each tx row becomes a card on mobile */
.tx-card-row {
    display: none;
    /* shown only on mobile via media query */
    flex-direction: column;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    gap: 6px;
}

.tx-card-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tx-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tx-card-ref {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tx-card-amount {
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
}

.tx-card-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tx-card-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.tx-card-balance {
    font-size: 12px;
    font-weight: 600;
}

.tx-card-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

/* ─── BADGES ─── */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.type-badge-in {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(0, 232, 150, 0.25);
}

.type-badge-out {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(255, 77, 109, 0.25);
}

.amount-in {
    color: var(--green);
    font-weight: 700;
}

.amount-out {
    color: var(--red);
    font-weight: 700;
}

.balance-positive {
    color: var(--blue);
    font-weight: 700;
}

.balance-negative {
    color: var(--red);
    font-weight: 700;
}

/* ─── PAGINATION ─── */
.pagination-container {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.page-btn:hover {
    background: var(--blue-dim);
    color: var(--blue);
    border-color: var(--blue);
}

.page-btn.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    font-weight: 700;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 8px;
}

/* ─── FORM CONTROLS (Global) ─── */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.15);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-select option {
    background: #1a1e2e;
    color: var(--text-primary);
}

.form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.9;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.form-text {
    color: var(--text-secondary) !important;
}

/* ─── TYPE TOGGLE ─── */
.type-toggle {
    display: flex;
    gap: 8px;
}

.type-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.type-btn-in.active {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-dim);
}

.type-btn-out.active {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-dim);
}

.type-btn:not(.active):hover {
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.05);
}

/* ─── MODAL ─── */
.modal-glass,
.modal-glass.modal-content {
    background: #111420 !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8) !important;
}

.modal-glass .modal-header {
    background: rgba(255, 255, 255, 0.04) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 20px 24px;
}

.modal-glass .modal-body {
    padding: 28px 24px;
    background: transparent !important;
}

.modal-glass .modal-footer {
    border-top: 1px solid var(--border) !important;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02) !important;
}

.modal-glass .modal-title {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 18px;
}

::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.6);
    cursor: pointer;
}

::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.btn-close-white {
    filter: invert(1) grayscale(1);
}

/* ─── BUTTONS ─── */
.btn-primary {
    background: linear-gradient(135deg, #4d9fff, #7c3aed);
    border: none;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6ab2ff, #8b47f7);
    border: none;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #00e896, #06b6d4);
    border: none;
    color: #000;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1af2a5, #0dd0ef);
    border: none;
    color: #000;
}

.btn-danger {
    background: linear-gradient(135deg, #ff4d6d, #f97316);
    border: none;
    font-weight: 600;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff6b85, #fb8a3a);
    border: none;
}

/* ─── NAV TABS ─── */
.nav-tabs {
    border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
}

.nav-tabs .nav-link.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    background: transparent;
}

/* ─── TRANSACTION DETAIL CARD ─── */
.tx-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.tx-detail-row:last-child {
    border-bottom: none;
}

.tx-detail-label {
    color: var(--text-secondary);
    font-size: 13px;
    flex-shrink: 0;
}

.tx-detail-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
}

/* ─── ACTION BUTTONS IN TABLE ─── */
.action-btns {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
}

.action-btn-view:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-dim);
}

.action-btn-edit:hover {
    border-color: var(--amber);
    color: var(--amber);
    background: var(--amber-dim);
}

.action-btn-delete:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-dim);
}

/* ─── TOAST ─── */
#app-toast {
    background: #1a2035;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    border-radius: 12px;
}

.toast-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 12px 12px 0 0;
}

.toast-header .btn-close {
    filter: invert(1) grayscale(1);
}

/* ─── RESPONSIVE BREAKPOINTS ─── */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
        overflow-x: hidden;
        /* prevent any child from causing horizontal scroll */
        max-width: 100vw;
    }

    .topbar-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-wrapper {
        padding: 16px;
        overflow-x: hidden;
        max-width: 100%;
    }
}

/* ─── MOBILE: table → card rows ─── */
@media (max-width: 640px) {

    /* Hide desktop table header & rows */
    .mobile-table thead {
        display: none;
    }

    .mobile-table tbody tr.desktop-row {
        display: none !important;
    }

    .mobile-table tbody tr.tx-card-row {
        display: flex !important;
    }

    /* Filter bar full-width inputs */
    .filter-bar {
        padding: 10px;
        gap: 8px;
    }

    .filter-bar .form-control,
    .filter-bar .form-select {
        min-width: calc(50% - 4px);
        flex: 1 1 calc(50% - 4px);
    }

    .filter-bar .btn {
        flex: 0 0 auto;
    }

    /* Page adjustments */
    .pin-card {
        padding: 32px 20px 24px;
    }

    .kpi-card {
        padding: 14px;
    }

    .kpi-value {
        font-size: 15px;
    }

    .topbar {
        padding: 0 12px;
        gap: 8px;
    }

    .topbar-balance-pill {
        padding: 5px 10px;
    }

    .pill-value {
        font-size: 12px;
    }

    .pill-label {
        display: none;
    }

    .page-h1 {
        font-size: 17px;
    }

    .card-glass-body {
        padding: 0;
    }

    .card-glass-header {
        padding: 12px 14px;
        font-size: 13px;
    }

    .page-header {
        margin-bottom: 16px;
    }

    .mini-kpi {
        padding: 10px 12px;
    }

    .mini-kpi-value {
        font-size: 14px;
    }

    .topbar-title {
        font-size: 14px;
    }
}

/* ─── SPINNER ─── */
.loading-row td {
    color: var(--text-secondary);
}

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ─── ANIMATIONS ─── */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.skeleton {
    animation: pulse 1.5s ease infinite;
    background: var(--border);
    border-radius: 4px;
}

/* ─── DASHBOARD month label ─── */
.month-label-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    background: var(--blue-dim);
    border: 1px solid rgba(77, 159, 255, 0.2);
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
}

/* ─── STATEMENT CARDS ─── */
.st-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.st-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.st-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.st-card .action-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.st-card:hover {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.st-card-date {
    display: flex;
    flex-direction: column;
    width: 48px;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    border: 1px solid var(--blue);
    flex-shrink: 0;
}

.st-card-date-top {
    background: var(--blue);
    color: #fff;
    padding: 6px 4px;
    line-height: 1.1;
}

.st-card-date-month {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.st-card-date-day {
    font-size: 16px;
    font-weight: 800;
}

.st-card-date-year {
    background: transparent;
    color: var(--blue);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 0;
}

.st-card-body {
    flex: 1;
    min-width: 0;
    /* allow shrinking in flex so text truncation works */
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.st-card-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.st-card-amount .currency {
    font-size: 13px;
    font-weight: 600;
    margin-right: 4px;
    color: var(--text-secondary);
}

.st-card-amount.amount-in {
    color: var(--green);
}

.st-card-amount.amount-out {
    color: var(--text-primary);
}

.st-card-desc {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.st-card-account {
    font-size: 11px;
    color: var(--blue-light);
    margin-top: 4px;
    display: flex;
    align-items: center;
    opacity: 0.85;
}

.st-card-account i {
    font-size: 10px;
    margin-right: 4px;
}

.st-card-running-bal {
    font-size: 12px;
}

.st-card-running-bal span.fw-bold {
    letter-spacing: -0.2px;
}

.st-card-arrow {
    flex-shrink: 0;
    font-size: 20px;
}

.st-card-arrow.arrow-in {
    color: var(--green);
}

.st-card-arrow.arrow-out {
    color: var(--red);
}

/* ── Expandable Detail section ── */
.st-card-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, margin 0.35s ease, opacity 0.35s ease;
    opacity: 0;
    margin-top: 0;
}

.st-card.open .st-card-detail {
    max-height: 10000px;
    padding-top: 16px;
    margin-top: 12px;
    opacity: 1;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.st-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .st-detail-grid {
        grid-template-columns: 1fr;
    }
}

.st-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.st-detail-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.st-detail-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

.st-detail-value.running-balance {
    font-weight: 700;
}

.st-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.st-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

.st-empty p {
    font-size: 14px;
}

/* ─── PRINT STYLES ─── */
@media print {

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
        font-family: 'Inter', Arial, sans-serif !important;
        height: auto !important;
        overflow: visible !important;
    }

    #main-app,
    .modal,
    .toast-container,
    .sidebar,
    .topbar,
    .page-header button,
    .filter-bar,
    .pagination-container {
        display: none !important;
    }

    #print-template {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        background: #fff !important;
    }

    #receipt-template {
        display: none !important;
        /* hidden by default in print, unless toggled */
        width: 100% !important;
        background: #fff !important;
    }

    body.state-receipt-print #receipt-template {
        display: block !important;
    }

    body.state-receipt-print #print-template {
        display: none !important;
    }

    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 2px solid #333;
    }

    .print-brand h1 {
        font-size: 24pt;
        margin: 0;
        font-weight: 800;
        color: #1a1e2e;
    }

    .print-brand p {
        margin: 5px 0 0;
        font-size: 13pt;
        color: #666;
    }

    .print-meta {
        margin-top: 15px;
        font-size: 10pt;
        color: #444;
    }

    .print-meta span {
        display: block;
    }

    .print-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        text-align: right;
    }

    .print-stat-item label {
        display: block;
        font-size: 9pt;
        text-transform: uppercase;
        color: #888;
    }

    .print-stat-item div {
        font-size: 14pt;
        font-weight: 700;
        color: #000;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 30px;
    }

    .print-table th {
        background: #f0f2f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 10px;
        font-size: 10pt;
        text-align: left;
        border-bottom: 2px solid #ddd;
    }

    .print-table td {
        padding: 10px;
        border-bottom: 1px solid #eee;
        font-size: 10pt;
    }

    .print-table .amount-in {
        color: #00875a !important;
        font-weight: 600;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-table .amount-out {
        color: #de350b !important;
        font-weight: 600;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-footer {
        margin-top: 50px;
        font-size: 9pt;
        color: #888;
        border-top: 1px solid #eee;
        padding-top: 20px;
        text-align: center;
    }
}

/* ─── CUSTOM BANK SELECT ─── */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
}

.bank-logo-sm {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    background: #fff;
    padding: 1px;
}

.custom-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #1a1b26;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 2147483647;
    /* MAX Z-INDEX */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    max-height: 320px;
    display: flex;
    flex-direction: column;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-options-search {
    padding: 8px;
    background: #161720;
    border-bottom: 1px solid var(--border);
}

.custom-options-search input {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border) !important;
    color: #fff !important;
    font-size: 13px;
    box-shadow: none !important;
    padding: 6px 10px;
}

.custom-options-list {
    overflow-y: auto;
    flex: 1;
    background: #1a1b26;
}

.custom-option {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    color: var(--text-secondary);
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.custom-option.selected {
    background: var(--blue-dim);
    color: var(--text-primary);
    border-left: 3px solid var(--blue);
}

.custom-option img {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border-radius: 4px;
    background: #fff;
    padding: 1px;
    object-fit: contain;
}

.custom-option i.bi-bank {
    margin-right: 12px;
    font-size: 16px;
    color: var(--text-muted);
}

/* Higher layer for bank selection */
#txModal .modal-body {
    overflow: visible !important;
}

#txModal .modal-content {
    overflow: visible !important;
}

#txModal .modal-dialog {
    margin-bottom: 250px !important;
    /* Space for dropdown */
}

/* Ensure the wrapper doesn't clip */
.custom-select-wrapper {
    position: relative;
    z-index: 1000;
}

.custom-select-wrapper.open {
    z-index: 2000;
}

/* ─── END CUSTOM BANK SELECT ─── */

#bulk-bank-search {
    color: white !important;
}

#bulk-bank-search::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Statement, Cash In/Out, Admin
   ═══════════════════════════════════════════════════════════ */

/* ─── FILTER BAR: Mobile — no-overflow layout ─── */
@media (max-width: 767px) {
    .filter-bar {
        padding: 8px;
        gap: 6px;
        box-sizing: border-box;
        width: 100%;
    }

    /* Search / text → own full row */
    .filter-bar input[type="text"],
    .filter-bar input[type="search"] {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        /* allow to shrink, not overflow */
        max-width: 100% !important;
    }

    /* Rows 2 & 3: Date pickers — 2 per row (min 140px forces wrap) */
    .filter-bar input[type="date"] {
        flex: 1 1 140px !important;
        min-width: 140px !important;
        max-width: calc(50% - 3px) !important;
    }

    /* Row 2: Dropdowns — 2 per row (min 140px forces wrap) */
    .filter-bar select,
    .filter-bar .form-select {
        flex: 1 1 140px !important;
        min-width: 140px !important;
        max-width: calc(50% - 3px) !important;
    }

    /* Row 4: Icon buttons — compact, readable */
    .filter-bar .btn:not(.ms-auto) {
        flex: 0 0 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* "New Transaction" fills remaining row space */
    .filter-bar .btn.ms-auto {
        flex: 1 1 auto !important;
        margin-left: 0 !important;
        height: 40px;
    }
}

/* ─── ADMIN TABS: Scrollable on mobile ─── */
@media (max-width: 640px) {
    #adminTabs {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    #adminTabs::-webkit-scrollbar {
        display: none;
    }

    #adminTabs .nav-link {
        white-space: nowrap;
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ─── TRANSACTION CARDS: Compact on mobile ─── */
@media (max-width: 480px) {
    .st-card {
        padding: 12px 10px;
        border-radius: 10px;
    }

    .st-card-main {
        gap: 10px;
    }

    .st-card-date {
        width: 40px;
    }

    .st-card-date-day {
        font-size: 14px;
    }

    .st-card-date-month {
        font-size: 10px;
    }

    .st-card-amount {
        font-size: 14px;
    }

    .st-card-desc {
        font-size: 12px !important;
    }

    .action-btns {
        gap: 4px;
    }

    .action-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    /* Right side: tighter */
    .st-card-main>div:last-child {
        gap: 6px;
        padding-left: 8px !important;
    }

    .st-card-running-bal {
        font-size: 11px;
    }

    /* Batch expand table: readable */
    .st-card-detail .table {
        font-size: 11px;
    }
}

/* ─── PAGINATION: Larger tap targets, centred on mobile ─── */
@media (max-width: 640px) {
    .pagination-container {
        justify-content: center;
        padding: 4px 0;
    }

    .page-btn {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
        border-radius: 8px;
    }

    .page-info {
        font-size: 11px;
        padding: 0 4px;
    }
}

/* ─── BATCH DETAIL MODAL: Responsive ─── */
@media (max-width: 767px) {
    #batchDetailModal .modal-dialog {
        margin: 8px;
        max-width: calc(100vw - 16px);
    }

    #batchDetailModal .modal-body .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-height: 50vh;
    }

    #batchDetailModal table {
        font-size: 12px;
        min-width: 420px;
        /* prevents columns from collapsing too much */
    }

    #batchDetailModal .modal-footer>div {
        flex-wrap: wrap;
        gap: 6px;
    }

    #batchDetailModal .modal-footer .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }

    #batchDetailModal .modal-footer .ms-auto {
        margin-left: 0 !important;
        width: 100%;
        text-align: right;
    }
}

/* ─── PAGE WRAPPER: Tighter on tiny screens ─── */
@media (max-width: 480px) {
    .page-wrapper {
        padding: 12px;
    }

    .card-glass-footer {
        padding: 10px 12px;
    }

    .page-header {
        margin-bottom: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-header .btn {
        flex: 1 1 auto;
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* ─── MINI KPIs: Tighter label + value on very small screens ─── */
@media (max-width: 400px) {
    .mini-kpi {
        padding: 10px;
    }

    .mini-kpi-value {
        font-size: 13px;
    }

    .mini-kpi-label {
        font-size: 9px;
        letter-spacing: 0.3px;
    }
}

/* ─── STATEMENT + CASH IN/OUT: List gap ─── */
@media (max-width: 480px) {
    .st-list {
        gap: 8px;
    }
}

/* ─── VIEW TRANSACTION MODAL: Full screen on mobile ─── */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 8px;
    }

    .modal-glass .modal-body {
        padding: 16px;
    }

    .modal-glass .modal-header {
        padding: 14px 16px;
    }

    .tx-detail-label {
        font-size: 12px;
    }

    .tx-detail-value {
        font-size: 13px;
    }
}

/* ─── GLOBAL: prevent ANY element causing horizontal scroll ─── */
@media (max-width: 767px) {

    /* KPI values: truncate long numbers like "PKR -15,463,771.xx" */
    .mini-kpi-value {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .kpi-value {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Cards: never wider than the viewport */
    .st-card {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Filter bar: must stay within its container */
    .filter-bar {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Row gutter: Bootstrap rows add negative margins that can cause overflow */
    .row {
        --bs-gutter-x: 12px;
    }
}