/* --------------------------------------------------
   Interactive Sales Report Dashboard - Stylesheet
   Design System: Slate Dark Modern Executive Theme
   Optimized for Readability, Contrast, and Premium Appeal
-------------------------------------------------- */

:root {
    --bg-primary: #0f172a;      /* slate-900 */
    --bg-secondary: #1e293b;    /* slate-800 */
    --bg-card: #1e293b;         /* slate-800 */
    --border-color: #334155;    /* slate-700 */
    --border-hover: #475569;    /* slate-600 */
    
    --text-primary: #f8fafc;    /* slate-50 */
    --text-secondary: #cbd5e1;  /* slate-300 */
    --text-muted: #94a3b8;      /* slate-400 */
    
    --primary: #0ea5e9;         /* sky-500 */
    --primary-glow: rgba(14, 165, 233, 0.15);
    --secondary: #a855f7;       /* purple-500 */
    
    --success: #2ebd59;         /* bright green */
    --success-bg: rgba(46, 189, 89, 0.15);
    --warning: #f59e0b;         /* amber-500 */
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #f84b65;          /* bright red */
    --danger-bg: rgba(248, 75, 101, 0.15);
    
    --sidebar-width: 260px;
    --ai-panel-width: 330px;
    
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition-speed: 0.2s;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* Dashboard Container Layout */
.dashboard-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* --------------------------------------------------
   SIDEBAR STYLES
-------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    font-size: 24px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary));
}

.brand-text h2 {
    font-family: var(--font-header);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.brand-text span {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex-grow: 1;
    padding: 24px 12px;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition-speed);
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: var(--text-primary);
    background-color: var(--primary-glow);
    border: 1px solid rgba(14, 165, 233, 0.35);
}

.nav-item.active i {
    color: var(--primary);
    filter: drop-shadow(0 0 5px var(--primary));
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-header);
    color: var(--text-primary);
}

.user-info h4 {
    font-size: 13px;
    font-weight: 600;
}

.user-info span {
    font-size: 11px;
    color: var(--text-muted);
}

/* --------------------------------------------------
   MAIN LAYOUT STYLES
-------------------------------------------------- */
.main-layout {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

/* Top Bar */
.top-bar {
    height: 70px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
}

.top-bar-title h1 {
    font-family: var(--font-header);
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
}

.top-bar-title p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.current-date-display span {
    font-weight: 600;
    color: var(--primary);
}

.filters-container {
    display: flex;
    gap: 10px;
}

.btn {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed);
}

.btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-hover);
}

.btn-filter-toggle {
    border-color: rgba(14, 165, 233, 0.4);
    background-color: rgba(14, 165, 233, 0.05);
}

.btn-filter-toggle:hover {
    background-color: rgba(14, 165, 233, 0.12);
}

.btn-reset {
    color: var(--text-secondary);
}

.filter-panel {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    transition: all var(--transition-speed) ease-in-out;
    opacity: 1;
    max-height: 500px;
    overflow: visible;
}

.dataset-filters-wrapper {
    background-color: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.filters-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.dataset-title-group h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.dataset-title-group p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.dataset-filters-wrapper .filter-panel {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    transition: all var(--transition-speed);
}

.dataset-filters-wrapper .filter-panel.hidden {
    padding: 0 24px;
    max-height: 0;
    border-top-width: 0;
    opacity: 0;
    overflow: hidden;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-speed);
}

.filter-select:focus {
    border-color: var(--primary);
}

.range-inputs {
    display: flex;
    gap: 8px;
}

.filter-input-number {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    width: 50%;
}

.filter-input-number:focus {
    border-color: var(--primary);
}

/* --------------------------------------------------
   CUSTOM SEARCHABLE DROPDOWNS
-------------------------------------------------- */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-select {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: border-color var(--transition-speed);
}

.custom-dropdown-select:hover {
    border-color: var(--border-hover);
}

.custom-dropdown-select .placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.custom-dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 220px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    z-index: 1000;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.6);
}

.custom-dropdown-list.hidden {
    display: none;
}

.custom-dropdown-search-input {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    width: 100%;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.custom-dropdown-options-container {
    overflow-y: auto;
    max-height: 240px;
    padding: 4px 0;
}

.custom-dropdown-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color var(--transition-speed);
    color: var(--text-primary);
}

