/* ══════════════════════════════════════════════════════════════════════════════
   Blog — content styles only (layout is in /static/css/layout.css)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --bg-main: #F8F9FA;
    --bg-card: #FFFFFF;
    --bg-hover: #F1F3F5;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --text-muted: #ADB5BD;
    --accent: #007BFF;
    --accent-hover: #0056b3;
    --accent-light: #E7F1FF;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --border: #DEE2E6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    --bg-main: #121212;
    --bg-card: #1E1E1E;
    --bg-hover: #2A2A2A;
    --text-primary: #E0E0E0;
    --text-secondary: #A0A0A0;
    --text-muted: #666666;
    --accent: #3391FF;
    --accent-hover: #007BFF;
    --accent-light: #1A2744;
    --border: #333333;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), border var(--transition), box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    display: flex; align-items: center; gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.card-header .material-icons-outlined { color: var(--accent); font-size: 1.3rem; }
.card-header h2 { font-size: 1.05rem; font-weight: 600; }

.page-title {
    font-size: 1.5rem; font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ── Feed ──────────────────────────────────────────────────────────────────── */
.feed-container { max-width: 780px; margin: 0 auto; }
.feed-header { text-align: center; margin-bottom: 2rem; }
.feed-title { font-size: 1.75rem; font-weight: 700; }
.feed-subtitle { color: var(--text-secondary); margin-top: 0.5rem; }

.posts-grid { display: flex; flex-direction: column; gap: 1.5rem; }

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.post-media { width: 100%; max-height: 400px; overflow: hidden; position: relative; }
.post-media img, .post-media video { width: 100%; height: auto; object-fit: cover; display: block; }
.post-media.post-audio { max-height: none; padding: 1rem; }
.post-media audio { width: 100%; }

.media-count {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: rgba(0,0,0,0.6); color: #fff;
    font-size: 0.75rem; font-weight: 600;
    padding: 0.2rem 0.5rem; border-radius: var(--radius-xs);
}

.media-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.75rem; padding: 2rem;
    background: var(--bg-hover); border: 2px dashed var(--border);
    border-radius: var(--radius); cursor: pointer;
    margin-bottom: 1.5rem; transition: all var(--transition);
}
.media-placeholder:hover { border-color: var(--accent); background: var(--bg-card); }
.media-placeholder .material-icons-outlined { font-size: 2.5rem; color: var(--text-muted); }
.media-placeholder p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; }

.media-placeholder-small {
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem; background: var(--bg-hover);
    border: 1px dashed var(--border); border-radius: var(--radius) var(--radius) 0 0;
}
.media-placeholder-small .material-icons-outlined { font-size: 1.5rem; color: var(--text-muted); }

.post-body { padding: 1.25rem 1.5rem; }

.post-meta {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.post-date { font-size: 0.82rem; color: var(--text-muted); }

.paywall-badge {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-xs);
}
.paywall-badge.full { background: #FEE2E2; color: var(--danger); }
.paywall-badge.partial { background: #FEF3C7; color: #92400E; }
body.dark-mode .paywall-badge.full { background: #3B1A1A; }
body.dark-mode .paywall-badge.partial { background: #3B2F1A; }

.post-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; }
.post-title a { color: var(--text-primary); }
.post-title a:hover { color: var(--accent); }

.post-content {
    font-size: 0.92rem; color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    overflow: hidden;
    max-height: 120px;
}

.post-paywall-action {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.paywall-text { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; }

/* Loading skeleton */
.loading-indicator { display: flex; flex-direction: column; gap: 1.5rem; }

.skeleton-card {
    height: 180px;
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.no-posts, .end-message {
    text-align: center; padding: 3rem;
    color: var(--text-muted);
}
.no-posts .material-icons-outlined { font-size: 3rem; margin-bottom: 1rem; display: block; }

/* ── Single Post ──────────────────────────────────────────────────────────── */
.single-post { max-width: 780px; margin: 0 auto; }
.back-link {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.88rem; color: var(--text-secondary);
    margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--accent); }

.post-header { margin-bottom: 1.5rem; }
.post-header h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.5rem; }

.post-media-gallery {
    display: flex; flex-direction: column; gap: 1rem;
    margin-bottom: 1.5rem;
}
.post-media-item { width: 100%; border-radius: var(--radius-sm); }
.post-audio-item { width: 100%; margin: 0.5rem 0; }
.post-document-link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem; background: var(--bg-hover);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--accent); text-decoration: none; font-size: 0.9rem;
    transition: all var(--transition);
}
.post-document-link:hover { background: var(--bg-card); border-color: var(--accent); }

.post-full-content {
    font-size: 0.95rem; line-height: 1.8;
    white-space: pre-wrap;
}

.paywall-overlay {
    text-align: center; padding: 3rem 1.5rem;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
    margin-top: -3rem;
    position: relative;
}
.paywall-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    display: inline-block;
    box-shadow: var(--shadow-md);
}
.paywall-icon { font-size: 2.5rem; color: var(--accent); margin-bottom: 0.75rem; }

