:root {
    --bg: #07080d;
    --bg-elevated: rgba(14, 18, 28, 0.72);
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8edf4;
    --text-dim: #8b96a8;
    --accent: #3dff9a;
    --accent-2: #5b8cff;
    --danger: #ff4d6d;
    --warning: #ffc857;
    --success: #3dff9a;
    --process: #4dd4ff;
    --radius: 14px;
    --radius-sm: 8px;
    --font: "DM Sans", system-ui, sans-serif;
    --mono: "JetBrains Mono", monospace;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --nav-h: 64px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

html {
    overflow-y: auto;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-y: auto;
}

.bg-mesh {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 40% at 10% 0%, rgba(61, 255, 154, 0.12), transparent 55%),
        radial-gradient(ellipse 50% 35% at 90% 10%, rgba(91, 140, 255, 0.14), transparent 50%),
        radial-gradient(ellipse 40% 30% at 50% 100%, rgba(255, 77, 109, 0.06), transparent 45%);
    z-index: 0;
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

/* --- Preloader --- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: var(--bg);
    transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.preloader--done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader__orb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-right-color: var(--accent-2);
    animation: spin 0.9s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.preloader__title {
    font-family: var(--mono);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    text-align: center;
}

.preloader__title span { color: var(--accent-2); }

.navbar__logo-text em {
    font-style: normal;
    color: var(--accent-2);
}

.preloader__status {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: var(--nav-h);
    margin: 0 -1.25rem;
    padding: 0.65rem 1.25rem;
    background: rgba(7, 8, 13, 0.75);
    backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

.navbar__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: auto;
}

.navbar__logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.navbar__logo-text {
    font-family: var(--mono);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.navbar__logo-text em {
    font-style: normal;
    color: var(--accent);
}

.navbar__tabs {
    display: flex;
    gap: 0.2rem;
    padding: 0.25rem;
    max-width: min(52vw, 520px);
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.navbar__tabs::-webkit-scrollbar { display: none; }

.tab {
    position: relative;
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.2s var(--ease);
}

.tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.tab.is-active {
    color: #04120a;
    background: linear-gradient(135deg, var(--accent), #2ee88a);
    box-shadow: 0 4px 22px rgba(61, 255, 154, 0.4);
    transform: translateY(-1px);
}

.tab__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 4px;
    background: var(--danger);
    border-radius: 50%;
    vertical-align: middle;
    animation: pulse 1.5s ease infinite;
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.ledger-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.stat-chip {
    font-size: 0.72rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.stat-chip--filter {
    font: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.stat-chip--filter:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.stat-chip--filter.is-active {
    background: rgba(61, 255, 154, 0.15);
    border-color: rgba(61, 255, 154, 0.4);
    color: var(--accent);
}

.stat-chip strong {
    color: var(--text);
    margin-left: 0.25rem;
}

.stat-chip--filter.is-active strong,
.stat-chip--total strong { color: inherit; }

.stat-chip--total:not(.is-active) strong { color: var(--accent-2); }
.stat-chip--sum strong { color: var(--accent); font-family: var(--mono); }

.ledger-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ledger-search {
    position: relative;
    flex: 1 1 200px;
    min-width: 160px;
}

.ledger-search input {
    width: 100%;
    padding-right: 2rem;
}

.ledger-kbd {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.ledger-sort {
    font: inherit;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: var(--text);
}

.ledger-auto {
    font-size: 0.72rem;
    gap: 0.35rem;
}

#btn-filter-pinned.is-active {
    color: #ffc98a;
    border-color: rgba(255, 180, 80, 0.5);
}

.profile-balance {
    font-family: var(--mono);
    font-size: 2rem;
    color: var(--accent);
    margin: 0.5rem 0 0.75rem;
}

.balance-pill {
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(61, 255, 154, 0.14), rgba(46, 232, 138, 0.06));
    border: 1px solid rgba(61, 255, 154, 0.38);
    color: var(--accent);
}

.balance-pill--link {
    cursor: pointer;
    font: inherit;
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.balance-pill--link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(61, 255, 154, 0.2);
}

.user-chip {
    font-size: 0.78rem;
    color: var(--text-dim);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
}

.icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s var(--ease), border-color 0.2s;
}

.icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(61, 255, 154, 0.4);
}

.icon-btn__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    background: linear-gradient(180deg, #ff6b7a, var(--danger));
    color: #fff;
    border-radius: 9px;
    border: 2px solid var(--bg);
    box-shadow: 0 2px 10px rgba(255, 77, 109, 0.55);
    animation: badge-pop 0.35s var(--ease);
}

.icon-btn__badge:not(.hidden) {
    animation: badge-pop 0.35s var(--ease), badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(255, 77, 109, 0.55); }
    50% { box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.25); }
}

.notify-wrap { position: relative; }

.popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(360px, 92vw);
    background: linear-gradient(165deg, rgba(28, 34, 48, 0.98), rgba(18, 22, 32, 0.98));
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: calc(var(--radius) + 2px);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(61, 255, 154, 0.08) inset;
    animation: pop-in 0.28s var(--ease);
    z-index: 200;
    overflow: hidden;
}

.popover::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(61, 255, 154, 0.5), transparent);
}

@keyframes pop-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.popover__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.popover__body {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.55rem;
    scrollbar-width: thin;
}

.popover__item {
    padding: 0.55rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    transition: background 0.2s var(--ease);
}

.popover__item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.popover__item--new {
    background: rgba(61, 255, 154, 0.1);
    border: 1px solid rgba(61, 255, 154, 0.22);
}

.popover__item-row {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
}

.popover__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 0.35rem;
    border-radius: 50%;
    background: var(--text-dim);
    opacity: 0.35;
}

.popover__item--new .popover__dot {
    background: var(--accent);
    opacity: 1;
    box-shadow: 0 0 8px rgba(61, 255, 154, 0.7);
}

.popover__item-text { min-width: 0; flex: 1; }

.popover__item time {
    display: block;
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.popover__item p {
    margin: 0;
    line-height: 1.45;
    color: #e2eaf4;
}

.popover__empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.link-btn {
    border: none;
    background: none;
    color: var(--accent-2);
    font-size: 0.72rem;
    cursor: pointer;
}

.hidden { display: none !important; }

/* --- Views --- */
.main {
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
    min-height: 0;
}

.view {
    display: none;
    animation: view-in 0.4s var(--ease);
    overflow: visible;
}

.view.is-active {
    display: block;
    overflow: visible;
}

#view-profile {
    padding-bottom: 2rem;
}

