/* ==========================================================================
   Dagyan Centralized Style Core — Pure Vanilla (No External Dependencies)
   ========================================================================== */

:root {
    --bg-main: #09090b;
    --bg-card: #121214;
    --bg-nested: #0c0c0e;
    --border-base: #1f1f23;
    --border-accent: #2d2d37;
    --text-primary: #e4e4e7;
    --text-muted: #a1a1aa;
    --text-dark: #8a8a93;
    --brand-blue: #007aff;
    --brand-blue-hover: #0062cc;
    --brand-green: #30d158;
    --max-width: 1000px;
}

html, body {
    margin: 0; padding: 0; width: 100%; min-height: 100vh;
    background-color: var(--bg-main); color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; box-sizing: border-box; }
*, *:before, *:after { box-sizing: border-box; }

/*.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; width: 100%; }*/
.container { max-width: 1400px; margin: 0 auto; padding: 0 30px; }
        

/* ==========================================================================
   Header & Global Menu Mechanics
   ========================================================================== */
.site-nav {
    border-bottom: 1px solid var(--border-base);
    background-color: rgba(12, 12, 14, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 1000; height: 64px;
}

.nav-wrapper { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand-anchor { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #ffffff; }
.brand-text { font-weight: 900; letter-spacing: -0.05em; font-size: 16px; }
.brand-badge { font-family: monospace; font-size: 10px; color: var(--brand-blue); background-color: rgba(0, 122, 255, 0.1); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(0, 122, 255, 0.2); }

.nav-group { display: flex; align-items: center; gap: 24px; }
.nav-link { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-decoration: none; padding-bottom: 4px; transition: all 0.2s ease; border-bottom: 2px solid transparent; color: var(--text-dark); }
.nav-link.active, .nav-link:hover { color: #ffffff; }
.nav-link.active { border-bottom-color: var(--brand-blue); }

.btn-portal { font-size: 12px; font-weight: 600; text-decoration: none; padding: 6px 16px; border-radius: 6px; transition: all 0.2s ease; border: 1px solid var(--border-accent); background-color: #1c1c21; color: #ffffff; cursor: pointer; }
.btn-portal:hover { background-color: #25252b; }
.btn-lang { background: none; border: none; color: var(--text-dark); cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.btn-lang:hover { color: var(--brand-blue); }

.btn-api { background: #1c1c1e; border: 1px solid #33333a; color: #ffffff; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600; text-transform: uppercase; transition: all 0.2s; }
.btn-api:hover { background: #0a84ff; border-color: #0a84ff; }


/* ==========================================================================
   Document Layout Typography & Cards
   ========================================================================== */
.main-content { flex-grow: 1; padding-top: 80px; padding-bottom: 80px; }
.section-hero { max-width: 768px; margin: 0 auto 64px auto; }
.section-hero h1 { font-size: 44px; font-weight: 800; margin-bottom: 24px; line-height: 1.1; }
.section-hero p { font-size: 16px; color: var(--text-muted); line-height: 1.6; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; gap: 24px; } .section-hero h1 { font-size: 32px; } }

.card { background-color: var(--bg-card); border: 1px solid var(--border-base); border-radius: 8px; padding: 32px; }
.card h3 { font-size: 20px; font-weight: 700; margin-bottom: 16px; margin-top: 0; }
.card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0; }

.btn-action { display: inline-block; font-size: 12px; font-weight: 600; text-align: center; text-decoration: none; padding: 12px 32px; border-radius: 6px; cursor: pointer; background-color: var(--brand-blue); color: #ffffff; border: none; width: 100%; margin-top: auto; box-shadow: 0 10px 15px -3px rgba(0, 122, 255, 0.2); transition: background-color 0.2s; }
.btn-action:hover { background-color: var(--brand-blue-hover); }

/* ==========================================================================
   Footer & Modals
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border-base); background-color: var(--bg-nested); padding: 32px 0; }
.footer-wrapper { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-meta { font-family: monospace; font-size: 10px; color: var(--text-dark); }
.footer-links { display: flex; gap: 24px; }
.btn-trigger-modal { background: none; border: none; color: var(--text-dark); font-family: monospace; font-size: 10px; cursor: pointer; padding: 0; }
.btn-trigger-modal:hover { color: var(--text-primary); }

.modal-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000; background-color: rgba(5, 5, 6, 0.85); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.modal-layer.active { opacity: 1; pointer-events: auto; }
.modal-surface { background-color: #16161a; border: 1px solid var(--border-accent); width: 100%; max-width: 680px; border-radius: 8px; padding: 24px; position: relative; max-height: 80vh; display: flex; flex-direction: column; transform: scale(0.95); transition: transform 0.2s ease; }
.modal-layer.active .modal-surface { transform: scale(1); }
.modal-close { position: absolute; right: 24px; top: 20px; background: none; border: none; color: var(--text-dark); font-size: 24px; cursor: pointer; }
.modal-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-family: monospace; border-bottom: 1px solid var(--border-base); padding-bottom: 12px; margin-bottom: 16px; margin-top: 0; color: #fff;}
.modal-body { font-family: monospace; font-size: 12px; color: var(--text-muted); line-height: 1.6; overflow-y: auto; white-space: pre-wrap; }

/* ==========================================================================
   Secure Authentication Form & SSO
   ========================================================================== */
.form-group { margin-bottom: 20px; text-align: left; }
.form-group-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.input-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-family: ui-monospace, monospace; }
.input-field { width: 100%; background-color: var(--bg-main); border: 1px solid var(--border-accent); border-radius: 4px; font-size: 14px; color: #ffffff; padding: 10px 14px; outline: none; transition: border-color 0.2s ease; box-sizing: border-box; }
.input-field:focus { border-color: var(--brand-blue); }
.link-inline { font-size: 10px; color: var(--brand-blue); text-decoration: none; font-family: ui-monospace, monospace; }
.link-inline:hover { text-decoration: underline; }

.sso-divider { display: flex; align-items: center; text-align: center; color: var(--text-dark); font-size: 10px; font-family: ui-monospace, monospace; text-transform: uppercase; margin: 24px 0; }
.sso-divider::before, .sso-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-base); }
.sso-divider:not(:empty)::before { margin-right: 12px; }
.sso-divider:not(:empty)::after { margin-left: 12px; }
.sso-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.btn-sso { background-color: var(--bg-main); border: 1px solid var(--border-accent); border-radius: 6px; padding: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s ease; }
.btn-sso:hover { background-color: #1c1c21; border-color: var(--text-dark); }
.sso-svg { width: 18px; height: 18px; }
.error-alert { color: #ff453a; font-family: ui-monospace, monospace; font-size: 11px; text-align: center; margin-top: 12px; }

/* ==========================================================================
   SPA Architecture & Dropdowns
   ========================================================================== */
.view-section { display: none; animation: fadeIn 0.4s ease-out; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background-color: var(--bg-nested); min-width: 180px; border: 1px solid var(--border-accent); border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); z-index: 2000; padding: 8px; margin-top: 12px; }
.dropdown::after { content: ''; position: absolute; width: 100%; height: 12px; bottom: -12px; left: 0; }
.dropdown:hover .dropdown-content { display: block; animation: dropFade 0.2s ease; }
@keyframes dropFade { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dropdown-item { display: block; padding: 10px 16px; color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 600; border-radius: 4px; transition: all 0.2s; cursor: pointer; }
.dropdown-item:hover, .dropdown-item.active { background-color: var(--border-base); color: #ffffff; }

/* ==========================================================================
   Product UI Components (DIE)
   ========================================================================== */
.risk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; }
@media (max-width: 900px) { .risk-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .risk-grid { grid-template-columns: 1fr; } }
.risk-card { background-color: var(--bg-card); border: 1px solid var(--border-base); border-radius: 8px; padding: 20px; border-top-width: 3px; }
.risk-critical { border-top-color: #ff453a; }
.risk-high     { border-top-color: #ff9f0a; }
.risk-moderate { border-top-color: #0a84ff; }
.risk-terminal { border-top-color: #636366; }
.risk-label { font-size: 10px; font-family: monospace; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; display: block; }
.risk-critical .risk-label { color: #ff453a; }
.risk-high .risk-label     { color: #ff9f0a; }
.risk-moderate .risk-label { color: #0a84ff; }
.risk-terminal .risk-label { color: #8a8a93; }
.risk-card h4 { font-size: 14px; margin-bottom: 8px; font-weight: 700; color: #ffffff; margin-top: 0;}
.risk-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 0;}
.pricing-block { background: linear-gradient(145deg, #121215 0%, #0a0a0c 100%); border: 1px solid var(--border-accent); border-radius: 12px; padding: 40px; text-align: center; max-width: 500px; margin: 64px auto 0 auto; }
.price-tag { font-size: 48px; font-weight: 900; color: #ffffff; margin: 16px 0; letter-spacing: -0.05em; }
.price-mo { font-size: 14px; color: var(--text-dark); font-weight: 500; letter-spacing: normal;}

/* ==========================================================================
   CLIENT PORTAL (Gemini-Style Layout)
   ========================================================================== */
.portal-layout { display: flex; height: calc(100vh - 64px); overflow: hidden; background-color: var(--bg-main); border-top: 1px solid var(--border-base); }
.portal-sidebar { width: 300px; background-color: var(--bg-nested); border-right: 1px solid var(--border-base); display: flex; flex-direction: column; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; }
.portal-sidebar.collapsed { width: 68px; }
.sidebar-header { padding: 16px; display: flex; align-items: center; border-bottom: 1px solid var(--border-base); height: 60px; box-sizing: border-box; overflow: hidden; }
.btn-toggle-menu { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; flex-shrink: 0; }
.btn-toggle-menu:hover { background-color: var(--border-base); color: #fff; }
.sidebar-title { font-size: 14px; font-weight: 700; color: #fff; margin-left: 12px; white-space: nowrap; transition: opacity 0.2s; }
.portal-sidebar.collapsed .sidebar-title { opacity: 0; pointer-events: none; }
.sidebar-nav { flex-grow: 1; padding: 16px 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overflow-x: hidden; }
.sidebar-link { display: flex; align-items: center; padding: 10px 12px; color: var(--text-muted); text-decoration: none; border-radius: 6px; transition: all 0.2s; white-space: nowrap; }
.sidebar-link:hover { background-color: rgba(255,255,255,0.05); color: #fff; }
.sidebar-link.active { background-color: rgba(0, 122, 255, 0.1); color: var(--brand-blue); font-weight: 600; }
.sidebar-link.disabled { opacity: 0.4; cursor: not-allowed; }
.sidebar-icon { width: 20px; height: 20px; flex-shrink: 0; margin-right: 16px; }
.portal-sidebar.collapsed .sidebar-link .link-text { opacity: 0; pointer-events: none; }
.portal-canvas { flex-grow: 1; padding: 40px; overflow-y: auto; background-color: var(--bg-main); position: relative;}
.portal-panel { display: none; animation: fadeIn 0.3s ease; }
.portal-panel.active { display: block; }
.sandbox-locked { opacity: 0.5; pointer-events: none; position: relative; }

/* Snapshot Grid */
.snapshot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.snapshot-card { background-color: var(--bg-card); border: 1px solid var(--border-base); border-radius: 8px; padding: 20px; cursor: pointer; transition: all 0.2s; }
.snapshot-card:hover:not(.sandbox-locked) { border-color: var(--brand-blue); transform: translateY(-2px); }

/* ==========================================================================
   DASHBOARD ANALYTICS & WIDGETS
   ========================================================================== */
.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.kpi-card { background: var(--bg-card); border: 1px solid var(--border-base); border-radius: 6px; padding: 16px; position: relative; }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; border-radius: 6px 0 0 6px; }
.kpi-card.b-blue::before { background: var(--brand-blue); }
.kpi-card.b-green::before { background: #30d158; }
.kpi-card.b-red::before { background: #ff453a; }
.kpi-card.b-purple::before { background: #bf5af2; }
.kpi-card.b-nri::before { background: #ff9f0a; }
.kpi-label { font-size: 10px; color: var(--text-dark); text-transform: uppercase; font-weight: 700; margin-bottom: 8px; letter-spacing: 0.05em;}
.kpi-value { font-size: 28px; font-weight: 300; color: #ffffff; letter-spacing: -0.05em; }

/*.top-states-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.top-states-table th { color: var(--text-dark); border-bottom: 1px solid var(--border-base); padding-bottom: 8px; text-transform: uppercase; font-size: 10px; font-weight: 700; position: sticky; top: 0; background: var(--bg-card);}
.top-states-table td { padding: 12px 0; border-bottom: 1px solid var(--border-base); color: var(--text-primary); }
/* FULL SCROLLABLE STATES TABLE STYLING */
.table-scroll-container { width: 100%; height: 100%; overflow-y: auto; padding-right: 5px; }
.table-scroll-container::-webkit-scrollbar { width: 6px; }
.table-scroll-container::-webkit-scrollbar-thumb { background-color: #2d2d37; border-radius: 3px; }
.top-states-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.top-states-table th { color: #8a8a93; border-bottom: 1px solid #232329; padding-bottom: 8px; text-transform: uppercase; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; position: sticky; top: 0; background: #121215; z-index: 2; }
.top-states-table td { padding: 10px 0; border-bottom: 1px solid #1c1c21; color: #e2e2e9; }
.top-states-table tr:last-child td { border-bottom: none; }

.table.dataTable { background-color: #121215 !important; border-collapse: collapse !important; border-radius: 8px; overflow: hidden; font-size: 13px; margin-top: 0 !important; }
.table.dataTable thead th { background-color: #1a1a1e !important; color: #ffffff !important; font-weight: 600; padding: 14px; border-bottom: 1px solid #2d2d37 !important; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.table.dataTable tbody td { padding: 12px 14px !important; border-bottom: 1px solid #1c1c21 !important; color: #d1d1d6; }
.table.dataTable tbody tr { background-color: #121215 !important; }
.table.dataTable tbody tr:hover { background-color: #1c1c22 !important; }
        
/* Dynamic Risk Badges */
.badge { display: inline-block; padding: 4px 8px; font-size: 11px; font-weight: 700; border-radius: 4px; text-align: center; letter-spacing: 0.05em; font-family: monospace; }
.badge.CRITICAL { background-color: rgba(255, 59, 48, 0.15); color: #ff453a; border: 1px solid rgba(255, 59, 48, 0.3); }
.badge.HIGH { background-color: rgba(255, 159, 10, 0.15); color: #ff9f0a; border: 1px solid rgba(255, 159, 10, 0.3); }
.badge.MODERATE { background-color: rgba(48, 209, 88, 0.15); color: #30d158; border: 1px solid rgba(48, 209, 88, 0.3); }
.badge.TERMINAL { background-color: rgba(142, 142, 147, 0.15); color: #ebebf5; border: 1px solid rgba(142, 142, 147, 0.3); }
.filter-state-indicator-badge { background: rgba(48, 209, 88, 0.1); border: 1px solid #30d158; color: #30d158; padding: 4px 12px; border-radius: 4px; font-family: monospace; font-size: 11px; font-weight: bold; margin-left: 15px; display: none; }
.dataTables_wrapper .dataTables_filter { display: none; }
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { color: #8a8a93 !important; margin-top: 15px; font-size: 12px; }
.filters th { padding: 8px 10px !important; border-top: none !important; background-color: #121215 !important; }
.column-filter-input { width: 100%; box-sizing: border-box; background: #18181c; border: 1px solid #2d2d37; color: #ffffff; padding: 8px 10px; border-radius: 4px; font-size: 11px; font-family: monospace; outline: none; transition: border 0.2s; }
.column-filter-input:focus { border-color: #0a84ff; }
select.column-filter-input { cursor: pointer; appearance: auto; }

.map-analysis-workspace { display: grid; grid-template-columns: 560px 1fr; gap: 25px; margin: 25px 0; }
.map-card-panel { background: #121215; border: 1px solid #1c1c21; border-radius: 8px; padding: 25px; display: flex; flex-direction: column; align-items: center; min-height: 560px box-sizing: border-box; overflow: hidden; }
.map-header-box { width: 100%; border-bottom: 1px solid #1c1c21; padding-bottom: 12px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; z-index: 10; }
.map-header-box h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #fff; }
.reset-map-btn { background: rgba(255,255,255,0.05); border: 1px solid #2c2c35; color: #8a8a93; font-size: 10px; font-weight: bold; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.reset-map-btn:hover { background: #0a84ff; color: #fff; border-color: #0a84ff; }
.map-canvas-container { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.map-canvas-container > div { overflow: visible !important; }
.map-canvas-container svg { transform: scale(1.25); transform-origin: center center; transition: transform 0.3s ease; }


