/* ===== Root & Reset ===== */
:root {
    --primary: #1a3c5e;
    --primary-light: #2d6096;
    --accent: #e8a020;
    --accent-dark: #c47a10;
    --bg-light: #f4f7fa;
    --bg-white: #ffffff;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --border: #dce3ea;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(26,60,94,0.10);
    --shadow-lg: 0 8px 40px rgba(26,60,94,0.16);
    --transition: 0.25s ease;
    --free-color: #28a745;
    --finance-color: #1a3c5e;
    --complete-color: #6f42c1;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    line-height: 1.6;
}

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

img { max-width: 100%; height: auto; }

/* ===== Utility ===== */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}
.text-center { text-align: center; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== HEADER ===== */
.site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.header-brand img { width: 40px; height: 40px; border-radius: 8px; }
.brand-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}
.brand-tld { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.site-nav a:hover, .site-nav a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.nav-cta {
    background: var(--accent) !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    padding: 0.5rem 1.25rem !important;
}
.nav-cta:hover { background: var(--accent-dark) !important; }

/* ===== HERO / CAROUSEL ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2540 60%, #1a3c5e 100%);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}
.hero-badge {
    display: inline-block;
    background: rgba(232,160,32,0.2);
    color: var(--accent);
    border: 1px solid rgba(232,160,32,0.4);
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}
.hero-title span { color: var(--accent); }
.hero-description {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 480px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--primary); }
.btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: #fff; color: #fff; }
.btn-primary-dark {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary-dark:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }

/* Carousel */
.carousel-wrapper {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}
.carousel-track { position: relative; overflow: hidden; border-radius: 16px; }
.carousel-slide {
    display: none;
    background: var(--bg-white);
    border-radius: 16px;
    padding: 2rem;
    animation: fadeSlide 0.5s ease;
}
.carousel-slide.active { display: block; }
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 1rem;
}
.slide-name { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
.slide-desc { color: var(--text-muted); margin-bottom: 1.25rem; }
.slide-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--primary);
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background var(--transition);
}
.slide-link:hover { background: var(--primary-light); }
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
.carousel-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}
.carousel-dot.active { background: var(--accent); width: 24px; border-radius: 4px; }
.carousel-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
}
.carousel-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.carousel-btn:hover { background: rgba(255,255,255,0.2); }