@keyframes view-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* --- Glass panels --- */
.glass {
    background: var(--bg-elevated);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
}

.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.panel__head--row { flex-wrap: wrap; }

.panel__head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.panel__tag {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.panel-grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hint {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.count-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
    font-family: var(--mono);
    background: rgba(91, 140, 255, 0.2);
    border-radius: 999px;
    color: var(--accent-2);
}

/* --- Sandbox bar --- */
.sandbox-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sandbox-bar__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.sandbox-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sandbox-pill {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.22s var(--ease);
}

.sandbox-pill:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }

.sandbox-pill.is-active {
    color: #04120a;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(61, 255, 154, 0.3);
}

.sandbox-bar--single .sandbox-pill {
    cursor: default;
    pointer-events: none;
}

/* --- Forms --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}

.form-stack { display: flex; flex-direction: column; gap: 0.75rem; }

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: 0.3rem; }

.field--full { grid-column: 1 / -1; }

.field--grow { flex: 1; min-width: 140px; }

.field__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

input, select, textarea {
    font: inherit;
    font-size: 0.88rem;
    color: var(--text);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.7rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: rgba(61, 255, 154, 0.5);
    box-shadow: 0 0 0 3px rgba(61, 255, 154, 0.12);
}

.btn {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
    color: #04120a;
    background: linear-gradient(135deg, var(--accent), #2ee88a);
    box-shadow: 0 6px 24px rgba(61, 255, 154, 0.25);
}

.btn--accent {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-2), #7b5cff);
}

.btn--ghost {
    color: var(--text-dim);
    background: transparent;
    border-color: var(--border);
}

.btn--ghost:hover { color: var(--text); }

.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

.wallet-preview {
    margin: 0;
    font-size: 0.78rem;
    font-family: var(--mono);
    color: var(--accent);
    word-break: break-all;
}

.wallet-preview--warn { color: var(--warning); }

/* --- Records --- */
.records {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.record {
    padding: 0.6rem 0.75rem 0.55rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.card-rise {
    animation: rise 0.45s var(--ease) backwards;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.record--new {
    animation: rise 0.5s var(--ease), glow-new 1.2s ease;
}

@keyframes glow-new {
    0% { box-shadow: 0 0 0 rgba(61, 255, 154, 0); }
    40% { box-shadow: 0 0 30px rgba(61, 255, 154, 0.35); }
    100% { box-shadow: none; }
}

.record__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.62rem;
    color: var(--text-dim);
    line-height: 1.3;
}

.record__pin {
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.2rem;
    line-height: 1;
}

.record__pin.is-active { color: #ffc98a; }

.record__actions {
    display: flex;
    gap: 0.2rem;
    margin-left: auto;
}

.record__action {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-dim);
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    font: inherit;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.record__action:hover {
    color: var(--text);
    border-color: rgba(61, 255, 154, 0.35);
}

.record__action--danger:hover {
    color: var(--danger);
    border-color: rgba(255, 77, 109, 0.45);
}

.record--pinned {
    border-color: rgba(255, 180, 80, 0.45) !important;
    box-shadow: 0 0 0 1px rgba(255, 180, 80, 0.12);
}

.record__id {
    font-family: var(--mono);
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

.record__sandbox {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(91, 140, 255, 0.12);
    color: var(--accent-2);
    font-family: var(--mono);
    font-size: 0.58rem;
}

.record__meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    flex: 1 1 auto;
}

.record__meta strong {
    color: #9eb4cc;
    font-weight: 500;
}

.record__meta em {
    font-style: normal;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 12rem;
}

.record__meta-sep {
    opacity: 0.45;
}

.record__time {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.58rem;
    white-space: nowrap;
}

.record__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem 0.55rem;
    margin-bottom: 0.45rem;
}

.record__cell {
    min-width: 0;
    font-size: 0.78rem;
    line-height: 1.25;
}

.record__cell span {
    display: block;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-dim);
    margin-bottom: 0.1rem;
}

.record__cell strong {
    display: block;
    font-weight: 500;
    color: #dce6f0;
    word-break: break-word;
}

.amount-stack {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.record__cell--sum strong {
    font-family: var(--mono);
    color: var(--accent);
    font-size: 0.9rem;
    line-height: 1.2;
}

.amount-usd.hidden {
    display: none;
}

.amount-usd,
.stat-chip__usd {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 400;
    color: rgba(232, 237, 244, 0.42);
    letter-spacing: 0.02em;
}

.stat-chip--sum {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
}

.stat-chip--sum strong {
    color: var(--accent);
    font-family: var(--mono);
}

.stat-chip--sum .stat-chip__usd {
    font-size: 0.72rem;
}

.record__ago {
    font-size: 0.58rem;
    color: rgba(139, 150, 168, 0.75);
    margin-left: 0.35rem;
    white-space: nowrap;
}

.record--expanded .record__grid,
.record--expanded .record__foot {
    box-shadow: inset 0 0 0 1px rgba(61, 255, 154, 0.12);
}

.record--expanded {
    border-color: rgba(61, 255, 154, 0.28);
}

#btn-refresh-records.is-spinning {
    animation: spin 0.9s linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

.ledger-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.68rem;
    color: var(--text-dim);
}

.ledger-footer__rate {
    font-family: var(--mono);
    color: rgba(139, 150, 168, 0.85);
}

/* --- Chip switch (чекбоксы журнала) --- */
.chip-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
}

