/* ═══════════════════════════════════════════════════════
   JarbMoney — ระบบรับจำน้า
   Theme: Deep Navy #0D1B2A + Green #009639 | Minimal | Thai
   Font: Prompt (Google Fonts)
   ═══════════════════════════════════════════════════════ */

:root {
    --navy: #0D1B2A;
    --navy-2: #1B263B;
    --navy-3: #243447;
    --green: #009639;
    --green-light: #00B347;
    --green-dark: #007A2E;
    --bg: #F5F7FA;
    --bg-card: #FFFFFF;
    --white: #FFFFFF;
    --gray: #6C757D;
    --gray-light: #E9ECEF;
    --gray-dark: #495057;
    --border: #DEE2E6;
    --success: #28A745;
    --danger: #DC3545;
    --info: #17A2B8;
    --warning: #FFC107;
    --shadow: 0 4px 12px rgba(13,27,42,0.06);
    --shadow-md: 0 6px 24px rgba(13,27,42,0.08);
    --shadow-lg: 0 12px 48px rgba(13,27,42,0.16);
    --shadow-xl: 0 20px 60px rgba(13,27,42,0.22);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --nav-h: 60px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Prompt', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--navy-2);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ─── Navbar ───────────────────────────────────────────── */

.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: var(--navy);
    display: flex; align-items: center;
    padding: 0 16px; z-index: 1000;
    box-shadow: var(--shadow-md);
}

.nav-brand {
    display: flex; align-items: center; gap: 8px;
    color: var(--white); font-weight: 700; font-size: 18px;
    margin-right: auto;
}

.nav-brand .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--navy); font-weight: 800;
    transition: var(--transition);
}

.nav-brand .accent-text { color: var(--green); }

.nav-links {
    display: flex; align-items: center; gap: 2px;
}

.nav-links a {
    display: flex; align-items: center; gap: 6px;
    color: rgba(255,255,255,0.8);
    padding: 8px 12px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; white-space: nowrap;
    transition: var(--transition);
}

.nav-links a svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-links a:hover { background: rgba(255,255,255,0.12); color: var(--white); transform: translateY(-1px); }

.nav-links a.active { background: var(--green); color: var(--navy); font-weight: 600; }

.nav-links a.nav-logout { color: rgba(255,255,255,0.5); margin-left: 4px; }
.nav-links a.nav-logout:hover { color: var(--danger); }

.nav-toggle {
    display: none; background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle svg { width: 26px; height: 26px; color: var(--white); }

/* ─── Content ──────────────────────────────────────────── */

.content {
    max-width: 1100px; margin: 0 auto;
    padding: calc(var(--nav-h) + 16px) 16px 80px;
}

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}

.page-title { font-size: 22px; font-weight: 700; color: var(--navy); }

/* ─── Cards ────────────────────────────────────────────── */

.card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); overflow: hidden; margin-bottom: 16px;
    transition: var(--transition);
}

.card-body { padding: 18px; }

.card-header {
    padding: 16px 18px; background: var(--navy);
    color: var(--white); font-weight: 600; font-size: 16px;
    display: flex; align-items: center; justify-content: space-between;
}

.card-header .accent-text { color: var(--green); }

/* ─── Stats ────────────────────────────────────────────── */

.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #FAFCFE 100%);
    border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 16px;
    border-left: 4px solid var(--green);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.stat-card .stat-label { font-size: 13px; color: var(--gray); margin-bottom: 6px; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; color: var(--navy); }
.stat-card .stat-sub { font-size: 12px; color: var(--gray); margin-top: 2px; }

/* ─── Contract list items ──────────────────────────────── */

.contract-item {
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; transition: var(--transition); cursor: pointer;
    border-left: 4px solid transparent;
}