/* ===== MEMBERSHIP SECTION ===== */
.membership-section {
    padding: 5rem 0;
    background: var(--bg-light);
}
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}
.plan-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2rem;
    border: 2px solid var(--border);
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex; flex-direction: column;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card.popular {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.popular-badge {
    position: absolute;
    top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.9rem;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.tier-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tier-free { background: #e9f7ef; color: var(--free-color); }
.tier-finance { background: #e8f0f9; color: var(--finance-color); }
.tier-complete { background: #f3ecff; color: var(--complete-color); }
.plan-name { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
.plan-price { font-size: 2.5rem; font-weight: 800; color: var(--text-dark); }
.plan-period { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.plan-features { list-style: none; margin-bottom: 2rem; flex: 1; }
.plan-features li {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.plan-features li::before {
    content: '\2713';
    color: var(--free-color);
    font-weight: 700;
    flex-shrink: 0;
}
.plan-cta {
    display: block;
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition);
    border: 2px solid;
    margin-top: auto;
}
.plan-cta-free { border-color: var(--free-color); color: var(--free-color); }
.plan-cta-free:hover { background: var(--free-color); color: #fff; }
.plan-cta-finance { background: var(--primary); border-color: var(--primary); color: #fff; }
.plan-cta-finance:hover { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }
.plan-cta-complete { border-color: var(--complete-color); color: var(--complete-color); }
.plan-cta-complete:hover { background: var(--complete-color); color: #fff; }

/* ===== APPS SECTION ===== */
.apps-section {
    padding: 5rem 0;
    background: var(--bg-white);
}
.apps-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.filter-btn {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}
.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.app-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex; flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.app-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
    color: inherit;
}
.app-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 1rem;
    flex-shrink: 0;
}
.app-name { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin-bottom: 0.4rem; }
.app-desc { color: var(--text-muted); font-size: 0.9rem; flex: 1; margin-bottom: 1rem; }
.app-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto;
}
.app-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}
.app-tier-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== APP DETAIL PAGE ===== */
.detail-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2540 100%);
    padding: 4rem 0;
    color: #fff;
}
.detail-hero-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
    display: flex; align-items: center; gap: 2rem;
}
.detail-icon {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
}
.detail-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; }
.detail-subtitle { color: rgba(255,255,255,0.8); font-size: 1.1rem; }
.detail-body {
    max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem;
    display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; align-items: start;
}
.detail-description {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 2rem;
}
.features-heading { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.features-list { list-style: none; }
.features-list li {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.features-list li::before { content: '\2713'; color: var(--free-color); font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.detail-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}
.detail-card-title { font-weight: 700; color: var(--primary); margin-bottom: 0.75rem; font-size: 1rem; }
.launch-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    width: 100%;
    background: var(--accent);
    color: var(--primary) !important;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: background var(--transition);
    text-decoration: none;
}
.launch-btn:hover { background: var(--accent-dark); }
.back-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color var(--transition);
}
.back-link:hover { color: #fff; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.85);
    padding: 3rem 0 1.5rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1200px; margin: 0 auto; padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.footer-brand img { width: 36px; height: 36px; border-radius: 8px; }
.footer-brand-name { font-size: 1.1rem; font-weight: 700; color: #fff; }
.footer-tagline { font-size: 0.9rem; color: rgba(255,255,255,0.6); margin-bottom: 1.25rem; max-width: 280px; }
.footer-heading { font-size: 0.8rem; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: rgba(255,255,255,0.65); font-size: 0.9rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
    max-width: 1200px; margin: 0 auto; padding: 1.25rem 1.5rem 0;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}
.footer-bottom p { font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.footer-bottom a { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.footer-bottom a:hover { color: var(--accent); }
.footer-legal-links { display: flex; gap: 1.5rem; }

/* ===== POLICY PAGES ===== */
.policy-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2540 100%);
    padding: 4rem 0 3rem;
    text-align: center;
    color: #fff;
}
.policy-hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.policy-hero p { color: rgba(255,255,255,0.75); font-size: 1rem; }
.policy-body {
    max-width: 860px; margin: 0 auto; padding: 3rem 1.5rem 5rem;
}
.policy-body h2 { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin: 2.5rem 0 1rem; }
.policy-body h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-dark); margin: 1.5rem 0 0.5rem; }
.policy-body p { color: var(--text-dark); margin-bottom: 1rem; line-height: 1.8; }
.policy-body ul { margin: 0.5rem 0 1rem 1.5rem; }
.policy-body li { margin-bottom: 0.4rem; line-height: 1.7; color: var(--text-dark); }
.policy-body a { color: var(--primary-light); }
.policy-highlight {
    background: #e8f0f9; border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem; border-radius: 0 8px 8px 0; margin: 1.5rem 0;
}
.policy-highlight p { margin: 0; font-size: 0.95rem; }

/* ===== NOT FOUND PAGE ===== */
.not-found-page { text-align: center; padding: 6rem 1.5rem; }
.not-found-page h1 { font-size: 5rem; font-weight: 900; color: var(--primary); opacity: 0.2; }
.not-found-page h2 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 0.75rem; }
.not-found-page p { color: var(--text-muted); margin-bottom: 2rem; }

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex; justify-content: center; align-items: flex-start;
    padding: 2.5rem 1.5rem 4rem;
    background: var(--bg-light);
}
.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    width: 100%; max-width: 440px;
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo img { width: 64px; height: 64px; border-radius: 16px; }
.auth-error {
    background: #fff5f5; border: 1px solid #fca5a5;
    color: #dc2626; padding: 0.75rem 1rem; border-radius: 8px;
    margin-bottom: 1.25rem; font-size: 0.9rem; display: flex; gap: 0.5rem; align-items: flex-start;
}
.auth-success {
    background: #f0fdf4; border: 1px solid #86efac;
    color: #15803d; padding: 0.75rem 1rem; border-radius: 8px;
    margin-bottom: 1.25rem; font-size: 0.9rem; display: flex; gap: 0.5rem; align-items: center;
}
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-dark); margin-bottom: 0.4rem; }
.form-control {
    width: 100%; padding: 0.6rem 0.9rem;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.95rem; color: var(--text-dark);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(45,96,150,0.15);
}
.form-control:disabled { background: var(--bg-light); color: var(--text-muted); cursor: not-allowed; }
.form-error { color: #dc2626; font-size: 0.8rem; margin-top: 0.25rem; display: block; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; font-size: 0.9rem; }
.form-check-input { width: 16px; height: 16px; cursor: pointer; }
.auth-submit-btn {
    width: 100%; padding: 0.75rem;
    background: var(--primary); color: #fff;
    border: none; border-radius: 10px;
    font-size: 1rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: background var(--transition);
}
.auth-submit-btn:hover:not(:disabled) { background: var(--primary-light); }
.auth-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }
.auth-links { text-align: center; margin-top: 1.25rem; font-size: 0.9rem; }
.auth-links a { color: var(--primary-light); font-weight: 500; }