.chip-switch--inline {
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.chip-switch--sm {
    gap: 0;
    margin-right: 0.15rem;
}

.chip-switch--sm .chip-switch__track {
    width: 32px;
    height: 18px;
}

.chip-switch--sm .chip-switch__thumb {
    width: 12px;
    height: 12px;
    top: 2px;
    left: 2px;
}

.chip-switch--sm .chip-switch__input:checked + .chip-switch__track .chip-switch__thumb {
    transform: translateX(14px);
}

.chip-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.chip-switch__track {
    flex-shrink: 0;
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.chip-switch__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #b8c4d4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: transform 0.22s var(--ease), background 0.22s;
}

.chip-switch__input:checked + .chip-switch__track {
    background: linear-gradient(135deg, var(--accent-2), #6b9fff);
    border-color: rgba(91, 140, 255, 0.55);
    box-shadow: 0 0 12px rgba(91, 140, 255, 0.3);
}

.chip-switch__input:checked + .chip-switch__track .chip-switch__thumb {
    transform: translateX(16px);
    background: #fff;
}

.chip-switch--inline .chip-switch__input:checked + .chip-switch__track {
    background: linear-gradient(135deg, var(--accent), #2ee88a);
    border-color: rgba(61, 255, 154, 0.45);
    box-shadow: 0 0 12px rgba(61, 255, 154, 0.28);
}

.chip-switch__label {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.chip-switch__label strong {
    color: var(--accent-2);
    font-weight: 600;
}

.chip-switch:hover .chip-switch__track {
    border-color: rgba(255, 255, 255, 0.22);
}

.ledger-bulk__check .chip-switch__label strong {
    margin-left: 0.15rem;
}

#btn-filter-priority.is-active {
    color: var(--warning);
    border-color: rgba(255, 200, 87, 0.5);
}

.shortcuts-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-size: 0.88rem;
}

.shortcuts-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.shortcuts-list kbd {
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    min-width: 1.5rem;
    text-align: center;
}

/* --- Global chat --- */
.global-chat {
    position: fixed;
    right: 1.15rem;
    bottom: 1.15rem;
    z-index: 5500;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    pointer-events: none;
}

.global-chat__fab,
.global-chat__panel {
    pointer-events: auto;
}

.global-chat__fab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(91, 140, 255, 0.45);
    background: linear-gradient(135deg, rgba(28, 36, 52, 0.98), rgba(14, 18, 28, 0.98));
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.global-chat__fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(91, 140, 255, 0.25);
}

.global-chat__fab[aria-expanded="true"] {
    border-color: rgba(61, 255, 154, 0.5);
}

.global-chat__fab-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.global-chat__badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
}