.contract-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.contract-item .ci-left { flex: 1; min-width: 0; }
.contract-item .ci-no { font-weight: 700; font-size: 15px; color: var(--navy); }
.contract-item .ci-name { font-size: 14px; color: var(--gray-dark); margin-top: 2px; }
.contract-item .ci-meta { font-size: 12px; color: var(--gray); margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.contract-item .ci-right { text-align: right; flex-shrink: 0; }
.contract-item .ci-amount { font-size: 17px; font-weight: 700; color: var(--navy); }
.contract-item .ci-due { font-size: 12px; color: var(--gray); }

/* ─── Status badges ────────────────────────────────────── */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-active { background: rgba(23,162,184,0.12); color: var(--info); }
.badge-paid { background: rgba(40,167,69,0.12); color: var(--success); }
.badge-overdue { background: rgba(255,193,7,0.15); color: #B58900; }
.badge-defaulted { background: rgba(220,53,69,0.12); color: var(--danger); }

/* ─── Forms ────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }

.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--gray-dark); margin-bottom: 6px;
}

.form-label .req { color: var(--danger); }

.form-input, .form-select, .form-textarea {
    width: 100%; padding: 11px 14px;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-size: 15px; font-family: inherit; color: var(--navy-2);
    background: var(--white); transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--green);
}

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

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

.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.form-hint { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* Range slider */
input[type="range"] {
    -webkit-appearance: none; width: 100%; height: 8px;
    border-radius: 4px; background: var(--gray-light); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
    background: var(--green); cursor: pointer; border: 3px solid var(--white);
    box-shadow: var(--shadow);
}
input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%; background: var(--green);
    cursor: pointer; border: 3px solid var(--white); box-shadow: var(--shadow);
}

.slider-value {
    display: inline-block; background: var(--navy); color: var(--green);
    padding: 2px 12px; border-radius: 20px; font-weight: 700; font-size: 14px;
    margin-left: 8px;
}

/* ─── Buttons ──────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 20px; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600; font-family: inherit;
    cursor: pointer; border: 2px solid transparent; transition: var(--transition);
    white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--green); color: var(--navy); border-color: var(--green); }
.btn-primary:hover { background: var(--green-light); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,150,57,0.3); }

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-2); transform: translateY(-2px); }

.btn-outline { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-outline:hover { border-color: var(--navy); background: var(--gray-light); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(220,53,69,0.3); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(40,167,69,0.3); }

.btn-block { width: 100%; }
.btn-lg { padding: 13px 28px; font-size: 17px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ─── Login ────────────────────────────────────────────── */

.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0D1B2A 0%, #1B263B 100%);
    padding: 20px;
}

.login-box {
    background: var(--white); border-radius: 24px;
    box-shadow: var(--shadow-xl); padding: 44px 36px;
    width: 100%; max-width: 420px; text-align: center;
    transition: var(--transition);
}

.login-logo { margin-bottom: 32px; }

.login-logo-icon {
    width: 64px; height: 64px; margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    border-radius: 16px; display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--navy); font-weight: 800;
}

.login-box h1 { font-size: 28px; color: var(--navy); font-weight: 700; }
.login-box .sub { color: var(--gray); font-size: 14px; margin-top: 4px; }

.login-error {
    background: rgba(220,53,69,0.1); color: var(--danger);
    padding: 10px 14px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 16px;
}

/* ─── Flash messages ───────────────────────────────────── */

.flash {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 14px; font-weight: 500;
}
.flash-success { background: rgba(40,167,69,0.1); color: var(--success); border: 1px solid rgba(40,167,69,0.3); }
.flash-error { background: rgba(220,53,69,0.1); color: var(--danger); border: 1px solid rgba(220,53,69,0.3); }

/* ─── Photo upload ─────────────────────────────────────── */

.photo-upload-area {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 24px; text-align: center; cursor: pointer;
    transition: all 0.2s; margin-bottom: 12px;
}

.photo-upload-area:hover { border-color: var(--green); background: rgba(0,150,57,0.04); }

