/* ── Landing page (logged-out gate) ───────────────────────────────────── */
.mbm-landing {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 20px 80px;
    color: #111827;
}

.mbm-landing-hero {
    text-align: center;
    margin-bottom: 56px;
}

.mbm-landing-hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0 0 16px;
    line-height: 1.2;
}

.mbm-landing-hero p {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.mbm-landing-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.mbm-landing-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 56px;
}

.mbm-feature-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mbm-feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.mbm-feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.mbm-feature-card p {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.mbm-landing-cta {
    text-align: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 36px 24px;
}

.mbm-landing-cta p {
    font-size: 0.95rem;
    color: #2563eb;
    font-weight: 500;
    margin: 0 0 20px;
}

/* Button variants */
.mbm-btn-primary {
    background: #2563eb;
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}

.mbm-btn-primary:hover {
    background: #1d4ed8;
}

.mbm-btn-secondary {
    background: #fff;
    color: #374151 !important;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    border: 1px solid #d1d5db;
    transition: background 0.15s, border-color 0.15s;
}

.mbm-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

@media (max-width: 640px) {
    .mbm-landing-hero h1 { font-size: 1.8rem; }
    .mbm-landing-features { grid-template-columns: 1fr; }
}

/* ── Login gate ───────────────────────────────────────────────────────── */
.mbm-login-gate {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
}

.mbm-login-gate-inner {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.mbm-login-gate-inner h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.mbm-login-gate-inner p {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0 0 28px;
}

/* ── Root ─────────────────────────────────────────────────────────────── */
#mbm-app-root {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    color: #111827;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.mbm-hero {
    margin-bottom: 32px;
}

.mbm-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.mbm-logout-btn {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 8px 18px;
}

/* ── Summary cards ────────────────────────────────────────────────────── */
.mbm-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.mbm-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mbm-card h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 0 0 8px;
}

.mbm-amount {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

#mbm-balance   { color: #2563eb; }
#mbm-income-total  { color: #16a34a; }
#mbm-expense-total { color: #dc2626; }

/* ── Add transaction form ─────────────────────────────────────────────── */
.mbm-add-transaction {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mbm-add-transaction h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 20px;
    color: #111827;
}

#mbm-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
}

#mbm-form .mbm-submit-row {
    grid-column: 1 / -1;
}

#mbm-form label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

#mbm-form select,
#mbm-form input[type="text"],
#mbm-form input[type="number"],
#mbm-form input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #111827;
    background: #f9fafb;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#mbm-form select:focus,
#mbm-form input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    background: #fff;
}

.mbm-button {
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    height: 40px;
}

.mbm-button:hover {
    background: #1d4ed8;
}

/* ── Transaction list ─────────────────────────────────────────────────── */
.mbm-transactions h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.mbm-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 0.95rem;
    padding: 32px 0;
}

.mbm-transaction-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mbm-transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.mbm-t-date {
    font-size: 0.8rem;
    color: #9ca3af;
    min-width: 90px;
}

.mbm-t-label {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
}

.mbm-t-amount {
    font-size: 1rem;
    font-weight: 700;
    min-width: 90px;
    text-align: right;
}

.mbm-income  { color: #16a34a; }
.mbm-expense { color: #dc2626; }

.mbm-delete-btn {
    background: none;
    border: none;
    color: #d1d5db;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.mbm-delete-btn:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .mbm-summary {
        grid-template-columns: 1fr;
    }

    #mbm-form {
        grid-template-columns: 1fr;
    }
}

/* ── Hero actions (premium badge + logout) ────────────────────────────── */
.mbm-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mbm-premium-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

/* ── Free tier notice bar ─────────────────────────────────────────────── */
.mbm-free-notice {
    margin-top: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
}

.mbm-free-notice a {
    color: #d97706;
    font-weight: 600;
    text-decoration: underline;
}

/* ── Category filter bar ──────────────────────────────────────────────── */
.mbm-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.mbm-filter-bar label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.mbm-filter-bar select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #111827;
    background: #f9fafb;
    cursor: pointer;
}

/* ── Category field (full-width row in form) ──────────────────────────── */
.mbm-field-full {
    grid-column: 1 / -1;
}

.mbm-optional {
    font-weight: 400;
    color: #9ca3af;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Category badge in transaction list ───────────────────────────────── */
.mbm-t-category {
    font-size: 0.72rem;
    font-weight: 600;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* ── Section header with toggle button ───────────────────────────────── */
.mbm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mbm-section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.mbm-btn-ghost {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.mbm-btn-ghost:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ── Monthly summary section ──────────────────────────────────────────── */
.mbm-monthly-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mbm-month-block {
    border-bottom: 1px solid #f3f4f6;
    padding: 12px 0;
}

.mbm-month-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mbm-month-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mbm-month-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
    flex: 1;
    min-width: 120px;
}

.mbm-month-income {
    font-size: 0.875rem;
    font-weight: 600;
    color: #16a34a;
    min-width: 90px;
    text-align: right;
}

.mbm-month-expense {
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc2626;
    min-width: 90px;
    text-align: right;
}

.mbm-month-balance {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 90px;
    text-align: right;
}

.mbm-positive { color: #2563eb; }
.mbm-negative { color: #dc2626; }

/* ── Category breakdown ───────────────────────────────────────────────── */
.mbm-cat-breakdown {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0 0 0 8px;
    border-left: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mbm-cat-breakdown li {
    font-size: 0.8rem;
    color: #6b7280;
}

.mbm-cat-name {
    font-weight: 600;
    color: #374151;
    margin-right: 6px;
}

/* ── Data tools (export / import) ─────────────────────────────────────── */
.mbm-tools-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mbm-tools-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 20px;
    color: #111827;
}

.mbm-tools-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mbm-tool-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
}

.mbm-tool-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111827;
}

.mbm-tool-card p {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0 0 14px;
    line-height: 1.5;
}

.mbm-import-label {
    cursor: pointer;
    display: inline-block;
}

@media (max-width: 640px) {
    .mbm-tools-row    { grid-template-columns: 1fr; }
    .mbm-month-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .mbm-month-income,
    .mbm-month-expense,
    .mbm-month-balance { text-align: left; min-width: unset; }
}