.global-chat__panel {
    width: min(340px, calc(100vw - 2rem));
    height: min(420px, calc(100vh - 6rem));
    display: flex;
    flex-direction: column;
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    animation: chat-in 0.28s var(--ease);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

@keyframes chat-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.global-chat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.global-chat__head strong {
    display: block;
    font-size: 0.88rem;
}

.global-chat__sub {
    display: block;
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 0.1rem;
}

.global-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    scrollbar-width: thin;
}

.global-chat__msg {
    max-width: 92%;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    line-height: 1.4;
}

.global-chat__msg--own {
    align-self: flex-end;
    background: rgba(91, 140, 255, 0.15);
    border-color: rgba(91, 140, 255, 0.28);
}

.global-chat__msg-user {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-2);
    margin-bottom: 0.15rem;
}

.global-chat__msg--own .global-chat__msg-user {
    color: var(--accent);
}

.global-chat__msg time {
    display: block;
    font-size: 0.58rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

.global-chat__form {
    display: flex;
    gap: 0.4rem;
    padding: 0.6rem;
    border-top: 1px solid var(--border);
}

.global-chat__form input {
    flex: 1;
    min-width: 0;
}

.global-chat__empty {
    margin: auto;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.78rem;
    padding: 1rem;
}

.record__cell--wide {
    grid-column: 1 / -1;
    padding-top: 0.15rem;
}

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

.record__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    align-items: flex-end;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.record__foot .field--compact {
    gap: 0.15rem;
    min-width: 0;
}

.record__foot .field--compact:first-child {
    flex: 0 0 auto;
    min-width: 7.5rem;
}

.record__foot .field__label {
    font-size: 0.55rem;
    letter-spacing: 0.06em;
}

.record__foot .status-select,
.record__foot .comment-input,
.record__foot .sandbox-move-select {
    padding: 0.32rem 0.45rem;
    font-size: 0.75rem;
    min-height: 1.85rem;
}

.record__foot .comment-input {
    min-width: 6rem;
}

.record--srez {
    border-color: rgba(255, 77, 109, 0.5);
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.15);
}