.photo-upload-area svg { width: 40px; height: 40px; color: var(--gray); margin-bottom: 8px; }
.photo-upload-area p { color: var(--gray); font-size: 14px; }

.photo-preview-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px; margin-top: 12px;
}

.photo-preview {
    position: relative; aspect-ratio: 1; border-radius: var(--radius-sm);
    overflow: hidden; background: var(--gray-light);
}

.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.photo-preview .pp-remove {
    position: absolute; top: 4px; right: 4px;
    background: rgba(220,53,69,0.9); color: white;
    border: none; border-radius: 50%; width: 22px; height: 22px;
    cursor: pointer; font-size: 14px; line-height: 1; display: flex;
    align-items: center; justify-content: center;
}

.photo-preview .pp-type {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.6); color: white;
    font-size: 11px; padding: 2px 6px; text-align: center;
}

/* ─── Image gallery ────────────────────────────────────── */

.gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px; margin-top: 12px;
}

.gallery-item {
    aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden;
    cursor: pointer; box-shadow: var(--shadow); position: relative;
}

.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item .gi-label {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(13,27,42,0.75); color: var(--green);
    font-size: 11px; padding: 3px 8px; text-align: center;
}

/* ─── Detail view ──────────────────────────────────────── */

.detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.detail-section {
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}

.detail-section h3 {
    font-size: 15px; color: var(--navy); margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 2px solid var(--gray-light);
    display: flex; align-items: center; gap: 6px;
}

.detail-row {
    display: flex; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid var(--gray-light);
    font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .dr-label { color: var(--gray); }
.detail-row .dr-value { font-weight: 600; color: var(--navy-2); }

.amount-box {
    background: var(--navy); color: var(--white);
    border-radius: var(--radius); padding: 16px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}

.amount-box .ab-label { color: rgba(255,255,255,0.7); font-size: 13px; }
.amount-box .ab-value { color: var(--green); font-size: 22px; font-weight: 700; }

/* ─── Empty state ──────────────────────────────────────── */

.empty-state {
    text-align: center; padding: 48px 20px; color: var(--gray);
}

.empty-state svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 15px; }

/* ─── Search bar ───────────────────────────────────────── */

.search-bar {
    display: flex; gap: 8px; margin-bottom: 16px;
}

.search-bar input {
    flex: 1; padding: 10px 14px;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-size: 15px; font-family: inherit;
}

.search-bar input:focus { outline: none; border-color: var(--green); }

.filter-tabs {
    display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}

.filter-tab {
    padding: 6px 14px; border-radius: 20px; font-size: 13px;
    font-weight: 600; background: var(--white); border: 2px solid var(--border);
    color: var(--gray-dark); cursor: pointer; transition: all 0.2s;
}

.filter-tab.active { background: var(--navy); color: var(--green); border-color: var(--navy); }

/* ─── Bottom nav (mobile) ──────────────────────────────── */

.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--navy); z-index: 999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 10px 4px; color: rgba(255,255,255,0.6);
    font-size: 11px; font-weight: 500; transition: var(--transition);
}

.bottom-nav-item svg { width: 24px; height: 24px; }
.bottom-nav-item.active { color: var(--green); }
.bottom-nav-item:hover { color: var(--white); }

/* ─── Lightbox ─────────────────────────────────────────── */

.lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.9); z-index: 3000;
    align-items: center; justify-content: center; padding: 16px;
}

.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 10px; }

.lightbox-close {
    position: absolute; top: 16px; right: 20px;
    background: rgba(255,255,255,0.15); border: none; border-radius: 50%;
    width: 40px; height: 40px; color: white; font-size: 22px; cursor: pointer;
}

/* ─── Toast ────────────────────────────────────────────── */

.toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: var(--navy); color: var(--green); padding: 10px 20px;
    border-radius: 20px; font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-lg); z-index: 4000; opacity: 0;
    transition: opacity 0.3s, bottom 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; bottom: 90px; }

