/* 随礼记账 — 对齐悠悠草 UI Brief / Design Tokens
 * https://yycey.cn/u/ui.html#brief
 */

@import url("tokens.css");

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-void);
    min-height: 100vh;
    padding-top: var(--nav-height);
    padding-bottom: 72px;
    -webkit-font-smoothing: antialiased;
}

body.no-app-nav {
    padding-bottom: 0;
}

body:has(.login-container) {
    padding-top: 0;
    padding-bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, color-mix(in srgb, var(--color-primary) 8%, transparent), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, color-mix(in srgb, var(--color-accent) 6%, transparent), transparent 50%),
        var(--bg-base);
}

h1, h2, h3, h4, h5, .card-title, .page-title, .navbar-brand .brand-text {
    font-family: var(--font-brand);
    font-weight: var(--font-weight-brand);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
}

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    color: var(--text-link-hover);
}

.text-muted {
    color: var(--text-tertiary) !important;
}

.text-danger,
.stat-value.text-danger {
    color: var(--color-error) !important;
}

.text-success,
.stat-value.text-success {
    color: var(--color-success) !important;
}

/* ========== Brand ========== */
.brand-gradient-text {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.gradient-rule {
    height: 2px;
    border: 0;
    background: var(--brand-gradient);
    border-radius: var(--radius-full);
    opacity: 0.85;
}

.logo-mark {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: var(--radius-logo-chip);
}

.logo-mark-lg {
    width: 48px;
    height: 48px;
}

/* ========== Top nav ========== */
.navbar {
    height: var(--nav-height);
    background: var(--glass-bg) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle) !important;
    box-shadow: none !important;
}

.navbar .container-fluid {
    max-width: var(--container-xl);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-h3);
    font-weight: var(--font-weight-brand);
    color: var(--text-primary) !important;
}

.navbar-brand .brand-text {
    font-size: 1.25rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    color: var(--text-secondary);
    font-size: var(--text-small);
}

/* ========== App nav ========== */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-subtle);
}

.nav-item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 0;
    text-decoration: none;
    color: var(--text-tertiary);
    transition: color var(--duration-normal) var(--ease-out), background var(--duration-fast) var(--ease-out);
    border-radius: var(--radius-md);
}

.nav-item-wrapper:hover {
    color: var(--color-primary);
    background: var(--color-primary-muted);
}

.nav-item-wrapper.active {
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
    background: var(--color-primary-muted);
}

.nav-item-icon {
    width: 22px;
    height: 22px;
    opacity: 0.85;
}

.nav-item-wrapper.active .nav-item-icon {
    opacity: 1;
}

.nav-item-text {
    font-size: var(--text-micro);
    text-align: center;
}

/* ========== Layout ========== */
.content-wrapper {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: var(--space-5) var(--space-4) var(--space-8);
}

.page-title {
    font-size: var(--text-h2);
    margin: 0 0 var(--space-4);
}

/* ========== Cards / surfaces ========== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
    overflow: hidden;
    transition: box-shadow var(--duration-normal) var(--ease-out);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: none;
}

.card-header {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-brand);
    font-weight: var(--font-weight-medium);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: var(--text-h3);
    margin-bottom: var(--space-4);
}

.card-body {
    padding: var(--space-5);
}

/* ========== Stat cards ========== */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-panel);
    padding: var(--space-5);
    text-align: left;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--color-primary);
}

.stat-card.danger::before { background: var(--color-error); }
.stat-card.success::before { background: var(--color-success); }
.stat-card.info::before { background: var(--color-info); }

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: none;
}

.stat-icon {
    width: 36px;
    height: 36px;
    margin: 0 0 var(--space-3);
}

.stat-label {
    font-size: var(--text-small);
    color: var(--text-tertiary);
    margin-bottom: var(--space-2);
}

.stat-value {
    font-family: var(--font-brand);
    font-size: var(--text-h2);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin: 0;
    letter-spacing: var(--tracking-tight);
}

/* ========== Buttons ========== */
.btn {
    border-radius: var(--radius-control);
    padding: 0.5rem 1.1rem;
    font-weight: var(--font-weight-medium);
    font-size: var(--text-small);
    border: 1px solid transparent;
    transition: background var(--duration-fast) var(--ease-out),
        color var(--duration-fast) var(--ease-out),
        border-color var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-fast) var(--ease-out);
}

.btn:active {
    transform: translateY(0.5px);
}

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--text-on-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--text-on-primary);
    box-shadow: var(--glow-primary);
}

.btn-success {
    background: var(--color-success);
    border-color: var(--color-success);
    color: var(--text-on-primary);
}

.btn-success:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--text-on-primary);
}