.record--paid { opacity: 0.55; border-color: rgba(61, 255, 154, 0.35); }

.record--process {
    border-color: rgba(77, 212, 255, 0.5);
    animation: process-glow 2.5s ease-in-out infinite;
}

@keyframes process-glow {
    0%, 100% { box-shadow: 0 0 12px rgba(77, 212, 255, 0.2); }
    50% { box-shadow: 0 0 28px rgba(77, 212, 255, 0.35); }
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* --- User cards --- */
.user-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.user-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.65rem 1rem;
    padding: 1.1rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.25s var(--ease), border-color 0.25s;
}

.user-card:hover {
    transform: translateY(-3px);
    border-color: rgba(61, 255, 154, 0.35);
}

.user-card__avatar {
    grid-row: span 2;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-2), #7b5cff);
    color: #fff;
}

.user-card__body h3 {
    margin: 0;
    font-size: 1rem;
}

.user-card__balance {
    margin: 0.2rem 0;
    font-family: var(--mono);
    color: var(--accent);
    font-size: 0.95rem;
}

.user-card__meta, .user-card__wallet {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-dim);
}

.user-card__wallet code, .user-card__meta code {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--accent-2);
}

.user-card__actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-card__perms {
    margin: 0.15rem 0 0;
    font-size: 0.68rem;
    color: var(--accent-2);
}

.perm-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.hint--perms {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.72rem;
    color: var(--text-dim);
}

.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.55rem;
    margin: 0.65rem 0 0.85rem;
}

.perm-switch {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.perm-switch:hover {
    border-color: rgba(61, 255, 154, 0.28);
    background: rgba(61, 255, 154, 0.05);
}

.perm-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.perm-switch__track {
    flex-shrink: 0;
    position: relative;
    width: 42px;
    height: 24px;
    margin-top: 0.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s;
}

.perm-switch__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c5d0dc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.perm-switch__input:checked + .perm-switch__track {
    background: linear-gradient(135deg, var(--accent), #2ee88a);
    border-color: rgba(61, 255, 154, 0.5);
    box-shadow: 0 0 16px rgba(61, 255, 154, 0.35);
}

.perm-switch__input:checked + .perm-switch__track .perm-switch__thumb {
    transform: translateX(18px);
    background: #04120a;
}

.perm-switch__input:focus-visible + .perm-switch__track {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

.perm-switch__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.perm-switch__text strong {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.perm-switch__text em {
    font-size: 0.68rem;
    font-style: normal;
    color: var(--text-dim);
    line-height: 1.35;
}

.sandbox-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.sandbox-check-grid--inline {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.sandbox-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.22);
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.sandbox-check:hover {
    border-color: rgba(91, 140, 255, 0.35);
    background: rgba(91, 140, 255, 0.06);
}

.sandbox-check__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.sandbox-check__box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.05rem;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.35);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.sandbox-check--radio .sandbox-check__box {
    border-radius: 50%;
}

.sandbox-check__input:checked + .sandbox-check__box {
    background: linear-gradient(135deg, rgba(91, 140, 255, 0.5), rgba(61, 255, 154, 0.35));
    border-color: rgba(91, 140, 255, 0.7);
    box-shadow: 0 0 12px rgba(91, 140, 255, 0.35);
}

.sandbox-check__input:checked + .sandbox-check__box::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -58%) rotate(45deg);
}

.sandbox-check--radio .sandbox-check__input:checked + .sandbox-check__box::after {
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: #04120a;
    transform: translate(-50%, -50%);
}

.sandbox-check__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.sandbox-check__text strong {
    font-size: 0.8rem;
    color: var(--text);
}

.sandbox-check__text em {
    font-size: 0.65rem;
    font-style: normal;
    color: var(--text-dim);
    font-family: var(--mono);
}

.toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.toggle input {
    width: auto;
    accent-color: var(--accent);
}

.sandbox-admin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.sandbox-admin-card {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sandbox-admin-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sandbox-admin-card__head h3 {
    margin: 0;
    font-size: 1rem;
}

.sandbox-admin-card__head code {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent-2);
}

.record__cell--hidden {
    display: none !important;
}

.record__cell--masked > span {
    color: rgba(255, 180, 80, 0.75);
}

.record__value--cipher {
    font-family: var(--mono);
    font-size: 0.72rem !important;
    letter-spacing: 0.06em;
    color: rgba(168, 196, 255, 0.85) !important;
    user-select: none;
}

.perm-hint {
    font-size: 0.72rem;
    margin-left: 0.5rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 180, 80, 0.12);
    border: 1px solid rgba(255, 180, 80, 0.28);
    color: #ffc98a;
}

