/**
 * Hisaab Kitaab — Base Stylesheet
 * @since v1.0.0
 */

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

:root {
    --color-primary: #4F46E5;
    --color-primary-dark: #4338CA;
    --color-primary-light: #818CF8;
    --color-secondary: #7C3AED;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
    --font-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--color-gray-50);
    color: var(--color-gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-dark);
}

/* ─── Typography ─── */
h1 { font-size: 2.25rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.875rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
p { margin-bottom: 1rem; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-block { display: block; width: 100%; }
.btn-link { background: none; border: none; color: var(--color-primary); cursor: pointer; font-size: 14px; }
.btn-link:hover { text-decoration: underline; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 4px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--color-gray-800);
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-input.error {
    border-color: var(--color-danger);
}

/* ─── Cards ─── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* ─── Utility ─── */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.required { color: var(--color-danger); }
.placeholder-msg { text-align: center; padding: 60px 20px; color: var(--color-gray-500); }
.field-error { display: block; font-size: 0.8125rem; color: var(--color-danger); margin-top: 4px; min-height: 18px; }

/* ─── Header & Navigation (Phase 1B) ─── */
.maintenance-banner {
    background: #92400e;
    color: #fef3c7;
    padding: 10px 0;
    font-size: 0.875rem;
}
.maintenance-banner .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.maintenance-banner button {
    background: none;
    border: none;
    color: #fef3c7;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 4px;
}

.announcement-banner {
    padding: 10px 0;
    font-size: 0.875rem;
}
.announcement-info { background: #dbeafe; color: #1e40af; }
.announcement-warning { background: #fef3c7; color: #92400e; }
.announcement-success { background: #d1fae5; color: #065f46; }
.announcement-error { background: #fee2e2; color: #991b1b; }
.announcement-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.announcement-link {
    font-weight: 700;
    text-decoration: underline;
    margin-left: 8px;
}
.announcement-banner button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.7;
}

.site-header {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-gray-900);
    text-decoration: none;
}
.logo-icon { font-size: 1.5rem; }
.logo-text { background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-list { display: flex; list-style: none; gap: 4px; }
.nav-link { padding: 8px 16px; border-radius: var(--radius); color: var(--color-gray-600); font-weight: 500; font-size: 0.9375rem; transition: all 0.2s; text-decoration: none; }
.nav-link:hover, .nav-link.active { color: var(--color-primary); background: #eef2ff; }

.mobile-menu-btn { display: none; background: none; border: none; padding: 8px; cursor: pointer; }
.hamburger { display: block; width: 24px; height: 2px; background: var(--color-gray-700); position: relative; transition: background 0.3s; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; width: 24px; height: 2px; background: var(--color-gray-700); transition: transform 0.3s; }
.hamburger::before { top: -7px; }
.hamburger::after { bottom: -7px; }
.menu-open .hamburger { background: transparent; }
.menu-open .hamburger::before { transform: rotate(45deg) translate(5px, 5px); }
.menu-open .hamburger::after { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: white; box-shadow: var(--shadow-lg); padding: 16px; border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
    .main-nav.nav-open { display: block; }
    .nav-list { flex-direction: column; gap: 0; }
    .nav-link { display: block; padding: 12px 16px; border-radius: var(--radius); }
}

/* ─── Footer (Phase 1B) ─── */
.site-footer {
    background: var(--color-gray-900);
    color: var(--color-gray-400);
    padding: 60px 0 24px;
    margin-top: 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}
.footer-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.footer-logo .logo-text { color: white; -webkit-text-fill-color: white; }
.footer-about { font-size: 0.9375rem; line-height: 1.6; color: var(--color-gray-400); margin-bottom: 0; }
.footer-heading { color: white; font-size: 1rem; margin-bottom: 16px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--color-gray-400); text-decoration: none; font-size: 0.9375rem; transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-disabled { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }
.footer-social { display: flex; gap: 24px; justify-content: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--color-gray-700); }
.footer-social a { color: var(--color-gray-400); text-decoration: none; font-size: 0.875rem; transition: color 0.2s; }
.footer-social a:hover { color: white; }
.footer-bottom { text-align: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--color-gray-700); font-size: 0.8125rem; }
.footer-bottom p { margin: 0; }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-social { flex-wrap: wrap; }
}

/* ─── Hero Section ─── */
.hero-section {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    padding: 100px 0 120px;
    text-align: center;
}
.hero-title { font-size: 3.5rem; font-weight: 800; color: white; margin-bottom: 16px; line-height: 1.1; }
.hero-highlight { background: rgba(255,255,255,0.2); padding: 2px 12px; border-radius: 8px; }
.hero-tagline { font-size: 1.25rem; opacity: 0.9; max-width: 640px; margin: 0 auto 32px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-btn-primary { background: white; color: var(--color-primary); }
.hero-btn-primary:hover { background: #f3f4f6; color: var(--color-primary-dark); }
.hero-btn-secondary { border: 2px solid white; color: white; background: transparent; }
.hero-btn-secondary:hover { background: white; color: var(--color-primary); }
.hero-stats { display: flex; gap: 48px; justify-content: center; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat-value { display: block; font-size: 1.5rem; font-weight: 800; }
.hero-stat-label { display: block; font-size: 0.8125rem; opacity: 0.7; }

@media (max-width: 768px) {
    .hero-section { padding: 60px 0 80px; }
    .hero-title { font-size: 2.25rem; }
    .hero-tagline { font-size: 1rem; }
    .hero-stats { gap: 24px; }
}

/* ─── Section Titles ─── */
.section-title { font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: 8px; color: var(--color-gray-900); }
.section-subtitle { text-align: center; color: var(--color-gray-500); max-width: 600px; margin: 0 auto 48px; font-size: 1.0625rem; line-height: 1.6; }
.page-title { font-size: 2.25rem; font-weight: 800; color: var(--color-gray-900); margin-bottom: 12px; }
.page-subtitle { color: var(--color-gray-500); font-size: 1.0625rem; max-width: 640px; margin-bottom: 0; line-height: 1.6; }

/* ─── Subdomain Cards ─── */
.subdomains-section { background: white; }
.subdomains-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.subdomain-card { background: var(--color-gray-50); border: 2px solid var(--color-gray-200); border-radius: var(--radius-lg); padding: 32px 24px; text-align: center; transition: all 0.2s; }
.subdomain-card:hover:not(.disabled) { border-color: var(--color-primary); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.subdomain-card.disabled { opacity: 0.45; pointer-events: none; filter: grayscale(1); }
.subdomain-icon { font-size: 2.5rem; margin-bottom: 12px; }
.subdomain-name { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.subdomain-desc { font-size: 0.875rem; color: var(--color-gray-500); margin-bottom: 16px; line-height: 1.5; }
.subdomain-btn { margin-top: 8px; }
.subdomain-coming-soon { font-size: 0.8125rem; color: var(--color-danger); font-weight: 600; display: block; margin-top: 12px; }

/* ─── Features Grid ─── */
.features-section { background: var(--color-gray-50); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.feature-card { background: white; border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s; }
.feature-card:hover { box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-title { font-size: 1.125rem; margin-bottom: 8px; }
.feature-desc { font-size: 0.9375rem; color: var(--color-gray-500); line-height: 1.6; margin-bottom: 0; }

/* ─── How It Works ─── */
.how-section { background: white; }
.steps-grid { display: flex; align-items: flex-start; justify-content: center; gap: 24px; flex-wrap: wrap; }
.step-card { background: var(--color-gray-50); border-radius: var(--radius-lg); padding: 32px; max-width: 280px; text-align: center; flex: 1; min-width: 240px; }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-primary); color: white; font-size: 1.25rem; font-weight: 800; margin-bottom: 16px; }
.step-arrow { font-size: 2rem; color: var(--color-gray-300); padding-top: 40px; }
.step-title { font-size: 1.125rem; margin-bottom: 8px; }
.step-desc { font-size: 0.9375rem; color: var(--color-gray-500); line-height: 1.6; margin-bottom: 0; }
@media (max-width: 768px) { .step-arrow { display: none; } }

/* ─── Testimonials ─── */
.testimonials-section { background: var(--color-gray-50); }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.testimonial-card { background: white; border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.testimonial-text { font-size: 0.9375rem; color: var(--color-gray-600); line-height: 1.7; margin-bottom: 20px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar { font-size: 2rem; }
.testimonial-name { font-weight: 700; font-size: 0.9375rem; color: var(--color-gray-900); }
.testimonial-role { font-size: 0.8125rem; color: var(--color-gray-500); }

/* ─── CTA Section ─── */
.cta-section { background: white; }
.cta-card { background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); color: white; border-radius: var(--radius-xl); padding: 64px 32px; text-align: center; }
.cta-title { font-size: 2rem; font-weight: 800; color: white; margin-bottom: 16px; }
.cta-text { font-size: 1.0625rem; opacity: 0.9; max-width: 560px; margin: 0 auto 32px; line-height: 1.7; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ─── Pricing ─── */
.pricing-hero { background: var(--color-gray-50); padding: 80px 0 40px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 40px; }
.pricing-card { background: white; border: 2px solid var(--color-gray-200); border-radius: var(--radius-lg); padding: 32px 24px; text-align: center; position: relative; transition: all 0.2s; }
.pricing-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-lg); }
.pricing-popular { border-color: var(--color-primary); }
.pricing-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--color-primary); color: white; padding: 4px 16px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.pricing-name { font-size: 1.125rem; margin-bottom: 16px; color: var(--color-gray-600); }
.pricing-price { margin-bottom: 16px; }
.pricing-amount { font-size: 2.5rem; font-weight: 800; color: var(--color-gray-900); }
.pricing-tokens { margin-bottom: 8px; }
.pricing-token-count { font-size: 1.75rem; font-weight: 800; color: var(--color-primary); }
.pricing-token-label { font-size: 0.875rem; color: var(--color-gray-500); margin-left: 4px; }
.pricing-rate { font-size: 0.8125rem; color: var(--color-gray-400); margin-bottom: 24px; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing-features li { padding: 8px 0; font-size: 0.9375rem; color: var(--color-gray-600); border-bottom: 1px solid var(--color-gray-100); }
.pricing-features li:last-child { border-bottom: none; }
.pricing-btn { width: 100%; }

/* ─── Data Tables ─── */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table thead { background: var(--color-gray-50); }
.data-table th { padding: 14px 16px; text-align: left; font-size: 0.8125rem; font-weight: 700; color: var(--color-gray-600); text-transform: uppercase; letter-spacing: 0.5px; }
.data-table td { padding: 14px 16px; font-size: 0.9375rem; border-top: 1px solid var(--color-gray-100); }
.data-table tbody tr:hover { background: #f9fafb; }
.comparison-table-wrapper, .token-rates-table-wrapper { max-width: 700px; margin: 0 auto 40px; overflow-x: auto; }

.info-box { background: #eef2ff; border-left: 4px solid var(--color-primary); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; max-width: 700px; margin: 0 auto; font-size: 0.9375rem; color: var(--color-gray-700); }
.token-rates-section, .token-explain-section { background: var(--color-gray-50); }
.explain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.explain-card { background: white; border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.explain-card h3 { margin-bottom: 12px; }
.explain-card p { font-size: 0.9375rem; color: var(--color-gray-500); line-height: 1.6; margin-bottom: 0; }

/* ─── FAQ ─── */
.faq-hero { background: var(--color-gray-50); padding: 80px 0 40px; }
.faq-container { max-width: 800px; }
.faq-search { margin-bottom: 32px; }
.faq-accordion { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 2px solid var(--color-gray-200); border-radius: var(--radius); overflow: hidden; transition: border-color 0.2s; }
.faq-item.faq-open { border-color: var(--color-primary); }
.faq-question { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: white; border: none; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--color-gray-800); text-align: left; font-family: var(--font-sans); }
.faq-question:hover { background: var(--color-gray-50); }
.faq-icon { font-size: 1.25rem; font-weight: 300; color: var(--color-gray-400); min-width: 20px; text-align: center; }
.faq-answer { padding: 0 20px 20px; background: white; }
.faq-answer-inner { font-size: 0.9375rem; color: var(--color-gray-600); line-height: 1.7; padding-top: 4px; border-top: 1px solid var(--color-gray-100); }

/* ─── Contact ─── */
.contact-hero { background: var(--color-gray-50); padding: 80px 0 40px; }
.contact-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.form-textarea { resize: vertical; min-height: 120px; }
.contact-submit-btn { min-width: 180px; }
.contact-result { margin-top: 20px; padding: 16px 20px; border-radius: var(--radius); font-weight: 600; }
.contact-result.success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.contact-result.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.contact-info { display: flex; flex-direction: column; gap: 24px; }
.contact-info-card { background: white; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.contact-info-card h3 { font-size: 1.125rem; margin-bottom: 12px; }
.contact-info-card p { font-size: 0.9375rem; color: var(--color-gray-500); margin-bottom: 16px; }
.contact-detail { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.9375rem; }
.contact-detail-icon { font-size: 1.25rem; }
.contact-info-card ul { list-style: none; }
.contact-info-card li { margin-bottom: 8px; }
.contact-disabled { text-align: center; padding: 60px 20px; }
.contact-disabled .disabled-icon { font-size: 3rem; margin-bottom: 16px; }
.contact-disabled h3 { margin-bottom: 8px; color: var(--color-gray-600); }
.contact-disabled p { color: var(--color-gray-500); }

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

/* ─── About ─── */
.about-hero, .legal-hero, .changelog-hero, .blog-hero, .faq-hero, .pricing-hero, .contact-hero { background: var(--color-gray-50); padding: 80px 0 40px; }
.about-content { max-width: 800px; margin: 0 auto; }
.content-block h2 { font-size: 1.5rem; margin-top: 32px; margin-bottom: 12px; color: var(--color-gray-900); }
.content-block p { font-size: 1rem; color: var(--color-gray-600); line-height: 1.8; }

.stats-section { background: var(--color-gray-50); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat-card { text-align: center; padding: 32px 16px; background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--color-primary); display: block; }
.stat-label { font-size: 0.875rem; color: var(--color-gray-500); margin-top: 4px; display: block; }
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.team-section { background: var(--color-gray-50); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.team-card { background: white; border-radius: var(--radius-lg); padding: 32px; text-align: center; box-shadow: var(--shadow-sm); }
.team-avatar { font-size: 3rem; margin-bottom: 12px; }
.team-name { font-size: 1.125rem; margin-bottom: 4px; }
.team-role { font-size: 0.875rem; color: var(--color-primary); font-weight: 600; margin-bottom: 8px; }
.team-bio { font-size: 0.9375rem; color: var(--color-gray-500); line-height: 1.6; margin-bottom: 0; }

.values-section { background: white; }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.value-card { background: var(--color-gray-50); border-radius: var(--radius-lg); padding: 32px; text-align: center; }
.value-icon { font-size: 2.5rem; margin-bottom: 16px; }
.value-title { font-size: 1.125rem; margin-bottom: 8px; }
.value-desc { font-size: 0.9375rem; color: var(--color-gray-500); line-height: 1.6; margin-bottom: 0; }

/* ─── Legal Pages ─── */
.legal-content { max-width: 800px; margin: 0 auto; }
.legal-content .content-block h2 { font-size: 1.25rem; margin-top: 28px; margin-bottom: 12px; }
.legal-content .content-block p { font-size: 0.9375rem; line-height: 1.8; }

/* ─── Changelog ─── */
.changelog-container { max-width: 800px; margin: 0 auto; }
.changelog-timeline { display: flex; flex-direction: column; gap: 0; }
.changelog-entry { display: flex; gap: 24px; position: relative; }
.changelog-marker { width: 16px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.changelog-marker::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); margin-top: 20px; flex-shrink: 0; }
.changelog-entry:not(:last-child) .changelog-marker::after { content: ''; width: 2px; flex: 1; background: var(--color-gray-200); margin-top: 8px; }
.changelog-card { background: white; border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow-sm); flex: 1; margin-bottom: 16px; }
.changelog-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.changelog-version { background: var(--color-gray-100); color: var(--color-gray-700); padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; font-family: var(--font-mono); }
.changelog-badge { padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge-feature { background: #dbeafe; color: #1e40af; }
.badge-fix { background: #fee2e2; color: #991b1b; }
.badge-improvement { background: #d1fae5; color: #065f46; }
.badge-security { background: #fef3c7; color: #92400e; }
.badge-breaking { background: #fce7f3; color: #9d174d; }
.badge-default { background: var(--color-gray-100); color: var(--color-gray-700); }
.changelog-subdomain { font-size: 0.75rem; color: var(--color-gray-500); }
.changelog-date { font-size: 0.8125rem; color: var(--color-gray-400); margin-left: auto; }
.changelog-title { font-size: 1.125rem; margin-bottom: 8px; }
.changelog-desc { font-size: 0.9375rem; color: var(--color-gray-500); line-height: 1.6; margin-bottom: 0; }
.changelog-empty { text-align: center; padding: 80px 20px; }
.changelog-empty .empty-icon { font-size: 3rem; margin-bottom: 16px; }

/* ─── Blog ─── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.blog-card { background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s; }
.blog-card:hover { box-shadow: var(--shadow-lg); }
.blog-card-image { overflow: hidden; aspect-ratio: 16/9; }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.blog-card:hover .blog-card-image img { transform: scale(1.03); }
.blog-card-body { padding: 24px; }
.blog-card-meta { display: flex; gap: 16px; font-size: 0.8125rem; color: var(--color-gray-400); margin-bottom: 8px; }
.blog-card-title { font-size: 1.25rem; line-height: 1.3; margin-bottom: 8px; }
.blog-card-title a { color: var(--color-gray-900); text-decoration: none; }
.blog-card-title a:hover { color: var(--color-primary); }
.blog-card-excerpt { font-size: 0.9375rem; color: var(--color-gray-500); line-height: 1.6; margin-bottom: 12px; }
.blog-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { background: var(--color-gray-100); color: var(--color-gray-600); padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; }
.blog-read-more { font-size: 0.9375rem; font-weight: 600; color: var(--color-primary); text-decoration: none; }
.blog-read-more:hover { text-decoration: underline; }
.blog-empty { text-align: center; padding: 80px 20px; }
.blog-empty .empty-icon { font-size: 3rem; margin-bottom: 16px; }

/* Single blog post */
.blog-post-hero { background: var(--color-gray-50); padding: 40px 0 20px; }
.back-link { display: inline-block; font-size: 0.875rem; color: var(--color-primary); margin-bottom: 16px; }
.blog-post-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.9375rem; color: var(--color-gray-500); margin-bottom: 24px; }
.blog-post-content { max-width: 800px; margin: 0 auto; }
.blog-post-content .content-block img { max-width: 100%; border-radius: var(--radius); margin: 16px 0; }
.blog-cover-wrapper { margin-top: 16px; }
.blog-cover-img { max-width: 100%; border-radius: var(--radius-lg); }
.blog-share { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--color-gray-200); }
.blog-share h3 { margin-bottom: 16px; }
.share-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════
   Hisaab Kitaab — Personal Subdomain Styles (Phase 1D)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Auth Pages ─── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4F46E5, #7C3AED); padding: 16px; }
.auth-container { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border-radius: 16px; padding: 32px 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo h1 { font-size: 28px; color: #4F46E5; margin: 0; }
.auth-logo p { color: #6b7280; margin: 4px 0 0; font-size: 14px; }
.home-link { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: #4F46E5; text-decoration: none; }
.home-link:hover { text-decoration: underline; }
.auth-form { margin-top: 20px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; }
.auth-footer { text-align: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid #e5e7eb; font-size: 13px; }
.auth-footer a { color: #4F46E5; text-decoration: none; }

/* OTP Inputs */
.otp-inputs { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.otp-box { width: 48px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; border: 2px solid #e5e7eb; border-radius: 12px; outline: none; transition: border-color 0.2s; }
.otp-box:focus { border-color: #4F46E5; }
.otp-info { text-align: center; margin-bottom: 16px; }
.otp-info .small { font-size: 13px; color: #9ca3af; }
.invite-badge { background: #10B981; color: white; text-align: center; padding: 8px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; font-weight: 600; }

/* ─── Personal App Layout ─── */
.personal-app { display: flex; min-height: 100vh; }

/* ─── Month Card (Current Month + Totals) ─── */
.month-card { background: linear-gradient(135deg, #4F46E5, #7C3AED); color: white; padding: 10px 16px; position: sticky; top: 0; z-index: 100; margin: 0 0 8px 0; box-shadow: 0 2px 8px rgba(79,70,229,0.25); }
.month-card-header { display: flex; justify-content: space-between; align-items: center; }
.month-arrow { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 28px; line-height: 1; padding: 0 12px; cursor: pointer; user-select: none; transition: opacity 0.15s; }
.month-arrow:hover { opacity: 0.7; }
.month-arrow:active { opacity: 0.5; }
.month-label { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; text-align: center; }
.month-card-totals { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; }
.month-income-label, .month-expense-label { opacity: 0.85; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.month-amount.income { font-weight: 700; color: #86efac; font-size: 15px; }
.month-amount.expense { font-weight: 700; color: #fca5a5; font-size: 15px; }
.month-sep { opacity: 0.5; margin: 0 4px; }

/* ─── Sidebar (Desktop) ─── */
.sidebar { width: 260px; background: #fff; border-right: 1px solid #e5e7eb; padding: 16px 0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 200; transition: transform 0.3s ease, visibility 0s linear 0.3s; overflow: hidden; }
.sidebar-brand { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5e7eb; }
.sidebar-brand h2 { margin: 0; font-size: 18px; color: #4F46E5; }
.sidebar-close { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: #6b7280; }
.sidebar-menu { list-style: none; padding: 8px 0; margin: 0; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar-menu:hover { scrollbar-color: #cbd5e1 transparent; }
.sidebar-menu::-webkit-scrollbar { width: 5px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.sidebar:hover .sidebar-menu::-webkit-scrollbar-thumb { background: #cbd5e1; }
.sidebar-menu li a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; text-decoration: none; color: #374151; font-size: 14px; font-weight: 500; transition: all 0.15s; border-left: 3px solid transparent; }
.sidebar-menu li a:hover { background: #f3f4f6; color: #4F46E5; }
.sidebar-menu li.active a { background: #eef2ff; color: #4F46E5; border-left-color: #4F46E5; }
.nav-icon { font-size: 18px; }
.nav-label { flex: 1; }
.sidebar-footer { padding: 12px 20px; border-top: 1px solid #e5e7eb; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 8px; font-size: 13px; color: #6b7280; text-decoration: none; transition: background 0.15s; }
.sidebar-user:hover { background: #f3f4f6; }
.sidebar-user.active { background: #eef2ff; }
.sidebar-logout { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; color: #EF4444; text-decoration: none; }

/* ─── Main Content ─── */
.main-content { flex: 1; margin-left: 260px; padding: 24px; padding-bottom: 100px; min-height: 100vh; }
.main-content.shifted { margin-left: 0; }

/* ─── Topbar (Mobile) ─── */
.topbar { display: none; position: sticky; top: 0; z-index: 90; background: #fff; padding: 12px 16px; border-bottom: 1px solid #e5e7eb; align-items: center; gap: 12px; }
.topbar-title { flex: 1; font-size: 16px; font-weight: 600; margin: 0; }
.topbar .hamburger { background: none; border: none; font-size: 24px; cursor: pointer; color: #374151; padding: 4px; width: auto; height: auto; position: static; }
.topbar .hamburger::before, .topbar .hamburger::after { content: none; display: none; }
.token-badge { font-size: 13px; background: #eef2ff; color: #4F46E5; padding: 4px 10px; border-radius: 20px; font-weight: 600; }

/* ─── Bottom Navigation (Mobile) ─── */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #e5e7eb; padding: 8px 0 env(safe-area-inset-bottom, 8px); z-index: 200; justify-content: space-around; }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: #9ca3af; font-size: 10px; padding: 4px 8px; min-width: 56px; }
.bottom-nav-item.active { color: #4F46E5; }
.bnav-icon { font-size: 20px; }
.bnav-label { font-weight: 500; }

/* ─── FAB (Floating Action Button) ─── */
.fab { display: none; position: fixed; bottom: 80px; right: 20px; width: 56px; height: 56px; background: #4F46E5; color: white; border: none; border-radius: 50%; font-size: 28px; cursor: pointer; box-shadow: 0 4px 16px rgba(79,70,229,0.4); z-index: 150; transition: transform 0.2s; line-height: 56px; text-align: center; }
.fab:hover { transform: scale(1.1); }

/* ─── Page Header ─── */
.page-header { margin-bottom: 24px; }
.page-header h2 { margin: 0 0 12px; font-size: 22px; font-weight: 700; }

/* ─── Entry Filter Bar ─── */
.entry-filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: nowrap; justify-content: center; }
.entry-tabs { display: flex; gap: 4px; background: #f3f4f6; border-radius: 10px; padding: 4px; }
.filter-tab { padding: 8px 16px; border: none; background: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: #6b7280; transition: all 0.15s; }
.filter-tab.active { background: #fff; color: #4F46E5; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.date-filter-input { padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 13px; }

/* ─── Entries List ─── */
.entries-list { display: flex; flex-direction: column; gap: 4px; }
.entries-list.compact .entry-row { padding: 8px 12px; }
.entry-group-header { display: flex; justify-content: space-between; padding: 8px 12px; background: #f9fafb; border-radius: 8px; font-size: 13px; font-weight: 600; color: #6b7280; margin-top: 12px; }
.entry-group-header:first-child { margin-top: 0; }
.entry-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #fff; border: 1px solid #f3f4f6; transition: box-shadow 0.15s; cursor: default; }
.entry-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.entry-icon { font-size: 24px; }
.entry-info { flex: 1; min-width: 0; }
.entry-cat { font-size: 14px; font-weight: 600; color: #111827; }
.entry-details { font-size: 12px; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-right { text-align: right; }
.entry-right .amount { display: block; font-size: 15px; font-weight: 700; }
.entry-right .entry-time { font-size: 11px; color: #9ca3af; }

/* ─── Text Colors ─── */
.text-green { color: #10B981 !important; }
.text-red { color: #EF4444 !important; }
.text-gray { color: #6b7280 !important; }
.text-muted { color: #9ca3af; }

/* ─── Empty State ─── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { margin: 0 0 8px; color: #374151; }
.empty-state p { color: #6b7280; font-size: 14px; }

/* ─── Accounts Grid ─── */
.accounts-grid { display: grid; gap: 16px; }
.account-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.account-card.archived { opacity: 0.6; }
.account-icon { font-size: 32px; }
.account-info { flex: 1; min-width: 120px; }
.account-info h4 { margin: 0 0 4px; font-size: 16px; }
.account-type { font-size: 12px; color: #9ca3af; text-transform: capitalize; }
.account-balance { text-align: right; }
.balance-amount { display: block; font-size: 20px; font-weight: 700; }
.balance-opening { font-size: 12px; color: #9ca3af; }
.account-actions { width: 100%; display: flex; gap: 8px; }

/* ─── Categories ─── */
.cat-section { margin-bottom: 32px; }
.cat-section-title { font-size: 16px; font-weight: 600; color: #374151; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #e5e7eb; }
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid #f3f4f6; }
.cat-row.master-cat { opacity: 0.7; }
.cat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.cat-name { flex: 1; font-size: 14px; font-weight: 500; }
.cat-badge { font-size: 11px; background: #f3f4f6; color: #6b7280; padding: 2px 8px; border-radius: 12px; }
.cat-actions { display: flex; gap: 4px; }

/* ─── Budget ─── */
.budget-list { display: flex; flex-direction: column; gap: 16px; }
.budget-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; }
.budget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.budget-cat { font-size: 15px; font-weight: 600; }
.budget-pct { font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.budget-pct.ok { background: #d1fae5; color: #065f46; }
.budget-pct.warning { background: #fef3c7; color: #92400e; }
.budget-pct.over { background: #fee2e2; color: #991b1b; }
.budget-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.budget-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.budget-bar-fill.ok { background: #10B981; }
.budget-bar-fill.warning { background: #F59E0B; }
.budget-bar-fill.over { background: #EF4444; }
.budget-details { display: flex; gap: 16px; font-size: 13px; color: #6b7280; flex-wrap: wrap; }
.budget-actions { margin-top: 12px; display: flex; gap: 8px; }

/* ─── Analysis / Charts ─── */
.analysis-tabs { display: flex; gap: 4px; background: #f3f4f6; border-radius: 10px; padding: 4px; overflow-x: auto; flex-wrap: nowrap; }
.chart-panel { margin-top: 24px; }
.chart-container { max-width: 100%; margin: 0 auto; }
.donut-chart { max-width: 500px; height: 500px; }
.flow-chart { max-width: 1080px; height: 720px; }
.chart-legend { margin-top: 20px; display: flex; flex-direction: column; }
.legend-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid #f3f4f6; }
.legend-item:hover { background: #f0f0ff; border-radius: 6px; }
.legend-color { width: 14px; height: 14px; border-radius: 4px; }
.legend-name { flex: 1; font-size: 14px; }
.legend-value { font-weight: 600; font-size: 14px; }

/* ─── Dashboard ─── */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 32px; }
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; text-align: center; }
.stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-value { font-size: 18px; font-weight: 700; color: #111827; }
.stat-label { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.dash-section { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.dash-section h3 { margin: 0 0 16px; font-size: 17px; font-weight: 600; }

/* ─── Sessions ─── */
.sessions-list { display: flex; flex-direction: column; gap: 8px; }
.session-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid #f3f4f6; border-radius: 8px; }
.session-row.current-session { background: #eef2ff; border-color: #c7d2fe; }
.session-info { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.session-ip { color: #6b7280; font-size: 12px; }
.session-time { color: #9ca3af; font-size: 11px; }
.session-badge { font-size: 11px; background: #4F46E5; color: white; padding: 2px 8px; border-radius: 12px; }

/* ─── Modal ─── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 300; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-sm { max-width: 400px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #e5e7eb; }
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #6b7280; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ─── Entry Tabs (Modal) ─── */
.entry-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid #e5e7eb; }
.entry-tab { flex: 1; padding: 10px; text-align: center; border: none; background: none; cursor: pointer; font-size: 14px; font-weight: 600; color: #6b7280; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.entry-tab.active { color: #4F46E5; border-bottom-color: #4F46E5; }

/* ─── Calculator Widget ─── */
.calculator-widget { display: flex; gap: 8px; align-items: center; margin-top: 8px; padding: 8px; background: #f9fafb; border-radius: 8px; font-size: 13px; }
.calculator-widget input { flex: 1; border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.calculator-widget span { font-weight: 600; color: #4F46E5; min-width: 60px; }
.calculator-widget button { padding: 6px 12px; border-radius: 6px; }

/* ─── Help / FAQ ─── */
.help-content { max-width: 720px; }
.help-section { margin-bottom: 32px; }
.help-section h3 { margin: 0 0 12px; font-size: 18px; }
.help-section ol, .help-section ul { padding-left: 24px; }
.help-section li { margin-bottom: 8px; line-height: 1.6; }
.help-section code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.faq-q { width: 100%; text-align: left; padding: 14px 16px; background: none; border: none; font-size: 14px; font-weight: 600; cursor: pointer; color: #374151; }
.faq-a { display: none; padding: 0 16px 14px; font-size: 14px; color: #6b7280; line-height: 1.6; }
.faq-item.open .faq-a { display: block; }

/* ─── Form Utilities ─── */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-danger { color: #EF4444; border: 1px solid #fecaca; background: #fff; }
.btn-danger:hover { background: #fef2f2; }

/* ─── Mobile Responsive ─── */
@media (max-width: 768px) {
    .personal-app { flex-direction: column; }
    .month-card { position: static; z-index: 1; padding: 10px 12px; margin: 0 0 4px 0; box-shadow: none; border-bottom: 1px solid rgba(255,255,255,0.2); }
    .sidebar { transform: translateX(-100%); z-index: 300; visibility: hidden; pointer-events: none; }
    .sidebar.open { transform: translateX(0); visibility: visible; pointer-events: auto; }
    .sidebar-close { display: block; }
    .main-content { margin-left: 0; padding: 16px; padding-bottom: 160px; }
    .topbar { display: flex; z-index: 110; }
    .bottom-nav { display: flex; }
    .fab { display: block; }
    .month-card-totals { gap: 8px; }
    .month-amount.income, .month-amount.expense { font-size: 15px; }
    .form-row { flex-direction: column; gap: 0; }
    .accounts-grid { gap: 12px; }
    .account-card { padding: 16px; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .analysis-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .chart-container, .donut-chart, .flow-chart { width: 100%; height: 100%; max-width: 100%; }
}
@media (max-width: 360px) {
    .dashboard-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 15px; }
}

/* ═══════════════════════════════════════════════════════════
   Phase 2A — Wallet & Reports Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Wallet Balance Cards ── */
.wallet-balance-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.balance-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #E5E7EB;
}
.balance-icon { font-size: 28px; margin-bottom: 8px; }
.balance-label { font-size: 13px; color: #6B7280; margin-bottom: 4px; }
.balance-amount { font-size: 24px; font-weight: 700; color: #111827; }
.wallet-card .balance-amount { color: #059669; }
.token-card .balance-amount { color: #7C3AED; }
.balance-hint { font-size: 11px; color: #9CA3AF; margin-top: 4px; }

/* ── Recharge Plans ── */
.recharge-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.plan-card {
    background: #fff;
    border: 2px solid #E5E7EB;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.plan-card:hover { border-color: #4F46E5; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(79,70,229,0.15); }
.plan-name { font-size: 16px; font-weight: 600; color: #111827; margin-bottom: 8px; }
.plan-price { font-size: 28px; font-weight: 800; color: #4F46E5; margin-bottom: 4px; }
.plan-tokens { font-size: 14px; color: #6B7280; margin-bottom: 4px; }
.plan-rate { font-size: 12px; color: #9CA3AF; margin-bottom: 8px; }
.plan-desc { font-size: 12px; color: #6B7280; margin-bottom: 12px; }
.btn-recharge { margin-top: 8px; width: 100%; }
.btn-recharge:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Token Rates ── */
.token-rates { display: flex; flex-direction: column; gap: 8px; }
.rate-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #F9FAFB; border-radius: 12px;
}
.rate-icon { font-size: 20px; }
.rate-label { flex: 1; font-size: 14px; color: #374151; }
.rate-cost { font-weight: 600; color: #7C3AED; font-size: 14px; }

/* ── Wallet/Token History Tabs ── */
.tab-btn {
    background: none; border: none; padding: 8px 16px; font-size: 14px;
    color: #6B7280; cursor: pointer; border-bottom: 2px solid transparent;
    font-weight: 500;
}
.tab-btn.active { color: #4F46E5; border-bottom-color: #4F46E5; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Transaction List ── */
.transaction-list { display: flex; flex-direction: column; gap: 8px; }
.transaction-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: #fff; border-radius: 12px;
    border: 1px solid #F3F4F6;
}
.transaction-item.credit { border-left: 3px solid #10B981; }
.transaction-item.debit { border-left: 3px solid #EF4444; }
.txn-info { flex: 1; }
.txn-source { font-size: 14px; font-weight: 500; color: #111827; }
.txn-date { font-size: 12px; color: #9CA3AF; }
.txn-expiry { font-size: 11px; color: #F59E0B; }
.txn-amount { font-size: 15px; font-weight: 600; text-align: right; }
.transaction-item.credit .txn-amount { color: #10B981; }
.transaction-item.debit .txn-amount { color: #EF4444; }
.txn-balance { font-size: 11px; color: #9CA3AF; text-align: right; min-width: 80px; }

/* ── Reports Page ── */
.report-form { display: flex; flex-direction: column; gap: 16px; }
.report-cost-info {
    padding: 12px 16px; background: #EEF2FF; border-radius: 12px;
    font-size: 13px; color: #4338CA; display: flex; gap: 8px; align-items: center;
    flex-wrap: wrap;
}
.report-status {
    padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-top: 8px;
}
.report-status.loading { background: #FEF3C7; color: #92400E; }
.report-status.success { background: #D1FAE5; color: #065F46; }
.report-status.error { background: #FEE2E2; color: #991B1B; }
.report-status a { color: inherit; font-weight: 600; text-decoration: underline; }

/* ── Past Reports ── */
.past-reports-list { display: flex; flex-direction: column; gap: 10px; }
.past-report-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; background: #fff; border-radius: 12px;
    border: 1px solid #F3F4F6;
}
.report-info { flex: 1; }
.report-type-badge {
    display: inline-block; padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 700; margin-right: 8px;
}
.badge-pdf { background: #FEE2E2; color: #DC2626; }
.badge-xls { background: #D1FAE5; color: #059669; }
.report-name { font-size: 14px; font-weight: 500; color: #111827; display: inline; }
.report-meta { font-size: 12px; color: #9CA3AF; margin-top: 4px; }
.btn-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Email Change Page ── */
.current-info {
    padding: 12px 16px; background: #F0F9FF; border-radius: 12px;
    font-size: 14px; color: #0369A1; margin-bottom: 16px;
}
.otp-info { margin-bottom: 20px; font-size: 14px; color: #4B5563; line-height: 1.6; }
.otp-info strong { color: #111827; }
.otp-info .hint { font-size: 13px; color: #9CA3AF; margin-top: 8px; }
.success-icon { font-size: 48px; text-align: center; margin-bottom: 16px; }

/* ── Section Card ── */
.section-card {
    background: #fff; border-radius: 16px; padding: 20px;
    margin-bottom: 20px; border: 1px solid #E5E7EB;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.section-title { font-size: 16px; font-weight: 600; color: #111827; margin-bottom: 16px; display: flex; gap: 4px; flex-wrap: wrap; }
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: #111827; }
.page-hint { font-size: 13px; color: #6B7280; margin-top: 4px; }
.empty-state { text-align: center; padding: 32px 16px; color: #9CA3AF; font-size: 14px; }

@media (max-width: 480px) {
    .wallet-balance-cards { grid-template-columns: 1fr; }
    .recharge-plans { grid-template-columns: 1fr; }
    .past-report-item { flex-direction: column; align-items: flex-start; }
    .txn-balance { display: none; }
}

/* ─── Phase 2B: Invite, Merge & Sub-Master Styles ─── */
.invite-code-box { display: flex; align-items: center; gap: 8px; padding: 12px; background: var(--color-gray-50); border: 1px solid var(--color-gray-200); border-radius: 8px; }
.invite-code-text { font-family: 'Courier New', monospace; font-size: 18px; font-weight: 700; letter-spacing: 2px; color: var(--color-primary); }
.merge-request-card { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border: 1px solid var(--color-gray-200); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.merge-request-card .merge-info { display: flex; flex-direction: column; gap: 2px; }
.merge-request-card .merge-info strong { font-size: 14px; color: #111827; }
.merge-request-card .merge-email { font-size: 12px; color: #6B7280; }
.merge-request-card .merge-date { font-size: 11px; color: #9CA3AF; }
.merge-request-card .merge-actions { display: flex; gap: 6px; }
.active-merge-card { padding: 16px; background: linear-gradient(135deg, #ECFDF5, #D1FAE5); border: 1px solid #10B981; border-radius: 10px; margin-bottom: 12px; }
.active-merge-card h4 { font-size: 15px; color: #065F46; margin-bottom: 4px; }
.active-merge-card p { font-size: 13px; color: #047857; margin-bottom: 8px; }
.partner-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--color-primary-light); color: #fff; margin-left: 6px; vertical-align: middle; }
.merge-filter-chips { display: flex; gap: 6px; margin-left: 12px; }
.merge-filter-chips .chip { padding: 4px 12px; font-size: 12px; font-weight: 600; border-radius: 20px; border: 1px solid var(--color-gray-300); background: #fff; color: var(--color-gray-600); cursor: pointer; transition: all 0.2s; }
.merge-filter-chips .chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.merge-filter-chips .chip:hover:not(.active) { background: var(--color-gray-50); }
.merge-toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0; }
.merge-toggle-label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: #065F46; }
.merge-toggle-label .text-muted { font-size: 11px; font-weight: 400; color: #047857; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #9CA3AF; border-radius: 24px; transition: 0.2s; }
.switch .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: #10B981; }
.switch input:checked + .slider:before { transform: translateX(20px); }
.partner-accounts-section { margin-bottom: 24px; }
.partner-accounts-header { display: block; margin-bottom: 12px; width: 100%; }
.partner-accounts-header h3 { font-size: 16px; color: #065F46; margin: 0 0 4px; }
.partner-accounts-header .text-muted { font-size: 12px; color: #6B7280; display: block; }

/* Sub-Master Admin */
.sm-layout { display: flex; min-height: 100vh; }
.sm-sidebar { width: 240px; background: #111827; color: #fff; padding: 0; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform 0.3s; }
.sm-sidebar .sm-logo { padding: 20px 16px; border-bottom: 1px solid #374151; font-size: 18px; font-weight: 700; color: #818CF8; }
.sm-sidebar .sm-logo small { display: block; font-size: 11px; font-weight: 400; color: #9CA3AF; margin-top: 2px; }
.sm-sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #D1D5DB; text-decoration: none; font-size: 13px; transition: all 0.15s; border-left: 3px solid transparent; }
.sm-sidebar nav a:hover { background: #1F2937; color: #fff; }
.sm-sidebar nav a.active { background: #1F2937; color: #818CF8; border-left-color: #818CF8; }
.sm-sidebar nav a .nav-icon { width: 20px; text-align: center; font-size: 14px; }
.sm-main { margin-left: 240px; flex: 1; min-height: 100vh; background: var(--color-gray-50); }
.sm-topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--color-gray-200); position: sticky; top: 0; z-index: 50; }
.sm-topbar .sm-breadcrumb { font-size: 14px; color: #6B7280; }
.sm-topbar .sm-topbar-actions { display: flex; gap: 8px; }
.sm-content { padding: 24px; }
.sm-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.sm-stat-card { background: #fff; border-radius: 10px; padding: 20px; border: 1px solid var(--color-gray-200); }
.sm-stat-card .sm-stat-value { font-size: 28px; font-weight: 700; color: #111827; }
.sm-stat-card .sm-stat-label { font-size: 12px; color: #6B7280; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.sm-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--color-gray-200); }
.sm-table th, .sm-table td { padding: 10px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--color-gray-100); }
.sm-table th { background: var(--color-gray-50); font-weight: 600; color: #374151; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.sm-table tr:hover { background: #FAFAFA; }
.sm-form-card { background: #fff; border-radius: 10px; padding: 24px; border: 1px solid var(--color-gray-200); margin-bottom: 20px; }
.sm-form-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #111827; }
.sm-actions-cell { display: flex; gap: 4px; }
.sm-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.sm-badge-success { background: #D1FAE5; color: #065F46; }
.sm-badge-danger { background: #FEE2E2; color: #991B1B; }
.sm-badge-warning { background: #FEF3C7; color: #92400E; }
.sm-badge-info { background: #DBEAFE; color: #1E40AF; }

@media (max-width: 768px) {
    .sm-sidebar { transform: translateX(-100%); visibility: hidden; pointer-events: none; }
    .sm-sidebar.open { transform: translateX(0); visibility: visible; pointer-events: auto; }
    .sm-main { margin-left: 0; }
    .sm-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .merge-filter-chips { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════════════════
   Personal App — Global Form Element Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ─── All inputs, selects, textareas (global override) ─── */
.personal-app input[type="text"],
.personal-app input[type="email"],
.personal-app input[type="password"],
.personal-app input[type="number"],
.personal-app input[type="date"],
.personal-app input[type="time"],
.personal-app input[type="month"],
.personal-app input[type="url"],
.personal-app input[type="tel"],
.personal-app input[type="search"],
.personal-app select,
.personal-app textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: #1F2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.personal-app input:focus,
.personal-app select:focus,
.personal-app textarea:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.personal-app input[type="month"]:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.personal-app input::placeholder,
.personal-app textarea::placeholder {
    color: #9CA3AF;
}

.personal-app input:disabled,
.personal-app select:disabled,
.personal-app textarea:disabled {
    background: #F3F4F6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ─── Select dropdown styling ─── */
.personal-app select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px;
    cursor: pointer;
}

.personal-app select option {
    padding: 8px;
    font-size: 14px;
}

/* ─── Textarea ─── */
.personal-app textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ─── Labels (when near inputs) ─── */
.personal-app label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.filter-opts label,
.filter-section-head .filter-all {
    display: flex !important;
    align-items: center;
    gap: 5px;
    margin-bottom: 0 !important;
    font-weight: 500;
    cursor: pointer;
}

.personal-app label .required {
    color: #EF4444;
    margin-left: 2px;
}

/* ─── Form groups ─── */
.personal-app .form-group,
.personal-app .field-group {
    margin-bottom: 16px;
}

.personal-app .form-group label,
.personal-app .field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* ─── Inline form rows ─── */
.personal-app .form-row {
    display: flex;
    gap: 12px;
}

.personal-app .form-row > * {
    flex: 1;
}

/* ─── Buttons (global for personal app) ─── */
.personal-app button,
.personal-app input[type="submit"],
.personal-app input[type="button"] {
    font-family: var(--font-sans);
}

.personal-app .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.personal-app .btn-primary {
    background: #4F46E5;
    color: #fff;
}

.personal-app .btn-primary:hover {
    background: #4338CA;
}

.personal-app .btn-success {
    background: #10B981;
    color: #fff;
}

.personal-app .btn-success:hover {
    background: #059669;
}

.personal-app .btn-danger {
    background: #fff;
    color: #EF4444;
    border: 1px solid #FCA5A5;
}

.personal-app .btn-danger:hover {
    background: #FEF2F2;
}

.personal-app .btn-outline {
    background: #fff;
    color: #4F46E5;
    border: 1.5px solid #4F46E5;
}

.personal-app .btn-outline:hover {
    background: #EEF2FF;
}

.personal-app .btn-ghost {
    background: transparent;
    color: #6B7280;
}

.personal-app .btn-ghost:hover {
    background: #F3F4F6;
    color: #374151;
}

.personal-app .btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.personal-app .btn-xs {
    padding: 4px 10px;
    font-size: 11px;
}

.personal-app .btn-block {
    display: flex;
    width: 100%;
}

.personal-app .btn-link {
    background: none;
    border: none;
    color: #4F46E5;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 4px;
}

.personal-app .btn-link:hover {
    text-decoration: underline;
    color: #4338CA;
}

.personal-app .btn:disabled,
.personal-app .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── Icon buttons (small action buttons) ─── */
.personal-app .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #6B7280;
    transition: all 0.15s;
}

.personal-app .icon-btn:hover {
    background: #F3F4F6;
    color: #374151;
    border-color: #D1D5DB;
}

.personal-app .icon-btn.danger:hover {
    background: #FEF2F2;
    color: #EF4444;
    border-color: #FCA5A5;
}

/* ─── Cards (section containers) ─── */
.personal-app .card,
.personal-app .section-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

/* ─── Tables ─── */
.personal-app table {
    width: 100%;
    border-collapse: collapse;
}

.personal-app table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.personal-app table td {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid #F3F4F6;
    color: #374151;
}

.personal-app table tbody tr:hover {
    background: #F9FAFB;
}

/* ─── Badges ─── */
.personal-app .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.personal-app .badge-success { background: #D1FAE5; color: #065F46; }
.personal-app .badge-danger { background: #FEE2E2; color: #991B1B; }
.personal-app .badge-warning { background: #FEF3C7; color: #92400E; }
.personal-app .badge-info { background: #DBEAFE; color: #1E40AF; }
.personal-app .badge-gray { background: #F3F4F6; color: #6B7280; }

/* ─── Toggle switch ─── */
.personal-app .toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.personal-app .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    padding: 0;
    border: none;
}

.personal-app .toggle-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}

.personal-app .toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.personal-app .toggle-switch input:checked + .toggle-slider {
    background: #4F46E5;
}

.personal-app .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ─── Progress bar ─── */
.personal-app .progress-bar {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.personal-app .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s;
    background: #4F46E5;
}

/* ─── Tabs ─── */
.personal-app .tabs {
    display: flex;
    gap: 4px;
    background: #F3F4F6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
}

.personal-app .tab {
    padding: 8px 16px;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    transition: all 0.15s;
}

.personal-app .tab.active {
    background: #fff;
    color: #4F46E5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.personal-app .tab:hover:not(.active) {
    color: #374151;
}

/* ─── Modal improvements ─── */
.personal-app .modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.personal-app .modal-body {
    padding: 20px;
}

.personal-app .modal-body label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.personal-app .modal-body input,
.personal-app .modal-body select,
.personal-app .modal-body textarea {
    margin-bottom: 14px;
}

.filter-opts input[type="checkbox"],
.filter-section-head input[type="checkbox"] {
    margin-bottom: 0 !important;
}

/* ─── Pagination ─── */
.personal-app .pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}

.personal-app .pagination button {
    padding: 6px 12px;
    border: 1px solid #E5E7EB;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
}

.personal-app .pagination button.active {
    background: #4F46E5;
    color: #fff;
    border-color: #4F46E5;
}

.personal-app .pagination button:hover:not(.active) {
    background: #F3F4F6;
}

/* ─── Chip / Tag input ─── */
.personal-app .chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s;
}

.personal-app .chip.active {
    background: #4F46E5;
    color: #fff;
    border-color: #4F46E5;
}

.personal-app .chip:hover:not(.active) {
    background: #F3F4F6;
}

/* ─── Empty states ─── */
.personal-app .empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #9CA3AF;
}

.personal-app .empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.personal-app .empty-state h3 {
    font-size: 16px;
    color: #6B7280;
    margin-bottom: 8px;
}

.personal-app .empty-state p {
    font-size: 14px;
    color: #9CA3AF;
    margin-bottom: 0;
}

/* ─── Alert / Flash messages ─── */
.personal-app .alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.personal-app .alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.personal-app .alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.personal-app .alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.personal-app .alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }

/* ─── Skeleton loading ─── */
.personal-app .skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Tooltip ─── */
.personal-app [title] {
    position: relative;
}

/* ─── Divider ─── */
.personal-app .divider {
    height: 1px;
    background: #E5E7EB;
    margin: 16px 0;
}

/* ─── Flex utilities ─── */
.personal-app .flex { display: flex; }
.personal-app .flex-col { flex-direction: column; }
.personal-app .items-center { align-items: center; }
.personal-app .justify-between { justify-content: space-between; }
.personal-app .gap-2 { gap: 8px; }
.personal-app .gap-3 { gap: 12px; }
.personal-app .gap-4 { gap: 16px; }
.personal-app .mt-2 { margin-top: 8px; }
.personal-app .mt-3 { margin-top: 12px; }
.personal-app .mt-4 { margin-top: 16px; }
.personal-app .mb-2 { margin-bottom: 8px; }
.personal-app .mb-3 { margin-bottom: 12px; }
.personal-app .mb-4 { margin-bottom: 16px; }

/* ─── Mobile responsive form improvements ─── */
@media (max-width: 768px) {
    .personal-app .form-row {
        flex-direction: column;
        gap: 0;
    }

    .personal-app input[type="text"],
    .personal-app input[type="email"],
    .personal-app input[type="password"],
    .personal-app input[type="number"],
    .personal-app input[type="date"],
    .personal-app input[type="time"],
    .personal-app input[type="month"],
    .personal-app select,
    .personal-app textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }

    .entry-filter-bar { gap: 6px; }
    .entry-tabs { gap: 0; padding: 3px; }
    .filter-tab { padding: 6px 10px; font-size: 12px; }
    .date-filter-input { padding: 6px 8px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Additional Missing Styles — All Personal Pages
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Input month, color, file ─── */
.personal-app input[type="month"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: #1F2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.personal-app input[type="month"]:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.personal-app input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 2px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s;
}

.personal-app input[type="color"]:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.personal-app input[type="file"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: #1F2937;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.personal-app input[type="file"]:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* ─── Page Container ─── */
.personal-app .page-container {
    max-width: 900px;
    margin: 0 auto;
}

/* ─── Auth title (used in email_change.php) ─── */
.personal-app .auth-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    text-align: center;
    margin: 0 0 20px;
}

/* ─── Inline styles override for subscription pages ─── */
.personal-app .dash-section h3 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
}

/* ─── Fix for pages using <style> blocks inline ─── */
/* These ensure page-specific inline styles don't conflict */
.personal-app .page-header h2,
.personal-app .page-header h1 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

/* ─── Account meta (accounts page) ─── */
.personal-app .account-meta {
    font-size: 12px;
    color: #9CA3AF;
}

/* ─── Fix filter-bar for debts ─── */
.personal-app .filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ─── Fix budget list layout ─── */
.personal-app .budget-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── Fix analysis chart legend ─── */
.personal-app .chart-legend {
    margin-top: 20px;
}

/* ─── Fix entries date filter input ─── */
.personal-app .date-filter-input {
    padding: 8px 12px;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--font-sans);
    background: #fff;
}

.personal-app .date-filter-input:focus {
    border-color: #4F46E5;
    outline: none;
}

/* ─── Fix merge filter chips outside entries.php ─── */
.personal-app .merge-filter-chips {
    display: flex;
    gap: 6px;
    margin-left: 12px;
}

/* ─── Fix dashboard compact entries list ─── */
.personal-app .entries-list.compact .entry-row {
    padding: 8px 12px;
    font-size: 13px;
}

/* ─── Fix help FAQ toggle buttons ─── */
.personal-app .faq-q {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
    font-family: var(--font-sans);
}

.personal-app .faq-a {
    display: none;
    padding: 0 16px 14px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

.personal-app .faq-item.open .faq-a {
    display: block;
}

.personal-app .faq-item {
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.reminder-calendar {
    font-size: 0.7rem;
}
.reminder-calendar td {
    padding: 3px;
    vertical-align: top;
    min-height: 40px;
}
.reminder-calendar .cal-day {
    font-size: 0.7rem;
    font-weight: 400;
    color: #374151;
}
.reminder-calendar .cal-day.today {
    font-weight: 700;
    color: #4F46E5;
}
.reminder-calendar .cal-day.past {
    opacity: 0.4;
    cursor: not-allowed;
}
.reminder-tag {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.55rem;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.reminder-tag.paid {
    background: #D1FAE5;
    color: #065F46;
}
.reminder-tag.pending {
    background: #FEF3C7;
    color: #92400E;
}
.reminder-tag.overdue {
    background: #FEE2E2;
    color: #991B1B;
}
.profile-progress-bar {
    background: #E5E7EB;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.profile-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ─── Balance Summary (Analysis) ─── */
@media (max-width: 600px) {
    #balanceSummary {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ─── Entry Filter Modal ─── */
.filter-section { margin-bottom: 8px; padding: 12px 14px; border-radius: 10px; background: #f8fafc; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 12px; }
.filter-section-head > span { font-size: .82rem; font-weight: 600; color: #374151; }
.filter-section-head .filter-all { font-size: .78rem; font-weight: 500; color: #6366f1; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.filter-section-head .filter-all input { accent-color: #4F46E5; width: 14px; height: 14px; margin: 0; cursor: pointer; flex: 0 0 auto; }
.filter-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.filter-opts label { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: #374151; cursor: pointer; padding: 2px 0; white-space: nowrap; }
.filter-opts label input { accent-color: #4F46E5; width: 14px; height: 14px; margin: 0; cursor: pointer; flex: 0 0 auto; }
.filter-opts input[type="checkbox"]:not(:checked) + span { opacity: .5; }
.filter-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; background: #4F46E5; color: #fff; font-size: 10px; font-weight: 700; margin-left: 2px; pointer-events: none; }