.custom-dropdown-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.custom-dropdown-option.selected {
    background-color: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.custom-dropdown-option input {
    cursor: pointer;
    accent-color: var(--primary);
}


/* --------------------------------------------------
   CONTENT PANEL WRAPPER
-------------------------------------------------- */
.content-wrapper {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    width: 100%;
}

.content-panels {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    height: 100%;
    background-color: var(--bg-primary);
}

.panel-section {
    display: none;
}

.panel-section.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------
   KPI CARD GRID
-------------------------------------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.kpi-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed), border-color var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary);
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.kpi-card[data-kpi="sales"]::before { background-color: var(--primary); }
.kpi-card[data-kpi="volume"]::before { background-color: var(--secondary); }
.kpi-card[data-kpi="asp"]::before { background-color: var(--warning); }
.kpi-card[data-kpi="stores"]::before { background-color: var(--success); }

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card-header .icon {
    font-size: 16px;
    color: var(--text-muted);
}

.kpi-card-body {
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.kpi-card-body h3 {
    font-family: var(--font-header);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

.trend {
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
}

.trend.positive {
    color: var(--success);
    background-color: var(--success-bg);
}

.trend.negative {
    color: var(--danger);
    background-color: var(--danger-bg);
}

.subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Ranking Highlights Row */
.ranking-highlights-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.highlight-badge {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: var(--card-shadow);
}

.highlight-badge .lbl {
    color: var(--text-muted);
    font-weight: 600;
}

.highlight-badge .val {
    color: var(--primary);
    font-weight: 700;
}

/* --------------------------------------------------
   GRID LAYOUTS & CARDS
-------------------------------------------------- */
.grid-layout-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-layout-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.span-2 {
    grid-column: span 2;
}

.mt-4 { margin-top: 20px; }
.mb-4 { margin-bottom: 20px; }
.flex-col { display: flex; flex-direction: column; }
.flex-row-between { display: flex; justify-content: space-between; align-items: center; }
.justify-space-between { justify-content: space-between; }
.flex-grow-1 { flex-grow: 1; }

.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.chart-card.full-width {
    width: 100%;
}

.chart-card-header {
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 8px;
}

.chart-card-header h3 {
    font-family: var(--font-header);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-card-header p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.chart-card-body {
    flex-grow: 1;
    position: relative;
    min-height: 250px;
}

/* --------------------------------------------------
   TABLES & Readability Styles
-------------------------------------------------- */
.overflow-x { overflow-x: auto; }
.overflow-y { overflow-y: auto; }
.max-h-300 { max-height: 300px; }

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    background-color: #131a26;
    color: var(--text-secondary);
    font-weight: 700;
    padding: 12px 14px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* Double-decker table header specific sticky positions */
.data-table thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 12;
    background-color: #131a26;
}

/* Rowspan elements (like Rank, Brand Name, SKU Name) in the first row need higher z-index and stickiness */
.data-table thead tr:first-child th[rowspan="2"] {
    position: sticky;
    top: 0;
    z-index: 13;
    background-color: #131a26;
}

/* Second row headers (like 2024, 2025, 2026, YoY) must stick below the first row */
.data-table thead tr:nth-child(2) th {
    position: sticky;
    top: 38px; /* height of first row headers */
    z-index: 11;
    background-color: #131a26;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background-color var(--transition-speed);
}

.data-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.01);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.data-table tr.clickable {
    cursor: pointer;
}

.data-table tr.clickable:hover td {
    color: var(--primary);
}

.search-input {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    width: 260px;
    outline: none;
    transition: border-color var(--transition-speed);
}

.search-input:focus {
    border-color: var(--primary);
}

.btn-table-action {
    background-color: var(--primary-glow);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background-color var(--transition-speed);
}

.btn-table-action:hover {
    background-color: rgba(14, 165, 233, 0.25);
    text-decoration: none;
}

/* Conditional Formatting for store ranking table */
.ranking-table td.rank-cell {
    font-weight: 800;
    color: var(--text-muted);
}

.ranking-table tr:nth-child(1) td.rank-cell { color: #ffd700; font-size: 14px; font-weight: 900; } /* Gold Medal */
.ranking-table tr:nth-child(2) td.rank-cell { color: #cbd5e1; font-size: 13.5px; } /* Silver */
.ranking-table tr:nth-child(3) td.rank-cell { color: #b45309; font-size: 13px; } /* Bronze */

.data-bar-container {
    width: 100%;
    background-color: rgba(255,255,255,0.04);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.data-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
}

/* --------------------------------------------------
   OPPORTUNITY & RISK ANALYSIS SECTION
-------------------------------------------------- */
.portfolio-cats-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.port-cat-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.port-cat-item:hover {
    transform: translateX(4px);
    border-color: var(--border-hover);
}

.port-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.port-header .badge {
    font-family: var(--font-header);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.port-header .count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.port-cat-item.star .badge { background-color: var(--success); }
.port-cat-item.profit .badge { background-color: var(--primary); }
.port-cat-item.growth .badge { background-color: var(--warning); color: var(--bg-primary); }
.port-cat-item.risk .badge { background-color: var(--danger); }

.port-cat-item .desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* --------------------------------------------------
   AI INSIGHT PANEL (RIGHT SIDEBAR)
-------------------------------------------------- */
.ai-insight-panel {
    width: var(--ai-panel-width);
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
}

.ai-panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-brain-icon {
    color: var(--secondary);
    filter: drop-shadow(0 0 5px var(--secondary));
    font-size: 18px;
}

.ai-panel-header h3 {
    font-family: var(--font-header);
    font-size: 16px;
    font-weight: 700;
}

.ai-status {
    font-size: 10px;
    font-weight: 700;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pulse-dot {
    font-size: 6px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.ai-panel-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.ai-meta-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.meta-item .label {
    color: var(--text-muted);
}

.meta-item .val {
    font-weight: 600;
}

.meta-item .val.highlight {
    color: var(--primary);
}

/* Accordion cards for AI answers */
.ai-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color var(--transition-speed);
}

.ai-card.open {
    border-color: rgba(168, 85, 247, 0.4);
}

.ai-card-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    user-select: none;
}

.ai-card-header .toggle-icon {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition-speed);
}

.ai-card.open .ai-card-header .toggle-icon {
    transform: rotate(180deg);
}

.ai-card-body {
    padding: 14px 16px;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    border-top: 1px solid var(--border-color);
    display: none;
    background-color: rgba(0, 0, 0, 0.08);
}

.ai-card.open .ai-card-body {
    display: block;
}

.ai-highlight-stat {
    font-weight: 700;
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

.ai-bullet-list {
    list-style: none;
    margin-top: 6px;
}

.ai-bullet-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 8px;
}

.ai-bullet-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 900;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --------------------------------------------------
   DATASET SWITCHER (SIDEBAR) & LOADING OVERLAY
-------------------------------------------------- */
.nav-group {
    margin-bottom: 20px;
}

.nav-group.tops {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.nav-group.ims {
    margin-top: 16px;
    margin-bottom: 24px;
}

.nav-group.ims .nav-group-header {
    color: var(--secondary);
}

.nav-group.ims .nav-item.active {
    border: 1px solid rgba(168, 85, 247, 0.35) !important;
    background-color: rgba(168, 85, 247, 0.15) !important;
}

.nav-group.ims .nav-item.active i {
    color: var(--secondary) !important;
    filter: drop-shadow(0 0 5px var(--secondary)) !important;
}

.nav-group-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    padding: 0 16px 8px 16px;
    opacity: 0.8;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.85); /* slate-900 transparent */
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(14, 165, 233, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    font-family: var(--font-header);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

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

/* --------------------------------------------------
   EXECUTIVE SUMMARY & SWOT MATRIX STYLING
-------------------------------------------------- */
.swot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.swot-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.swot-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
}

/* SWOT specific card borders and icon colors */
.swot-strength { border-left: 4px solid var(--success); }
.swot-strength .icon { color: var(--success); }

.swot-weakness { border-left: 4px solid var(--danger); }
.swot-weakness .icon { color: var(--danger); }

.swot-opportunity { border-left: 4px solid var(--primary); }
.swot-opportunity .icon { color: var(--primary); }

.swot-threat { border-left: 4px solid var(--warning); }
.swot-threat .icon { color: var(--warning); }

.swot-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.swot-list li {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.swot-list li i {
    margin-top: 3px;
    font-size: 11px;
}

.strategic-card {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05), rgba(168, 85, 247, 0.05));
    border: 1px dashed var(--primary);
}

.summary-brief-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.summary-brief-card h3 {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-brief-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* Password Protection Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.5s ease-in-out;
}

.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-icon {
    font-size: 3rem;
    color: #f59e0b;
    margin-bottom: 1.5rem;
}

.login-card h2 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.login-card p {
    color: #94a3b8;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.login-input-group {
    position: relative;
    display: flex;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px;
    align-items: center;
}

.login-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    padding: 12px 16px;
    font-size: 1rem;
}

.login-input-group button {
    background: #f59e0b;
    color: #0f172a;
    border: none;
    outline: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.2s, background-color 0.2s;
}

.login-input-group button:hover {
    background: #d97706;
    transform: scale(1.03);
}

.login-error {
    color: #ef4444 !important;
    margin-top: 1rem;
    font-size: 0.85rem !important;
    animation: shake 0.4s ease-in-out;
}

.login-error.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}