.status-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.observer-badge {
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(91, 140, 255, 0.2);
    color: var(--accent-2);
    border: 1px solid rgba(91, 140, 255, 0.35);
}

.observer-banner {
    padding: 1rem;
    border-color: rgba(91, 140, 255, 0.35);
    color: var(--accent-2);
    font-size: 0.9rem;
}

body.is-observer .record__foot .comment-input {
    display: none;
}

/* News */
.news-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.news-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.25);
}

.news-card__cover {
    height: 140px;
    background-size: cover;
    background-position: center;
}

.news-card__body { padding: 1rem; }

.news-card__body h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }

.news-card__meta {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    color: var(--text-dim);
}

.news-card__excerpt {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    max-height: 4.5em;
    overflow: hidden;
}

.prose img { max-width: 100%; border-radius: 8px; }

.prose a { color: var(--accent-2); }

.news-editor { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

#quill-editor, #terms-quill {
    min-height: 200px;
    background: #0a0e14;
    color: var(--text);
    border-radius: var(--radius-sm);
}

.ql-toolbar.ql-snow, .ql-container.ql-snow {
    border-color: var(--border) !important;
    background: #0a0e14;
}

.ql-editor { min-height: 180px; }

.news-article { max-height: 60vh; overflow-y: auto; }

.faq-edit-row {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.faq-a {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
}

/* --- Withdrawals & activity --- */
.withdrawals-list { display: flex; flex-direction: column; gap: 0.6rem; }

.withdrawal-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.8rem;
}

.withdrawal-row__info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}

.withdrawal-row code {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
}

.activity-log {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.activity-row {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.5rem 0.75rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.activity-row time { color: var(--text-dim); font-family: var(--mono); font-size: 0.65rem; }

.activity-row__user { color: var(--accent); }

/* --- Modal --- */
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.modal-root:not(.hidden) { animation: fade-in 0.25s var(--ease); }

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.modal {
    position: relative;
    width: min(440px, 100%);
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(61, 255, 154, 0.06) inset;
    animation: modal-in 0.32s var(--ease);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to { opacity: 1; transform: none; }
}

.modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.modal__head h3 { margin: 0; font-size: 1rem; }

.modal__body { padding: 1.15rem; }

.modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.15rem;
    border-top: 1px solid var(--border);
}

.modal__close {
    font-size: 1.25rem;
    line-height: 1;
}

/* --- Toast --- */
.toast-root {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 6000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.8rem 1.05rem;
    max-width: min(360px, 90vw);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.4;
    background: rgba(16, 20, 30, 0.96);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
    pointer-events: auto;
}

.toast--show {
    opacity: 1;
    transform: none;
}

.toast--success {
    border-color: rgba(61, 255, 154, 0.5);
    color: var(--accent);
    background: linear-gradient(135deg, rgba(61, 255, 154, 0.12), rgba(16, 20, 30, 0.96));
}

.toast--info {
    border-color: rgba(91, 140, 255, 0.45);
    color: #a8c4ff;
    background: linear-gradient(135deg, rgba(91, 140, 255, 0.14), rgba(16, 20, 30, 0.96));
}

.toast--error {
    border-color: rgba(255, 77, 109, 0.5);
    color: var(--danger);
    background: linear-gradient(135deg, rgba(255, 77, 109, 0.1), rgba(16, 20, 30, 0.96));
}

/* --- Login --- */
body.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-box {
    width: min(400px, 100%);
    padding: 2rem;
    animation: modal-in 0.5s var(--ease);
}

.login-box__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.login-box__head h1 {
    margin: 0;
    font-family: var(--mono);
    font-size: 1.2rem;
}

.login-box__head .accent { color: var(--accent); font-style: normal; }

.login-box__sub {
    margin: 0 0 1.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
}

.login-box__error {
    padding: 0.6rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 77, 109, 0.12);
    border: 1px solid rgba(255, 77, 109, 0.35);
    color: var(--danger);
    font-size: 0.85rem;
}