.btn-danger {
    background: var(--color-error);
    border-color: var(--color-error);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(0.95);
    color: #fff;
}

.btn-outline-primary {
    border: 1px solid var(--color-primary-border);
    color: var(--color-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--color-primary-muted);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline-secondary {
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: var(--text-micro);
}

.btn-lg {
    padding: 0.7rem 1.4rem;
    font-size: var(--text-body);
}

.btn-gradient {
    background: var(--brand-gradient);
    border: none;
    color: #fff;
}

.btn-gradient:hover {
    filter: brightness(1.03);
    color: #fff;
    box-shadow: var(--glow-brand);
}

/* ========== Forms ========== */
.form-control,
.form-select {
    border-radius: var(--radius-control);
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 0.55rem 0.85rem;
    font-size: var(--text-body);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: var(--glow-primary);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.form-label {
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    font-size: var(--text-small);
    margin-bottom: var(--space-2);
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ========== Tables ========== */
.table-responsive {
    border-radius: var(--radius-panel);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.table {
    margin-bottom: 0;
    color: var(--text-primary);
}

.table thead th {
    background: var(--bg-base);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    font-size: var(--text-small);
    border-bottom: 1px solid var(--border-default);
    padding: 0.85rem 1rem;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: var(--border-subtle);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: var(--bg-base);
}

/* ========== Progress ========== */
.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--bg-sunken);
    overflow: hidden;
}

.progress-bar {
    background: var(--color-primary);
}

.progress-bar.bg-danger {
    background: var(--color-error) !important;
}

/* ========== Alerts ========== */
.alert {
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    padding: 0.75rem 1rem;
    font-size: var(--text-small);
    font-weight: var(--font-weight-regular);
}

.alert-success {
    background: var(--color-success-bg);
    border-color: color-mix(in srgb, var(--color-success) 25%, transparent);
    color: var(--color-success);
}

.alert-danger {
    background: var(--color-error-bg);
    border-color: color-mix(in srgb, var(--color-error) 25%, transparent);
    color: var(--color-error);
}

.alert-info {
    background: var(--color-info-bg);
    border-color: color-mix(in srgb, var(--color-info) 25%, transparent);
    color: var(--color-info);
}

.alert-warning {
    background: var(--color-warning-bg);
    border-color: color-mix(in srgb, var(--color-warning) 25%, transparent);
    color: var(--color-warning);
}

/* ========== Auth / Install ========== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-6);
}

.login-card {
    max-width: 440px;
    width: 100%;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--bg-surface);
}

.login-card.install-card {
    max-width: 560px;
}

.login-header {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: var(--space-8) var(--space-6) var(--space-4);
    text-align: center;
}

.login-header h4 {
    margin: var(--space-3) 0 0;
    font-size: var(--text-h2);
}

.login-header .login-sub {
    margin: var(--space-2) 0 0;
    color: var(--text-tertiary);
    font-size: var(--text-small);
    font-family: var(--font-body);
}

.login-body {
    padding: var(--space-4) var(--space-6) var(--space-8);
    background: var(--bg-surface);
}

.install-steps {
    font-size: var(--text-small);
    color: var(--text-secondary);
}

/* ========== Chart ========== */
.chart-container {
    position: relative;
    height: 300px;
    padding: var(--space-2);
}

/* ========== Empty / toast ========== */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--text-tertiary);
}

.empty-state-text {
    font-size: var(--text-body);
    font-weight: var(--font-weight-medium);
}

.budget-progress-wrapper {
    margin-top: var(--space-2);
}

.budget-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-size: var(--text-small);
}

.budget-info-label {
    color: var(--text-tertiary);
}

.budget-info-value {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    right: 16px;
    z-index: var(--z-toast);
    max-width: 350px;
}

.toast-item {
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 10px;
    overflow: hidden;
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
}

.toast-message {
    flex: 1;
    margin-right: 1rem;
    font-size: var(--text-small);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-tertiary);
    cursor: pointer;
}

.toast-info { border-left: 3px solid var(--color-info); }
.toast-success { border-left: 3px solid var(--color-success); }
.toast-danger { border-left: 3px solid var(--color-error); }
.toast-warning { border-left: 3px solid var(--color-warning); }

.highlight-input {
    animation: highlightPulse 1s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% {
        border-color: var(--border-default);
        background: var(--bg-surface);
    }
    50% {
        border-color: var(--color-success);
        background: var(--color-success-bg);
    }
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--radius-control);
    border-bottom-left-radius: var(--radius-control);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--radius-control);
    border-bottom-right-radius: var(--radius-control);
}

.theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-control);
}

/* ========== Dark theme body sync ========== */
[data-theme="dark"] body,
body[data-theme="dark"] {
    background: var(--bg-base);
}