/* ── Auth ──────────────────────────────────────────────────────────────────── */
.auth-container {
    display: flex; justify-content: center; align-items: center;
    min-height: calc(100vh - 4rem);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    max-width: 420px; width: 100%;
    box-shadow: var(--shadow-md);
}
.auth-icon .material-icons-outlined { font-size: 3rem; color: var(--accent); }
.auth-card h1 { font-size: 1.3rem; margin: 1rem 0 0.5rem; }
.auth-subtitle { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 1.5rem; }

.google-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    width: 100%; padding: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition);
    cursor: pointer;
}
.google-btn:hover { box-shadow: var(--shadow-md); background: var(--bg-hover); color: var(--text-primary); }

.auth-footer { font-size: 0.78rem; color: var(--text-muted); margin-top: 1.5rem; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius-xs); margin-bottom: 1rem; font-size: 0.88rem; }
.alert-error { background: #FEE2E2; color: var(--danger); border: 1px solid #FECACA; }
body.dark-mode .alert-error { background: #3B1A1A; border-color: #5B2A2A; }

/* ── Cabinet ──────────────────────────────────────────────────────────────── */
.cabinet-container { max-width: 780px; margin: 0 auto; }

.profile-info { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-row { display: flex; gap: 0.5rem; }
.profile-row .label { font-weight: 600; min-width: 80px; }
.profile-row .value { color: var(--text-secondary); }

.balance-display {
    display: flex; align-items: baseline; gap: 0.5rem;
    margin-bottom: 1rem;
}
.balance-amount { font-size: 2rem; font-weight: 700; color: var(--accent); }
.balance-currency { font-size: 1rem; color: var(--text-muted); }

.list-container { margin-top: 0.5rem; }
.transactions-table-wrap { overflow-x: auto; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}
.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px; width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
    max-height: 90vh; overflow-y: auto;
}
.modal-card.modal-lg { max-width: 700px; }
.modal-close {
    position: absolute; top: 0.75rem; right: 1rem;
    background: none; border: none; cursor: pointer;
    font-size: 1.5rem; color: var(--text-muted);
    line-height: 1;
}
.modal-card h3 { font-size: 1.15rem; margin-bottom: 1.25rem; }

.qr-img { max-width: 250px; margin: 1rem auto; display: block; border-radius: var(--radius-sm); }
.topup-status { text-align: center; color: var(--text-secondary); }
.success-icon { text-align: center; }
.success-icon .material-icons-outlined { font-size: 3rem; color: var(--success); }

/* ── Subs Grid ─────────────────────────────────────────────────────────────── */
.subs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.sub-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    transition: box-shadow var(--transition);
}
.sub-card:hover { box-shadow: var(--shadow-md); }
.sub-card h4 { margin-bottom: 0.5rem; }
.sub-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.sub-price { font-weight: 700; color: var(--accent); margin-bottom: 0.75rem; }

/* ── Admin ─────────────────────────────────────────────────────────────────── */
.admin-container { max-width: 1000px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon { font-size: 1.5rem; color: var(--accent); margin-bottom: 0.5rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* ── Fincenter ─────────────────────────────────────────────────────────────── */
.fin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.fin-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.fin-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fin-label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.fin-value { font-size: 1.3rem; font-weight: 700; margin-top: 0.5rem; }
.fin-card.emission { background: #E7F1FF; border-color: #B8D4FE; }
.fin-card.credit { background: #FEF3C7; border-color: #FDE68A; }
.fin-card.debit { background: #D1FAE5; border-color: #A7F3D0; }
.fin-card.frozen { background: #E0E7FF; border-color: #C7D2FE; }
.fin-card.remainder { background: #F0FDF4; border-color: #BBF7D0; }
body.dark-mode .fin-card.emission { background: #1A2744; border-color: #2A3A5A; color: #93C5FD; }
body.dark-mode .fin-card.credit { background: #3B2F1A; border-color: #4A3D2A; color: #FDE68A; }
body.dark-mode .fin-card.debit { background: #1A3B2A; border-color: #2A4A3A; color: #6EE7B7; }
body.dark-mode .fin-card.frozen { background: #1A1A3B; border-color: #2A2A4A; color: #C7D2FE; }
body.dark-mode .fin-card.remainder { background: #1A3B1A; border-color: #2A4A2A; color: #BBF7D0; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.data-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: var(--bg-hover); }
.positive { color: var(--success); }
.negative { color: var(--danger); }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block; padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase;
}
.badge-admin { background: var(--accent-light); color: var(--accent); }
.badge-user { background: var(--bg-hover); color: var(--text-secondary); }
.badge-active { background: #D1FAE5; color: #065F46; }
.badge-emission { background: #E7F1FF; color: var(--accent); }
.badge-deposit_in { background: #FEF3C7; color: #92400E; }
.badge-purchase_revenue { background: #D1FAE5; color: #065F46; }
.badge-admin_credit { background: #E0E7FF; color: #3730A3; }
.badge-admin_debit { background: #FEE2E2; color: var(--danger); }
body.dark-mode .badge-active { background: #1A3B2A; color: #6EE7B7; }
body.dark-mode .badge-emission { background: #1A2744; color: #93C5FD; }
body.dark-mode .badge-deposit_in { background: #3B2F1A; color: #FDE68A; }
body.dark-mode .badge-purchase_revenue { background: #1A3B2A; color: #6EE7B7; }
body.dark-mode .badge-admin_credit { background: #1E1A3B; color: #C7D2FE; }
body.dark-mode .badge-admin_debit { background: #3B1A1A; color: #FCA5A5; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.input {
    width: 100%; padding: 0.6rem 0.9rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: all var(--transition);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,123,255,0.15); }
.input-sm { padding: 0.35rem 0.6rem; font-size: 0.82rem; }

textarea.input { resize: vertical; font-family: inherit; }

.form-row { display: flex; gap: 0.75rem; align-items: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.form-group.full-width { grid-column: 1 / -1; }
.filter-row { margin-bottom: 1rem; max-width: 250px; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none; border-radius: var(--radius-xs);
    font-size: 0.88rem; font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover { background: #FEE2E2; }
body.dark-mode .btn-danger:hover { background: #3B1A1A; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-icon {
    background: none; border: none; cursor: pointer;
    padding: 0.35rem; border-radius: var(--radius-xs);
    color: var(--text-secondary);
    transition: all var(--transition);
    display: inline-flex; align-items: center;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.btn-danger:hover { color: var(--danger); }

/* ── Prompts ───────────────────────────────────────────────────────────────── */
.prompts-list { display: flex; flex-direction: column; gap: 0.75rem; }
.prompt-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: all var(--transition);
}
.prompt-card.active { border-color: var(--accent); background: var(--accent-light); }
.prompt-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.prompt-preview {
    font-size: 0.78rem; color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 0.5rem; border-radius: var(--radius-xs);
    white-space: pre-wrap; word-break: break-word;
    margin-bottom: 0.5rem;
}
.prompt-actions { display: flex; gap: 0.5rem; }

/* ── Telethon ──────────────────────────────────────────────────────────────── */
.status-indicator {
    display: flex; align-items: center; gap: 0.6rem;
    font-size: 0.92rem;
}
.status-dot {
    width: 10px; height: 10px; border-radius: 50%;
}
.status-dot.connected { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.disconnected { background: var(--text-muted); }

.status-badge {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    padding: 0.2rem 0.6rem; border-radius: var(--radius-xs);
    margin-left: auto;
}
.status-badge.running { background: #D1FAE5; color: #065F46; }
.status-badge.stopped { background: var(--bg-hover); color: var(--text-muted); }
body.dark-mode .status-badge.running { background: #1A3B2A; color: #6EE7B7; }

.toggle-label {
    display: flex; align-items: center; gap: 0.75rem;
    cursor: pointer; font-size: 0.92rem;
}
.toggle-label input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--accent);
}
.success-banner {
    display: flex; align-items: center; gap: 0.5rem;
    background: #D1FAE5;
    color: #065F46;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xs);
    margin-bottom: 1rem;
}
body.dark-mode .success-banner { background: #1A3B2A; color: #6EE7B7; }

/* ── Parse Result ──────────────────────────────────────────────────────────── */
.parse-result {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xs);
    margin-top: 1rem;
    font-size: 0.88rem;
}
.parse-result.success { background: #D1FAE5; color: #065F46; }
.parse-result.error { background: #FEE2E2; color: var(--danger); }
body.dark-mode .parse-result.success { background: #1A3B2A; color: #6EE7B7; }
body.dark-mode .parse-result.error { background: #3B1A1A; color: #FCA5A5; }

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ────────────────────────────────────────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.4s ease forwards;
}
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Toast Notifications ───────────────────────────────────────────────────── */
.toast-container {
    position: fixed; top: 12px; right: 16px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    pointer-events: all;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 380px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.1rem; padding: 0 0 0 0.5rem;
    line-height: 1;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info { border-left: 3px solid var(--accent); }
.toast-info .toast-icon { color: var(--accent); }

/* ── Confirm / Prompt Dialog ──────────────────────────────────────────────── */
.confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    transition: background 0.2s;
}
.confirm-overlay.show { background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); }
.confirm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 400px; width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.confirm-icon .material-icons-outlined { font-size: 2.5rem; color: var(--accent); }
.confirm-msg { margin: 1rem 0 1.25rem; font-size: 0.95rem; line-height: 1.5; }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: center; }
.confirm-actions .btn { min-width: 90px; justify-content: center; }
.prompt-input { margin-bottom: 1rem; text-align: left; }

/* ── Button Loading ────────────────────────────────────────────────────────── */
.btn-loading { min-width: 80px; justify-content: center; }

/* ── Page Transition ──────────────────────────────────────────────────────── */
body { opacity: 0; }
body.page-loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .mobile-top-bar { display: flex; }

    .sidebar {
        position: fixed;
        top: 0; bottom: 0; left: 0;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease, background var(--transition);
        box-shadow: none;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-close-btn { display: block; }

    .page-wrapper { flex-direction: column; }

    .main-content {
        padding: 1rem;
        margin-top: var(--top-bar-height);
    }

    .form-grid { grid-template-columns: 1fr; }
    .stats-grid, .fin-grid { grid-template-columns: 1fr 1fr; }
    .form-row { flex-direction: column; }

    .toast-container { top: calc(var(--top-bar-height) + 12px); left: 16px; right: 16px; }
    .toast { max-width: 100%; }

    .auth-container { min-height: calc(100vh - var(--top-bar-height) - 4rem); }
}

@media (max-width: 480px) {
    .stats-grid, .fin-grid { grid-template-columns: 1fr; }
    .subs-grid { grid-template-columns: 1fr; }
}

/* ── Text helpers ──────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); font-size: 0.88rem; }