.login-form { display: flex; flex-direction: column; gap: 0.85rem; }

.btn--block { width: 100%; }

/* --- Finance profile --- */
.finance-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(61, 255, 154, 0.08), rgba(91, 140, 255, 0.06));
    border: 1px solid rgba(61, 255, 154, 0.2);
}

.finance-hero__label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

.finance-hero__balance {
    font-family: var(--mono);
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    color: var(--accent);
    margin: 0 0 0.5rem;
    line-height: 1.1;
}

.panel-grid--profile {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel--wide { grid-column: 1 / -1; }

#wallet-panel { scroll-margin-top: calc(var(--nav-h) + 1rem); }

.withdraw-history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
}

.withdraw-history__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

.withdraw-history__status {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-left: 0.5rem;
}

.withdraw-history__status--pending {
    background: rgba(255, 200, 87, 0.15);
    color: var(--warning);
}

.withdraw-history__status--approved {
    background: rgba(61, 255, 154, 0.12);
    color: var(--accent);
}

.withdraw-history__status--rejected {
    background: rgba(255, 77, 109, 0.12);
    color: var(--danger);
}

.withdraw-history__done {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* --- Ledger extras --- */
.ledger-date input {
    font: inherit;
    font-size: 0.72rem;
    padding: 0.35rem 0.45rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: var(--text);
    max-width: 9.5rem;
}

.ledger-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(91, 140, 255, 0.08);
    border: 1px dashed rgba(91, 140, 255, 0.35);
}

.ledger-bulk__check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.ledger-search--inline {
    flex: 0 1 220px;
    min-width: 140px;
}

#record-form-panel.is-collapsed .panel__head {
    margin-bottom: 0;
}

body.ledger-compact .record {
    padding: 0.55rem 0.7rem;
}

body.ledger-compact .record__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem 0.6rem;
    font-size: 0.78rem;
}

body.ledger-compact .record__foot {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
}

.record--priority-high {
    border-color: rgba(255, 200, 87, 0.45);
    box-shadow: inset 3px 0 0 var(--warning);
}

.record__priority {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
    background: rgba(255, 200, 87, 0.2);
    color: var(--warning);
}

.record__bulk-check {
    display: inline-flex;
    align-items: center;
    margin-right: 0.2rem;
}

.withdrawal-row__wallet {
    display: block;
    max-width: 100%;
    font-size: 0.72rem;
    word-break: break-all;
    color: var(--text-dim);
    margin: 0.2rem 0;
}

.user-card__wallet--empty {
    color: var(--warning);
    font-size: 0.75rem;
}

#btn-compact-records.is-active {
    color: var(--accent-2);
    border-color: rgba(91, 140, 255, 0.5);
}

@media (max-width: 900px) {
    .navbar { gap: 0.5rem; }
    .navbar__tabs { order: 3; width: 100%; overflow-x: auto; }
    .navbar__brand { margin-right: 0; }
    .finance-hero { grid-template-columns: 1fr; }
}