html[data-theme="dark"] body {
    background: var(--bg-base);
}

html[data-theme="dark"] body:has(.login-container) {
    background:
        radial-gradient(ellipse 70% 45% at 15% -5%, color-mix(in srgb, var(--color-primary) 12%, transparent), transparent 55%),
        var(--bg-base);
}

/* ========== 礼簿（参考电子礼簿竖栏） ========== */
.gift-book-list .card-title { margin-bottom: 0; }

.gift-book-dir {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 70vh;
    overflow: auto;
}

.gift-book-dir-item {
    display: block;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-base);
    color: inherit;
    transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}

.gift-book-dir-item:hover {
    border-color: var(--color-primary-border);
    background: var(--color-primary-muted);
    color: inherit;
}

.gift-book-dir-item.active {
    border-color: var(--color-primary);
    background: var(--color-primary-muted);
}

.gift-book-dir-title {
    font-family: var(--font-brand);
    font-size: var(--text-body);
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gift-book-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #888;
}

.gift-book-dir-item.is-joy .gift-book-dot { background: #c41e3a; }
.gift-book-dir-item.is-plain .gift-book-dot {
    background: #fff;
    border: 1px solid #999;
}

.gift-book-dir-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--text-micro);
    color: var(--text-tertiary);
}

/* 主题变量 */
.libu-workspace.theme-joy,
.libu-cover.theme-joy {
    --libu-bg: #ffe6ef;
    --libu-panel: #fff7fa;
    --libu-ink: #c41e3a;
    --libu-line: #e04560;
    --libu-col-bg: rgba(255, 255, 255, 0.72);
    --libu-title: #7a1f6a;
    --libu-stamp-bg: #c41e3a;
    --libu-btn: #f4c430;
    --libu-btn-text: #c41e3a;
    --libu-amt: #3b6fd8;
}

.libu-workspace.theme-plain,
.libu-cover.theme-plain {
    --libu-bg: #f3f4f6;
    --libu-panel: #ffffff;
    --libu-ink: #2a2a2a;
    --libu-line: #6b7280;
    --libu-col-bg: #ffffff;
    --libu-title: #111827;
    --libu-stamp-bg: #374151;
    --libu-btn: #e5e7eb;
    --libu-btn-text: #111827;
    --libu-amt: #2563eb;
}

/* 封面 */
.libu-cover {
    min-height: 480px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.12), transparent 40%),
        linear-gradient(160deg, #d62839 0%, #b01030 55%, #8b0a22 100%);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.libu-cover.theme-plain {
    background: linear-gradient(160deg, #f8fafc 0%, #e5e7eb 100%);
    border: 1px solid var(--border-default);
}

.libu-cover-inner {
    text-align: center;
    padding: 2rem;
    position: relative;
    width: min(420px, 100%);
}

.libu-cover-xi {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.libu-cover.theme-plain .libu-cover-xi { opacity: 0.35; filter: grayscale(1); }

.libu-cover-title {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: var(--font-brand);
    font-size: 3.5rem;
    letter-spacing: 0.35em;
    color: #f5d76e;
    text-shadow: 0 2px 0 #8a6a00, 0 8px 24px rgba(0, 0, 0, 0.25);
    margin: 0 auto 1rem;
    height: 8rem;
}

.libu-cover.theme-plain .libu-cover-title {
    color: #374151;
    text-shadow: none;
}

.libu-cover-tassel {
    position: absolute;
    right: 12px;
    top: 40px;
    height: 160px;
    opacity: 0.95;
}

.libu-cover-hint {
    color: rgba(255, 255, 255, 0.9);
    margin: 1rem 0;
    font-size: var(--text-small);
}

.libu-cover.theme-plain .libu-cover-hint { color: var(--text-secondary); }

.libu-cover-btn {
    background: var(--libu-btn, #f4c430);
    color: var(--libu-btn-text, #c41e3a);
    border: none;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
}

.libu-cover-btn:hover {
    filter: brightness(1.05);
    color: var(--libu-btn-text, #c41e3a);
}

/* 工作区 */
.libu-workspace {
    background: var(--libu-bg);
    border: 2px solid var(--libu-line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.libu-workspace-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--libu-line) 35%, transparent);
    background: color-mix(in srgb, var(--libu-panel) 80%, transparent);
}

.libu-workspace-title {
    font-family: var(--font-brand);
    font-size: var(--text-h2);
    color: var(--libu-title);
    margin: 0 0 0.25rem;
}

.libu-workspace-sub {
    color: var(--text-tertiary);
    font-size: var(--text-small);
}

.libu-btn-ghost {
    border: 1px solid var(--libu-line);
    color: var(--libu-ink);
    background: transparent;
}

.libu-workspace-body {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 300px);
    gap: 0;
    min-height: 420px;
}

.libu-ledger-wrap {
    padding: 1rem;
    overflow: hidden;
}

.libu-ledger-frame {
    position: relative;
    border: 2px solid var(--libu-line);
    background:
        radial-gradient(circle at 10% 20%, color-mix(in srgb, var(--libu-ink) 6%, transparent) 0 1px, transparent 1.5px),
        radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--libu-ink) 5%, transparent) 0 1px, transparent 1.5px),
        var(--libu-panel);
    background-size: 28px 28px, 36px 36px, auto;
    min-height: 380px;
    padding: 18px 12px 12px;
    overflow-x: auto;
}