/* ─── Responsive ───────────────────────────────────────── */

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed; top: var(--nav-h); right: -100%;
        width: 220px; height: calc(100vh - var(--nav-h));
        background: var(--navy); flex-direction: column; align-items: stretch;
        padding: 12px; gap: 4px; transition: right 0.3s;
    }
    body.nav-open .nav-links { right: 0; }
    .nav-links a { padding: 12px; border-radius: var(--radius-sm); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .bottom-nav { display: flex; }
    .content { padding-bottom: 72px; }
    .contract-item { flex-direction: column; align-items: stretch; }
    .contract-item .ci-right { text-align: left; display: flex; justify-content: space-between; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-title { font-size: 18px; }
}

/* ─── Phase 3: Notification Bell + Dropdown ────────────── */

.nav-bell {
    position: relative;
    margin-left: 4px;
}

.bell-btn {
    position: relative;
    background: none; border: none; cursor: pointer;
    padding: 6px; border-radius: 50%;
    color: rgba(255,255,255,0.8);
    transition: all 0.2s;
}
.bell-btn:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.bell-btn svg { display: block; }

.bell-badge {
    position: absolute; top: 0; right: 0;
    background: var(--danger); color: white;
    font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
    border: 2px solid var(--navy);
}

.notif-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    width: 340px; max-width: calc(100vw - 32px);
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 2000;
    overflow: hidden; margin-top: 8px;
    border: 1px solid var(--border);
}
.notif-dropdown.show { display: block; }

.notif-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--navy);
    color: var(--white); font-weight: 600; font-size: 14px;
}

.notif-list {
    max-height: 360px; overflow-y: auto;
}

.notif-item {
    display: flex; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
    font-size: 20px; flex-shrink: 0; line-height: 1.4;
}

.notif-content { flex: 1; min-width: 0; }

.notif-msg {
    font-size: 13px; color: var(--navy-2);
    word-break: break-word; line-height: 1.4;
}

.notif-time {
    font-size: 11px; color: var(--gray); margin-top: 3px;
}

.notif-empty {
    text-align: center; padding: 32px 16px;
    color: var(--gray); font-size: 14px;
}

@media (max-width: 768px) {
    .notif-dropdown {
        position: fixed; top: var(--nav-h); right: 0; left: 0;
        width: 100%; margin-top: 0; border-radius: 0;
    }
    .nav-bell { order: -1; margin-left: 8px; }
}

/* ═══════════════════════════════════════════════════════
   Phase 4: Cash Drawer + Summaries + Bar Chart
   ═══════════════════════════════════════════════════════ */

/* ─── Date navigation (prev/next) ──────────────────────── */

.date-nav {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.date-nav .date-display {
    font-size: 17px; font-weight: 700; color: var(--navy);
    padding: 8px 16px; background: var(--bg-card);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    flex: 1; text-align: center; min-width: 180px;
}
.date-nav .date-input {
    padding: 8px 14px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-size: 15px;
    font-family: inherit; color: var(--navy-2); background: var(--white);
    transition: var(--transition);
}
.date-nav .date-input:focus { outline: none; border-color: var(--green); }
.month-nav-select {
    padding: 8px 14px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); font-size: 15px;
    font-family: inherit; color: var(--navy-2); background: var(--white);
    transition: var(--transition);
}

/* ─── Summary stat rows ────────────────────────────────── */

.summary-section { margin-bottom: 20px; }
.summary-section h3 {
    font-size: 16px; color: var(--navy); margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 2px solid var(--gray-light);
    display: flex; align-items: center; gap: 6px;
}
.summary-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--bg-card);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    transition: var(--transition);
}
.summary-row:hover { box-shadow: var(--shadow-md); }
.summary-row .sr-label { font-size: 14px; color: var(--gray); }
.summary-row .sr-value { font-size: 16px; font-weight: 700; color: var(--navy); }
.summary-row .sr-value.positive { color: var(--success); }
.summary-row .sr-value.negative { color: var(--danger); }