/* Manage nav */
.manage-nav {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    display: flex; flex-direction: column; gap: 0.15rem;
    height: fit-content;
}
.manage-nav a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.75rem; border-radius: 8px;
    color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.manage-nav a:hover, .manage-nav a.active {
    background: var(--bg-light); color: var(--primary);
}
.manage-nav-logout {
    width: 100%; background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.75rem; border-radius: 8px;
    color: #dc2626; font-size: 0.9rem; font-weight: 500;
    transition: background var(--transition);
}
.manage-nav-logout:hover { background: #fff5f5; }

/* Payment form */
.payment-form { max-width: 480px; }

/* ===== HEADER USER LINKS ===== */
.user-name-short { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-link {
    display: flex; align-items: center; gap: 0.4rem;
    color: rgba(255,255,255,0.85) !important;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    font-size: 0.95rem; font-weight: 500;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    transition: background var(--transition);
}
.nav-user-link:hover { background: rgba(255,255,255,0.15) !important; color: #fff !important; }
.nav-signout-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.8);
    border-radius: 6px;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    font-size: 0.95rem; font-weight: 500;
    display: flex; align-items: center; gap: 0.4rem;
    transition: background var(--transition), color var(--transition);
}
.nav-signout-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ===== ADMIN LAYOUT ===== */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar {
    background: var(--primary);
    display: flex; flex-direction: column;
    padding: 1.25rem 0.75rem;
    position: sticky; top: 0; height: 100vh;
}
.admin-brand {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0.75rem 1.5rem;
    color: #fff; font-size: 1rem; font-weight: 700;
}
.admin-brand img { width: 32px; height: 32px; border-radius: 8px; }
.admin-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.admin-nav a {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.65rem 0.85rem; border-radius: 8px;
    color: rgba(255,255,255,0.7); font-size: 0.9rem; font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.12); color: #fff;
}
.admin-nav-footer { padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
.admin-nav-home {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.85rem; border-radius: 8px;
    color: rgba(255,255,255,0.55); font-size: 0.85rem;
    transition: color var(--transition);
}
.admin-nav-home:hover { color: rgba(255,255,255,0.85); }
.admin-main { padding: 2rem; overflow-y: auto; }
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem;
}
.admin-title { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.admin-back-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: var(--primary-light); font-size: 0.9rem; font-weight: 500;
}
.admin-back-link:hover { color: var(--primary); }
.admin-card {
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; margin-bottom: 0;
}
.admin-card-title {
    font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 1.25rem;
}
.admin-loading { color: var(--text-muted); padding: 2rem; text-align: center; }
.admin-action-link {
    color: var(--primary-light); font-size: 0.875rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 0.25rem;
    white-space: nowrap;
}
.admin-action-link:hover { color: var(--primary); }
.admin-danger-btn {
    background: #fff5f5; border: 1px solid #fca5a5;
    color: #dc2626; border-radius: 8px;
    padding: 0.5rem 1rem; cursor: pointer;
    font-size: 0.875rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 0.4rem;
    transition: background var(--transition);
}
.admin-danger-btn:hover { background: #fee2e2; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.stat-card {
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #fff;
}
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

/* Plan breakdown */
.plan-breakdown { display: flex; flex-direction: column; gap: 0.75rem; }
.plan-bar-row { display: flex; align-items: center; gap: 0.75rem; }
.plan-bar-track { flex: 1; background: var(--bg-light); border-radius: 4px; height: 8px; overflow: hidden; }
.plan-bar-fill { height: 100%; border-radius: 4px; min-width: 4px; transition: width 0.5s ease; }
.plan-bar-fill.tier-free { background: var(--free-color); }
.plan-bar-fill.tier-finance { background: var(--finance-color); }
.plan-bar-fill.tier-complete { background: var(--complete-color); }
.plan-bar-count { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); min-width: 28px; text-align: right; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    background: var(--bg-light); color: var(--text-muted);
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; padding: 0.75rem 1rem; text-align: left;
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
    font-size: 0.9rem; vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-light); }

/* Status badges */
.status-badge {
    display: inline-block; font-size: 0.72rem; font-weight: 700;
    padding: 0.2rem 0.6rem; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.status-active { background: #e9f7ef; color: var(--free-color); }
.status-pastdue { background: #fff7e6; color: #c87a00; }
.status-cancelled { background: #fff5f5; color: #dc2626; }
.status-expired { background: #f3ecff; color: var(--complete-color); }
.status-none { background: var(--bg-light); color: var(--text-muted); }

/* Spin animation */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1s linear infinite; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .carousel-wrapper { display: none; }
    .plans-grid { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .detail-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .hero-title { font-size: 2rem; }
    .section-title { font-size: 1.5rem; }
    .site-nav { gap: 0; }
    .site-nav a { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .footer-legal-links { justify-content: center; }
    .apps-grid { grid-template-columns: 1fr; }
    .detail-hero-inner { flex-direction: column; text-align: center; }
}
