:root {
    --bg: #f0f4f8;
    --sidebar: #0f172a;
    --sidebar-accent: #1e293b;
    --card: #ffffff;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 16px;
}

* { margin:0; padding:0; box-sizing:border-box; font-family:'Inter',sans-serif; }
body { display:flex; background:var(--bg); color:var(--text-main); height:100vh; overflow:hidden; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
    width:240px; background:var(--sidebar); color:white;
    padding:1.5rem 1rem; display:flex; flex-direction:column; flex-shrink:0;
    box-shadow:4px 0 20px rgba(0,0,0,0.2);
}
.logo {
    font-size:1.4rem; font-weight:800; margin-bottom:2rem;
    padding:0.5rem 1rem; display:flex; gap:8px; align-items:center;
    color:#60a5fa; letter-spacing:-0.5px;
}
.logo i { color:#f59e0b; }
.nav { list-style:none; flex-grow:1; }
.nav li {
    padding:0.85rem 1rem; margin-bottom:0.3rem; border-radius:10px;
    cursor:pointer; display:flex; gap:10px; align-items:center;
    color:#94a3b8; transition:all 0.2s; font-size:0.9rem; font-weight:500;
}
.nav li:hover { background:rgba(255,255,255,0.08); color:white; }
.nav li.active { background:linear-gradient(135deg,#3b82f6,#2563eb); color:white; box-shadow:0 4px 12px rgba(59,130,246,0.4); }
.nav li.active i { color:white; }

.template-box {
    background:rgba(255,255,255,0.05); padding:1.2rem;
    border-radius:12px; margin-top:auto; border:1px solid rgba(255,255,255,0.08);
}
.template-box h4 { margin-bottom:0.4rem; color:#f8fafc; font-size:0.85rem; }
.template-box p { font-size:0.75rem; color:#94a3b8; margin-bottom:0.8rem; line-height:1.5; }
.btn-outline {
    display:block; text-align:center; background:transparent;
    border:1px solid rgba(255,255,255,0.15); color:#cbd5e1;
    padding:0.45rem; border-radius:7px; text-decoration:none;
    font-size:0.8rem; margin-bottom:0.4rem; transition:0.2s;
    width: 100%; cursor: pointer; font-family: inherit;
}
.btn-outline:hover { background:rgba(255,255,255,0.1); color:white; border-color: rgba(255,255,255,0.4); }

/* ── MAIN CONTENT ─────────────────────────────────────────────── */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto !important;
    background: var(--bg);
    height: 100vh;
    min-height: 0;
}
.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.main-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.page-wrap {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0.25rem 1.2rem 2.5rem 1.2rem;
    min-height: min-content;
}
.page-wrap.scrollable { overflow-y: visible; }
.page-wrap.hidden { display: none !important; }
header { margin-bottom: 0.2rem; flex-shrink: 0; }
header h1 { font-size: 1.3rem; color: #0f172a; margin-bottom: 0.05rem; font-weight: 800; }
header p { color: var(--text-muted); font-size: 0.8rem; }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.hidden { display: none !important; }

#compliance-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,10,30,0.6);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,10,30,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
#compliance-modal.hidden,
#success-modal.hidden {
    display: none !important;
}


/* ── UPLOAD ───────────────────────────────────────────────────── */
.upload-container { display:flex; gap:1.5rem; margin-bottom:1.5rem; flex-shrink:0; }
.upload-card {
    flex:1; background:var(--card); padding:1.5rem; border-radius:var(--radius);
    box-shadow:0 2px 8px rgba(0,0,0,0.06); border:1px solid var(--border);
}
.upload-card h3 { margin-bottom:1rem; display:flex; gap:8px; align-items:center; font-size:1rem; font-weight:600; }
.drop-zone {
    border:2px dashed #cbd5e1; border-radius:12px; padding:1.5rem;
    text-align:center; cursor:pointer; transition:all 0.2s; background:#f8fafc;
    display:block; user-select:none;
}
.drop-zone:hover, .drop-zone.dragover { border-color:var(--primary); background:#eff6ff; border-style:solid; }
.drop-zone i { font-size:2rem; color:#94a3b8; display:block; margin-bottom:0.5rem; pointer-events:none; }
.drop-zone p { color:var(--text-muted); font-size:0.85rem; pointer-events:none; margin:0; }
.drop-zone small { color:#94a3b8; font-size:0.75rem; display:block; margin-top:4px; pointer-events:none; }
.drop-zone strong { color:var(--primary); }
.file-status { margin-top:0.8rem; font-size:0.82rem; color:#64748b; font-weight:500; text-align:center; min-height:1.2rem; }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.action-row { text-align:center; margin-bottom:1.5rem; flex-shrink:0; }
.btn-primary {
    background:linear-gradient(135deg,#3b82f6,#2563eb); color:white;
    border:none; padding:0.75rem 2rem; font-size:1rem; font-weight:600;
    border-radius:12px; cursor:pointer; transition:all 0.2s;
    box-shadow:0 8px 20px rgba(59,130,246,0.35);
    display:inline-flex; align-items:center; gap:8px;
}
.btn-primary:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 12px 25px rgba(59,130,246,0.4); }
.btn-primary:disabled { background:#cbd5e1; cursor:not-allowed; box-shadow:none; }
.btn-excel {
    background:linear-gradient(135deg,#10b981,#059669); color:white;
    border:none; padding:0.65rem 1.4rem; font-size:0.9rem; font-weight:600;
    border-radius:10px; cursor:pointer; transition:all 0.2s;
    box-shadow:0 6px 15px rgba(16,185,129,0.35);
    display:inline-flex; align-items:center; gap:8px;
}
.btn-excel:hover { transform:translateY(-1px); box-shadow:0 10px 20px rgba(16,185,129,0.4); }

/* ── COMPACT WATER WAVE CIRCULAR LOADER ────────────────────────── */
.loader { 
    text-align: center; 
    padding: 1.2rem 1rem; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.water-orb-wrapper {
    position: relative;
    width: 74px;
    height: 74px;
    margin: 0 auto 0.8rem auto;
}

.water-orb {
    position: relative;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: #f8fafc;
    border: 3px solid #ffffff;
    box-shadow: 0 8px 20px -3px rgba(37, 99, 235, 0.3), 0 0 0 3px rgba(59, 130, 246, 0.15), inset 0 2px 6px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Liquid Waves inside Orb */
.water-wave, .water-wave-back {
    position: absolute;
    width: 160px;
    height: 160px;
    top: 105%; /* Controlled dynamically by JS */
    left: -43px;
    border-radius: 40%;
    transform-origin: 50% 50%;
    transition: top 0.35s ease-out;
    pointer-events: none;
}

.water-wave {
    background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
    animation: waveRotate 3.5s linear infinite;
    z-index: 1;
    opacity: 0.92;
}

.water-wave-back {
    background: linear-gradient(180deg, #93c5fd 0%, #3b82f6 100%);
    animation: waveRotateBack 5s linear infinite;
    z-index: 1;
    opacity: 0.65;
}

@keyframes waveRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes waveRotateBack {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

/* Center Content inside Orb (Only Percentage - Never Clips!) */
.water-content {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    width: 100%;
    height: 100%;
}

.water-percent {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: color 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Status text box below the orb with Time Badge */
.water-status-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 1rem;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.countdown-badge {
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(37,99,235,0.06);
}

.water-status-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

/* ── VALIDATION BOX ───────────────────────────────────────────── */
.validation-box {
    background:var(--card); padding:1.5rem; border-radius:var(--radius);
    box-shadow:0 2px 8px rgba(0,0,0,0.06); border:1px solid var(--border);
    margin-top:1rem; flex-shrink:0;
}
.validation-box h3 { margin-bottom:1rem; font-size:1rem; }
.val-row { display:flex; gap:1.5rem; }
.val-item { flex:1; padding:1rem; border:1px solid var(--border); border-radius:10px; }
.val-item h4 { margin-bottom:0.4rem; font-size:0.9rem; }

/* ── DASHBOARD ────────────────────────────────────────────────── */
.dashboard { flex-grow:1; display:flex; flex-direction:column; overflow:visible !important; gap:0.25rem; padding-bottom:1.5rem; min-height:min-content; }
.dashboard-header { display:flex; justify-content:space-between; align-items:center; flex-shrink:0; }
.dashboard-header h2 { font-size:1.05rem; font-weight:700; color:#0f172a; display:flex; gap:8px; align-items:center; }

/* Stat Cards Grid */
.stats-grid {
    display:grid; grid-template-columns:repeat(6,1fr); gap:0.35rem; flex-shrink:0;
}
.stat-card {
    background:var(--card); padding:0.35rem 0.5rem; border-radius:8px;
    box-shadow:0 2px 8px rgba(0,0,0,0.06); border:1px solid var(--border);
    border-top:3px solid; cursor:pointer; transition:all 0.2s;
    display:flex; align-items:center; gap:0.4rem;
}
.stat-card:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,0.1); }
.stat-icon { width:26px; height:26px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:0.8rem; flex-shrink:0; }
.stat-card h5 { font-size:0.68rem; color:var(--text-muted); font-weight:600; margin-bottom:1px; white-space:nowrap; }
.stat-card h2 { font-size:1.15rem; font-weight:800; color:#0f172a; line-height:1; margin-bottom:1px; }
.stat-card p { font-size:0.62rem; color:var(--text-muted); }

/* Financial Summary Bar */
.fin-summary {
    background:var(--card); padding:0.35rem 1rem; border-radius:12px;
    box-shadow:0 2px 8px rgba(0,0,0,0.06); border:1px solid var(--border);
    display:flex; align-items:center; gap:0; flex-shrink:0;
}
.fin-card { flex:1; text-align:center; padding:0.3rem 0.5rem; }
.fin-card span { display:block; font-size:0.72rem; color:var(--text-muted); font-weight:500; margin-bottom:2px; text-transform:uppercase; letter-spacing:0.5px; }
.fin-card strong { font-size:1.2rem; font-weight:800; color:#0f172a; }
.fin-card.danger strong { color:var(--danger); }
.fin-divider { width:1px; background:var(--border); height:34px; }

/* Results area */
.results-container { display:flex; flex-direction:column; gap:1.2rem; flex-grow:1; overflow:visible; }
.chart-container {
    flex-shrink:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
}
.tables-wrapper { flex:1; display:flex; flex-direction:column; height:100%; overflow:hidden; }
.table-container {
    background:var(--card); padding:1.2rem; border-radius:var(--radius);
    box-shadow:0 2px 8px rgba(0,0,0,0.06); border:1px solid var(--border);
    overflow-y:auto; height:100%;
}
.table-container h3 { font-size:0.95rem; margin-bottom:0.2rem; display:flex; gap:8px; align-items:center; }
.subtitle { font-size:0.8rem; color:var(--text-muted); margin-bottom:0.8rem; }
.data-table { width:100%; border-collapse:collapse; font-size:0.82rem; }
.data-table th,.data-table td { padding:0.75rem 0.8rem; text-align:left; border-bottom:1px solid var(--border); }
.data-table th { background:#f8fafc; color:var(--text-muted); font-weight:600; font-size:0.75rem; text-transform:uppercase; letter-spacing:0.5px; position:sticky; top:0; }
.data-table tbody tr:hover { background:#f1f5f9; }
.badge-ai { background:rgba(245,158,11,0.12); color:#d97706; padding:0.25rem 0.6rem; border-radius:20px; font-size:0.72rem; font-weight:700; }

/* ── PAGES: How To Use + Settings ─────────────────────────────── */
.page-panel { flex-grow:1; display:flex; flex-direction:column; overflow-y:auto; }

/* Language bar */
.lang-bar {
    display:flex; align-items:center; gap:0.8rem; background:var(--card);
    padding:0.8rem 1.2rem; border-radius:10px; border:1px solid var(--border);
    margin-bottom:1.5rem; flex-shrink:0; width:fit-content;
}
.lang-bar label { font-size:0.85rem; font-weight:600; color:var(--text-muted); }
.lang-bar select { border:1px solid var(--border); border-radius:8px; padding:0.3rem 0.6rem; font-size:0.85rem; background:var(--bg); cursor:pointer; }

/* Guide content */
.guide-content { display:flex; flex-direction:column; gap:1.2rem; padding-bottom:2rem; }
.guide-step {
    background:var(--card); border-radius:var(--radius); border:1px solid var(--border);
    box-shadow:0 2px 8px rgba(0,0,0,0.05); overflow:hidden;
}
.guide-step-header {
    display:flex; align-items:center; gap:1rem;
    padding:1rem 1.5rem; border-bottom:1px solid var(--border);
    background:linear-gradient(135deg,#f8fafc,#f1f5f9);
}
.step-num {
    width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,#3b82f6,#2563eb);
    color:white; font-weight:800; font-size:0.95rem;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.guide-step-header h4 { font-size:0.95rem; font-weight:700; }
.guide-step-body { padding:1.2rem 1.5rem; font-size:0.87rem; line-height:1.8; color:#334155; }
.guide-step-body ul { padding-left:1.5rem; margin-top:0.5rem; }
.guide-step-body li { margin-bottom:0.4rem; }

/* Sheet description row (red bar) — used in Excel */
.sheet-desc { background:#fff1f2; border-left:4px solid #ef4444; padding:0.8rem 1.2rem; border-radius:0 8px 8px 0; margin-bottom:1rem; font-size:0.82rem; color:#991b1b; font-weight:500; }

/* Settings */
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.2rem; padding-bottom:2rem; }
.settings-card {
    background:var(--card); padding:1.5rem; border-radius:var(--radius);
    box-shadow:0 2px 8px rgba(0,0,0,0.06); border:1px solid var(--border);
}
.settings-card.full-width { grid-column:1/-1; }
.settings-card h4 { font-size:0.95rem; font-weight:700; margin-bottom:0.5rem; display:flex; gap:8px; align-items:center; color:#0f172a; }
.settings-card p { font-size:0.83rem; color:var(--text-muted); margin-bottom:1rem; line-height:1.5; }
.setting-control { display:flex; align-items:center; gap:1rem; margin-bottom:0.5rem; }
.setting-control input[type=range] { flex:1; accent-color:var(--primary); }
.setting-badge { background:#eff6ff; color:var(--primary); padding:0.2rem 0.7rem; border-radius:20px; font-weight:700; font-size:0.9rem; min-width:40px; text-align:center; }
.setting-note { font-size:0.75rem; color:#f59e0b; font-weight:500; }

.pricing-card-popular { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.pricing-card-popular:hover { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0,0,0,0.15); }

.pricing-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.pricing-card:hover { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0,0,0,0.15); }

.pricing-card { transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important; border: 2px solid #e2e8f0 !important; cursor: pointer; }
.pricing-card:hover { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(0,0,0,0.15); border-color: #3b82f6 !important; }
.pricing-card.selected-plan { border-color: #10b981 !important; box-shadow: 0 15px 35px rgba(16, 185, 129, 0.2); transform: translateY(-5px); }

@keyframes popIn { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
#pricing-container:hover .pricing-card { transform: none; box-shadow: 0 10px 25px rgba(0,0,0,0.05); border-color: #e2e8f0 !important; }
.pricing-card.selected-plan { transform: translateY(-10px); box-shadow: 0 15px 35px rgba(16, 185, 129, 0.2); border-color: #10b981 !important; }

/* ── COLLAPSIBLE SEO FOOTER ACCORDION ─────────────── */
.seo-footer-accordion summary::-webkit-details-marker { display:none; }
.seo-footer-accordion summary::marker { display:none; }
.seo-footer-accordion summary .fa-chevron-down { transition: transform 0.25s ease; }
.seo-footer-accordion[open] summary .fa-chevron-down { transform: rotate(180deg); }
.seo-footer-accordion[open] summary { border-bottom: 1px solid #1e293b; }

/* ── FLOATING BOUNCING SCROLL ARROW ──────────────── */
@keyframes bounceJump {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-4px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.bouncing-btn, #btn-scroll-indicator {
    animation: bounceJump 2.2s infinite ease-in-out !important;
    transition: all 0.25s ease;
}
.bouncing-btn:hover, #btn-scroll-indicator:hover {
    transform: scale(1.1);
    background: rgba(59,130,246,0.75) !important;
    box-shadow: 0 6px 18px rgba(59,130,246,0.5) !important;
}

/* ── BOTTOM DRAWER SLIDE-UP ANIMATION ────────────── */
@keyframes slideUpDrawer {
    from {
        transform: translateY(100%);
        opacity: 0.5;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ── ULTRA-PREMIUM AURORA & GLASS STYLES ─────────── */
@keyframes auroraOrb1 {
    0%, 100% { transform: translate(-40px, -30px) scale(1); opacity: 0.35; }
    50% { transform: translate(50px, 40px) scale(1.25); opacity: 0.65; }
}

@keyframes auroraOrb2 {
    0%, 100% { transform: translate(40px, 30px) scale(1.15); opacity: 0.3; }
    50% { transform: translate(-40px, -50px) scale(0.9); opacity: 0.6; }
}

@keyframes radarPing {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.radar-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    animation: radarPing 2s infinite;
    margin-right: 7px;
    vertical-align: middle;
}

.premium-card-wrapper {
    position: relative;
    max-width: 530px;
    width: 100%;
    border-radius: 28px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(59,130,246,0.7) 0%, rgba(139,92,246,0.35) 45%, rgba(255,255,255,0.12) 100%);
    box-shadow: 0 35px 90px -15px rgba(0, 0, 0, 0.9), 0 0 45px -10px rgba(59, 130, 246, 0.35);
    z-index: 10;
}

.premium-card-inner {
    background: rgba(10, 18, 38, 0.82);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 27px;
    padding: 2.5rem 2.2rem 2rem 2.2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.erp-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    color: #94a3b8;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.erp-pill:hover {
    background: rgba(59,130,246,0.15);
    border-color: rgba(59,130,246,0.4);
    color: #60a5fa;
    transform: translateY(-1px);
}
