/* Currency Ledger: desktop-app style UI modelled on the reference screens */
:root {
    --bg: #eef0f3;
    --surface: #ffffff;
    --line: #dfe3e8;
    --line-strong: #c4cad3;
    --text: #1f2328;
    --muted: #6b7280;
    --primary: #1f6fc5;
    --primary-dark: #185aa3;
    --navy: #13286c;
    --navy-2: #2747a5;
    --pill: #233f9b;
    --green: #2e8b4f;
    --green-dark: #1d5c34;
    --red: #d63b3b;
    --neg: #c62828;
    --pos: #1b7f3b;
    --name-bg: #e9e1e7;
    --radius: 4px;
}

html, body {
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
main.container-fluid { padding: 14px 18px 40px; }

/* ===== App bar ===== */
.appbar {
    background: #fafafa;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 1000;
    height: 46px;
    display: flex; align-items: center; gap: 6px;
    padding: 0 12px;
}
.appbar .circle-btn {
    width: 28px; height: 28px; border-radius: 50%;
    background: #2f3b52; color: #fff; border: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
}
.appbar .circle-btn:hover { background: #1f2838; }
.acc-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px; margin: 0 6px 0 4px;
    border-bottom: 2px solid transparent;
    color: var(--text); font-weight: 600; white-space: nowrap;
}
.acc-chip .code {
    border: 1px solid var(--line-strong); border-radius: 3px;
    font-size: 11px; font-weight: 600; padding: 0 4px; color: #444; background: #fff;
}
.acc-chip.active { border-bottom-color: var(--primary); }
.appbar .nav-links { display: flex; align-items: stretch; height: 100%; overflow-x: auto; scrollbar-width: none; }
.appbar .nav-links a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 10px; color: #2b2f36; white-space: nowrap;
    border-bottom: 2px solid transparent; border-top: 2px solid transparent;
}
.appbar .nav-links a i { font-size: 14px; color: #2f3b52; }
.appbar .nav-links a:hover { background: #f0f2f5; }
.appbar .nav-links a.active { border-bottom-color: var(--primary); font-weight: 600; }
.appbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.appbar .search {
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    height: 28px; padding: 0 8px; width: 150px; font-size: 13px; background: #fff;
}
.appbar .search:focus { outline: none; border-color: var(--primary); }
.status-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line-strong); border-radius: 6px;
    background: #fff; height: 28px; padding: 0 10px; font-size: 13px; color: #333;
}
.status-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status-btn.offline .dot { background: var(--red); }
.icon-btn {
    border: 1px solid transparent; background: transparent; border-radius: var(--radius);
    width: 30px; height: 28px; color: #2f3b52;
}
.icon-btn:hover { background: #eceff3; }

/* ===== Generic surfaces ===== */
.entry-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.card-title-sm { font-weight: 600; color: var(--text); font-size: 14px; }
.section-title { font-weight: 600; font-size: 14px; color: var(--text); }
.page-title { font-size: 18px; font-weight: 600; margin: 0; }

/* ===== Buttons ===== */
.btn { border-radius: var(--radius); font-size: 13.5px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-save {
    background: var(--primary); color: #fff; border: 0; border-radius: 3px;
    font-weight: 600; font-size: 15px; padding: 10px 46px; min-width: 150px;
}
.btn-save:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost {
    background: #fff; border: 1px solid var(--line-strong); color: #2b2f36;
    border-radius: var(--radius); padding: 6px 14px;
    display: inline-flex; align-items: center; gap: 7px;
}
.btn-ghost:hover { background: #f5f6f8; color: #111; border-color: #aeb5bf; }
.btn-ghost.on { background: #2f3b52; color: #fff; border-color: #2f3b52; }
.btn-ghost i { font-size: 14px; }

/* ===== Entry forms (underline inputs like the reference) ===== */
.form-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-start; }
.fld { display: flex; flex-direction: column; min-width: 120px; }
.fld.w-sm { width: 120px; } .fld.w-md { width: 170px; } .fld.w-lg { width: 220px; } .fld.grow { flex: 1 1 200px; }
.fld > label, .entry-form label.lbl {
    font-size: 12px; color: #4b5260; margin-bottom: 1px;
    display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.fld > label i { font-size: 12px; color: #4b5260; }
.entry-form .form-control, .uline {
    border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
    background: transparent; padding: 3px 2px; font-size: 14px; box-shadow: none;
}
.entry-form .form-control:focus, .uline:focus {
    border-bottom: 2px solid var(--primary); box-shadow: none; outline: none; padding-bottom: 2px; background: transparent;
}
.entry-form .form-control[readonly] { color: var(--text); border-bottom-style: dashed; }
.amount { text-align: left; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px !important; }
.big-amount { font-size: 17px !important; font-weight: 600; }
.sub { font-size: 12px; color: #4b5260; min-height: 17px; margin-top: 2px; }
.acc-name {
    font-size: 12.5px; min-height: 22px; padding: 2px 8px; margin-top: 4px;
    background: var(--name-bg); border-radius: 2px; color: #333;
}
.acc-name:empty { background: transparent; }
.acc-name.bad { background: #fde8e8; color: var(--neg); }
.jdate { font-size: 11.5px; color: var(--muted); }

/* currency pill (blue select like "IR ⌄") */
select.cur-pill {
    appearance: none; -webkit-appearance: none;
    background: var(--pill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 7px center;
    color: #fff; border: 0; border-radius: 4px;
    font-size: 12px; font-weight: 600; height: 24px; padding: 0 22px 0 9px; cursor: pointer;
}
select.cur-pill:focus { outline: 2px solid #9db6ee; }
select.cur-pill option { color: #111; background: #fff; }

.rate-tag {
    background: var(--green-dark); color: #fff; font-size: 11px; font-weight: 600;
    padding: 1px 6px; border-radius: 3px; white-space: nowrap;
}
.rate-line { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.rate-line .uline { width: 90px; font-size: 13px; font-weight: 600; padding: 1px 2px; }

/* × ÷ operator buttons */
.op-toggle { display: inline-flex; gap: 0; }
.op-toggle .op {
    width: 30px; height: 28px; border: 1px solid var(--line-strong); background: #fff;
    font-weight: 700; font-size: 15px; line-height: 1; color: #555;
}
.op-toggle .op:first-child { border-radius: 3px 0 0 3px; }
.op-toggle .op:last-child { border-radius: 0 3px 3px 0; border-left: 0; }
.op-toggle .op.mul.active { background: var(--red); border-color: var(--red); color: #fff; }
.op-toggle .op.div.active { background: var(--pill); border-color: var(--pill); color: #fff; }
.arrow-sep { align-self: center; color: #555; font-size: 16px; }

/* pill segmented toggle (adil | Treasure, Track | No Track | Unknown) */
.pill-toggle {
    display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px;
    background: #fff; padding: 2px; gap: 2px;
}
.pill-toggle input { display: none; }
.pill-toggle label {
    margin: 0; padding: 6px 16px; border-radius: 999px; cursor: pointer;
    font-size: 13px; color: #333; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.pill-toggle label:hover { background: #f1f3f5; }
.pill-toggle input:checked + label { background: var(--green); color: #fff; }
.pill-toggle.neutral input:checked + label { background: #2f3b52; }

.benefit-box { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.form-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #eef0f2; }
.print-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #333; cursor: pointer; }

/* ===== Lists ===== */
.list-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th {
    background: #f4f5f7; color: #4b5260; font-weight: 600; font-size: 12px;
    border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { border-color: #eef0f2; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f6f8fb; }
.empty-state { text-align: center; padding: 26px 0 18px; color: #333; }
.empty-state .plus {
    width: 52px; height: 52px; border-radius: 50%; background: #a9b1bd; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 6px;
}
.empty-state .t { font-size: 13px; }
.empty-state a { font-size: 12.5px; }

/* ===== Numbers & currency badges ===== */
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.neg { color: var(--neg) !important; }
.pos { color: var(--pos) !important; }
.cur-badge {
    display: inline-block; border: 1px solid #b8bfcc; border-radius: 3px;
    padding: 0 5px; font-size: 11.5px; font-weight: 600; color: #3a4150; background: #fff;
    min-width: 36px; text-align: center; line-height: 18px;
}
.cur-badge.solid { background: var(--pill); color: #fff; border-color: var(--pill); }

/* ===== Account page ===== */
.acc-head { display: flex; align-items: center; gap: 14px; background: #fff; margin: -14px -18px 0; padding: 16px 18px 18px; border-bottom: 1px solid var(--line); }
.avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: #8a1f2d; color: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; position: relative;
}
.avatar .type {
    position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
    background: #fff; color: #333; border: 1px solid var(--line-strong); border-radius: 3px;
    font-size: 10px; padding: 0 5px; white-space: nowrap; line-height: 15px;
}
.acc-head .name { font-size: 19px; font-weight: 600; }
.balance-panel {
    background: linear-gradient(100deg, var(--navy) 0%, #183585 55%, var(--navy-2) 100%);
    padding: 14px 16px 18px; color: #fff;
    margin: 0 -18px; /* full-bleed like the reference */
}
.balance-panel .title { font-weight: 600; font-size: 14.5px; margin-bottom: 8px; }
.balance-panel .tabs .btn {
    background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.75);
    font-size: 12.5px; padding: 3px 10px; border-radius: 3px;
}
.balance-panel .tabs .btn.active { background: #fff; color: var(--navy); border-color: #fff; font-weight: 600; }
.bal-card {
    background: #fff; color: #222; border-radius: 4px; padding: 10px 14px;
    min-width: 250px; box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.bal-card table { width: 100%; }
.bal-card td { padding: 3px 4px; font-size: 13px; }
.bal-card td:first-child { color: #333; padding-right: 18px; }
.bal-card .amt { font-weight: 600; font-size: 14.5px; }
.locked-mask { filter: blur(6px); user-select: none; }
.marks-bar { display: flex; align-items: center; padding: 14px 2px 10px; border-bottom: 1px solid var(--line); }
.marks-bar .bi-bookmark-fill { color: #2f3b52; }
.options-title { font-weight: 600; margin: 14px 2px 8px; }

/* ===== Dashboard ===== */
.rate-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; background: #fafbfc; min-width: 150px; }
.rate-tile .v { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ===== Misc ===== */
.alert { border-radius: var(--radius); font-size: 13.5px; }
.badge { font-weight: 600; }
.modal-content { border-radius: 6px; }
.dropdown-menu { font-size: 13.5px; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(120deg, var(--navy), var(--navy-2)); }
.login-box { background: #fff; width: 360px; border-radius: 6px; padding: 28px 28px 24px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.login-box .logo { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }

@media (max-width: 768px) {
    .appbar { height: auto; flex-wrap: wrap; padding: 6px 10px; }
    .appbar .nav-links { order: 3; width: 100%; height: 36px; }
    .balance-panel { margin: 0 -12px; }
    main.container-fluid { padding: 12px; }
}
@media print {
    body { background: #fff; }
    .entry-card, .bal-card { border: 1px solid #999; box-shadow: none; }
    .balance-panel { background: #fff !important; color: #000; margin: 0; }
}