.libu-fret {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2px solid var(--libu-line);
    pointer-events: none;
}
.libu-fret.tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.libu-fret.tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.libu-fret.bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.libu-fret.br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.libu-ledger-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-tertiary);
    font-family: var(--font-brand);
}

.libu-ledger-cols {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: max-content;
    min-width: 100%;
    padding-bottom: 4px;
}

.libu-col {
    width: 64px;
    min-height: 340px;
    background: var(--libu-col-bg);
    border: 1.5px solid var(--libu-line);
    border-radius: 10px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.libu-col-no {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    writing-mode: horizontal-tb;
}

.libu-col-name {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: var(--font-brand);
    font-size: 1.15rem;
    letter-spacing: 0.18em;
    color: #111;
    min-height: 5.5rem;
}

.libu-col-stamp {
    writing-mode: horizontal-tb;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: var(--libu-stamp-bg);
    color: #fff;
    font-family: var(--font-brand);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.libu-col-amount {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: var(--font-brand);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: #222;
    flex: 1;
    line-height: 1.35;
}

.libu-col-actions {
    writing-mode: horizontal-tb;
    opacity: 0.45;
    display: flex;
    gap: 0;
}

.libu-col:hover .libu-col-actions { opacity: 1; }

.gift-book-edit {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

/* 录入侧栏 */
.libu-entry-panel {
    background: var(--libu-panel);
    border-left: 1px solid color-mix(in srgb, var(--libu-line) 40%, transparent);
    padding: 1rem 1.1rem 1.25rem;
}

.libu-entry-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.libu-entry-tabs span {
    font-size: var(--text-small);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
}

.libu-entry-tabs span.active {
    background: color-mix(in srgb, var(--libu-ink) 12%, transparent);
    color: var(--libu-ink);
    font-weight: 600;
}

.libu-entry-tip {
    font-size: var(--text-micro);
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.libu-quick-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.libu-amt-btn {
    border: 1px solid color-mix(in srgb, var(--libu-amt) 35%, #fff);
    background: #fff;
    color: var(--libu-amt);
    border-radius: 8px;
    padding: 0.45rem 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.libu-amt-btn:hover {
    background: color-mix(in srgb, var(--libu-amt) 10%, #fff);
}

.libu-btn-add {
    background: var(--libu-btn);
    color: var(--libu-btn-text);
    border: none;
    font-weight: 700;
    padding: 0.7rem 1rem;
    font-size: 1rem;
}

.libu-btn-add:hover {
    filter: brightness(1.04);
    color: var(--libu-btn-text);
}

@media (max-width: 991px) {
    .libu-workspace-body {
        grid-template-columns: 1fr;
    }

    .libu-entry-panel {
        border-left: none;
        border-top: 1px solid color-mix(in srgb, var(--libu-line) 40%, transparent);
    }

    .libu-col {
        width: 56px;
        min-height: 280px;
    }
}

/* ========== Responsive ========== */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }

    .app-nav {
        position: sticky;
        top: var(--nav-height);
        bottom: auto;
        border-top: none;
        border-bottom: 1px solid var(--border-subtle);
        margin-bottom: 0;
    }

    .nav-item-wrapper {
        flex-direction: row;
        gap: 8px;
        padding: 0.75rem;
        justify-content: center;
    }

    .nav-item-icon {
        width: 18px;
        height: 18px;
    }

    .nav-item-text {
        font-size: var(--text-small);
    }

    .chart-container {
        height: 380px;
    }

    .content-wrapper {
        padding-top: var(--space-6);
    }
}

@media (max-width: 767px) {
    .stat-value {
        font-size: var(--text-h3);
    }

    .stat-icon {
        width: 28px;
        height: 28px;
    }

    .card-body {
        padding: var(--space-4);
    }

    .table {
        font-size: var(--text-small);
    }

    .table td,
    .table th {
        padding: 0.65rem 0.5rem;
    }

    .toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .user-name {
        display: none !important;
    }

    .gift-book-dir {
        max-height: none;
    }
}