/* ─── Cash drawer entries ─────────────────────────────── */

.cash-entry {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 16px; margin-bottom: 8px;
    background: var(--bg-card); border-radius: var(--radius);
    box-shadow: var(--shadow); transition: var(--transition);
    border-left: 4px solid var(--border);
}
.cash-entry:hover { box-shadow: var(--shadow-md); transform: translateX(2px); }
.cash-entry.type-deposit { border-left-color: var(--success); }
.cash-entry.type-withdraw { border-left-color: var(--warning); }
.cash-entry.type-expense { border-left-color: var(--danger); }
.cash-entry .ce-left { flex: 1; min-width: 0; }
.cash-entry .ce-type { font-weight: 700; font-size: 15px; color: var(--navy); }
.cash-entry .ce-desc { font-size: 13px; color: var(--gray-dark); margin-top: 2px; }
.cash-entry .ce-meta { font-size: 12px; color: var(--gray); margin-top: 4px; }
.cash-entry .ce-right { text-align: right; flex-shrink: 0; }
.cash-entry .ce-amount { font-size: 17px; font-weight: 700; }
.cash-entry .ce-amount.positive { color: var(--success); }
.cash-entry .ce-amount.negative { color: var(--danger); }

/* ─── Type badges ─────────────────────────────────────── */

.type-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.type-badge-deposit { background: rgba(40,167,69,0.12); color: var(--success); }
.type-badge-withdraw { background: rgba(255,193,7,0.15); color: #B58900; }
.type-badge-expense { background: rgba(220,53,69,0.12); color: var(--danger); }

/* ─── Transaction table (daily summary) ───────────────── */

.txn-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.txn-table th {
    padding: 10px 12px; text-align: left; font-weight: 600;
    background: var(--navy); color: var(--white); white-space: nowrap;
}
.txn-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--gray-light);
}
.txn-table tr:last-child td { border-bottom: none; }
.txn-table tr:hover { background: var(--bg); }
.txn-table .txn-time { font-size: 12px; color: var(--gray); }
.txn-table .txn-amount { text-align: right; font-weight: 600; }

/* ─── Monthly bar chart (pure CSS) ────────────────────── */

.bar-chart {
    display: flex; align-items: flex-end; gap: 8px;
    height: 200px; padding: 16px 8px 0; margin-top: 12px;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}
.bar-col {
    flex: 1; min-width: 36px; display: flex; flex-direction: column;
    align-items: center; gap: 6px; height: 100%;
    justify-content: flex-end;
}
.bar-col .bar {
    width: 100%; max-width: 48px;
    background: linear-gradient(180deg, var(--green-light), var(--green));
    border-radius: 6px 6px 0 0; transition: var(--transition);
    min-height: 2px;
}
.bar-col:hover .bar { background: linear-gradient(180deg, var(--green), var(--green-dark)); }
.bar-col .bar-val { font-size: 11px; color: var(--navy); font-weight: 600; }
.bar-col .bar-label { font-size: 11px; color: var(--gray); white-space: nowrap; }

/* ─── Balance highlight box ───────────────────────────── */

.balance-box {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: var(--white); border-radius: var(--radius-lg);
    padding: 20px 24px; margin-bottom: 16px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: var(--shadow-md);
}
.balance-box .bb-label { color: rgba(255,255,255,0.7); font-size: 14px; }
.balance-box .bb-value { color: var(--green); font-size: 28px; font-weight: 700; }

/* ─── Responsive: new elements ────────────────────────── */

@media (max-width: 768px) {
    .summary-rows { grid-template-columns: 1fr; }
    .txn-table { font-size: 13px; }
    .txn-table th, .txn-table td { padding: 8px 8px; }
    .balance-box { flex-direction: column; gap: 8px; text-align: center; }
}
