/**
 * IPO Guide — Complete Design System
 * Modern, premium CSS with dark/light mode, CSS variables, responsive grid.
 */

/* ─── CSS Custom Properties ─── */
:root {
    color-scheme: light dark;

    /* Colors - Light Mode */
    --color-primary: #1a56db;
    --color-primary-hover: #1444b8;
    --color-primary-light: #e8effc;
    --color-accent: #7c3aed;
    --color-bg: #f0f2f5;
    --color-surface: #ffffff;
    --color-surface-hover: #f8f9fa;
    --color-text: #1a1a2e;
    --color-text-secondary: #5a5f72;
    --color-text-muted: #8b8fa3;
    --color-border: #e2e5ea;
    --color-border-light: #f0f1f3;
    --color-shadow: rgba(0, 0, 0, 0.06);
    --color-shadow-lg: rgba(0, 0, 0, 0.1);
    --focus-ring: 0 0 0 3px rgba(26, 86, 219, 0.4);

    /* Status Badge Colors */
    --badge-open: #059669;
    --badge-open-bg: #d1fae5;
    --badge-closing: #dc2626;
    --badge-closing-bg: #fee2e2;
    --badge-listing: #7c3aed;
    --badge-listing-bg: #ede9fe;
    --badge-proposed: #d97706;
    --badge-proposed-bg: #fef3c7;
    --badge-upcoming: #2563eb;
    --badge-upcoming-bg: #dbeafe;
    --badge-listed: #047857;
    --badge-listed-bg: #a7f3d0;
    --badge-closed: #6b7280;
    --badge-closed-bg: #f3f4f6;
    --badge-cancelled: #9ca3af;
    --badge-cancelled-bg: #f9fafb;
    --badge-allotment: #ea580c;
    --badge-allotment-bg: #ffedd5;

    /* Rating Colors (Matched to Android App) */
    --rating-recommended: #2F6717;
    --rating-subscribe: #D67700;
    --rating-neutral: #8F77E5;
    --rating-avoid: #FF0000;
    --rating-pending: #9ca3af;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 15px;
    --font-size-sm: 13px;
    --font-size-xs: 11px;
    --font-size-lg: 18px;
    --font-size-xl: 22px;
    --font-size-2xl: 28px;
    --font-size-3xl: 36px;

    /* Layout */
    --container-max: 1280px;
    --header-height: 64px;
}

/* ─── Dark Mode ─── */
[data-theme="dark"] {
    color-scheme: dark;
    --color-primary: #60a5fa;
    --color-primary-hover: #93c5fd;
    --color-primary-light: #1e3a5f;
    --color-accent: #a78bfa;
    --color-bg: #0f1117;
    --color-surface: #1a1d27;
    --color-surface-hover: #22263a;
    --color-text: #e4e6eb;
    --color-text-secondary: #a1a5b5;
    --color-text-muted: #6b7085;
    --color-border: #2a2e3d;
    --color-border-light: #1f2233;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-shadow-lg: rgba(0, 0, 0, 0.5);
    --focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.5);

    --badge-open-bg: #064e3b;
    --badge-closing-bg: #7f1d1d;
    --badge-listing-bg: #4c1d95;
    --badge-proposed-bg: #78350f;
    --badge-upcoming-bg: #1e3a8a;
    --badge-listed-bg: #064e3b;
    --badge-closed-bg: #1f2937;
    --badge-cancelled-bg: #1f2937;
    --badge-allotment-bg: #7c2d12;

    --rating-recommended: #2F6717;
    --rating-subscribe: #FF8000;
    --rating-neutral: #8F77E5;
    --rating-avoid: #FF0000;
    --rating-pending: #9ca3af;
}

/* ─── Accessibility Skip Link ─── */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-md);
    background: var(--color-primary);
    color: #ffffff;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    z-index: 9999;
    font-weight: 600;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: var(--space-sm);
}

/* ─── Focus States ─── */
:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

/* ─── Typography & Headings ─── */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.stat-number, .meta-value, .sub-card-value, .data-table td {
    font-variant-numeric: tabular-nums;
}

/* ─── Font Sizing ─── */
body.font-small { --font-size-base: 13px; }
body.font-large { --font-size-base: 17px; }

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* ─── Modern Themed Scrollbars ─── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

.intraday-timeline::-webkit-scrollbar-track {
    background: var(--color-border-light);
    border-radius: var(--radius-full);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--color-primary-hover); }

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

/* ─── Container ─── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ─── Utility Bar ─── */
.utility-bar {
    background: var(--color-primary);
    color: #fff;
    font-size: var(--font-size-xs);
    padding: var(--space-xs) 0;
}
.utility-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.utility-left .utility-text { opacity: 0.9; }
.utility-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.font-sizer {
    display: flex;
    gap: 2px;
}
.font-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-xs);
    transition: background 0.2s;
}
.font-btn:hover { background: rgba(255,255,255,0.3); }
.theme-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.theme-btn:hover { background: rgba(255,255,255,0.3); }

/* ─── Main Header ─── */
.main-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 4px var(--color-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text);
    font-weight: 700;
}
.logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.logo-img:hover {
    transform: scale(1.04);
}
[data-theme="dark"] .logo-img {
    background: #ffffff;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    filter: none;
}
.logo-name {
    font-size: var(--font-size-lg);
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-tagline {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 400;
    color: var(--color-text-muted);
    line-height: 1;
}

/* ─── Navigation ─── */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
.nav-link {
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
}
.nav-arrow { font-size: 10px; opacity: 0.6; }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px var(--color-shadow-lg);
    min-width: 200px;
    padding: var(--space-sm) 0;
    z-index: 1001;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    transition: all 0.15s ease;
}
.dropdown-menu a:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ─── Mobile Menu Drawer (Chittorgarh Style) ─── */
body.menu-open {
    overflow: hidden !important;
    touch-action: none;
}

.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 88vw;
    max-width: 400px;
    background: var(--color-surface);
    color: var(--color-text);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
    border-left: 1px solid var(--color-border);
    overflow: hidden;
}

.mobile-menu-drawer.open {
    transform: translateX(0);
}

/* Drawer Header */
.m-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    flex-shrink: 0;
}

.m-drawer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 700;
    font-size: 16.5px;
}

.m-drawer-logo-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.m-drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-drawer-action-btn,
.m-drawer-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface-hover);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.m-drawer-action-btn:hover,
.m-drawer-close-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Drawer Content */
.m-drawer-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
}

.m-drawer-content::-webkit-scrollbar {
    width: 5px;
}
.m-drawer-content::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

/* Categorized Accordion Cards (Chittorgarh Style) */
.m-menu-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.m-menu-card:hover {
    border-color: rgba(26, 86, 219, 0.3);
}

.m-menu-card.open {
    border-color: var(--color-border);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.m-menu-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--color-surface);
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
    user-select: none;
}

.m-menu-header:hover {
    background: var(--color-surface-hover);
}

.m-menu-card.open > .m-menu-header {
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.07) 0%, rgba(124, 58, 237, 0.04) 100%);
    border-bottom: 1px solid var(--color-border-light);
}

[data-theme="dark"] .m-menu-card.open > .m-menu-header {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12) 0%, rgba(167, 139, 250, 0.08) 100%);
}

.m-menu-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.m-menu-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.m-menu-icon.ipo-icon { background: #ebf5ff; color: #1a56db; }
.m-menu-icon.corp-icon { background: #f3e8ff; color: #7c3aed; }
.m-menu-icon.learn-icon { background: #ecfdf5; color: #059669; }
.m-menu-icon.app-icon { background: #fff7ed; color: #ea580c; }

[data-theme="dark"] .m-menu-icon.ipo-icon { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
[data-theme="dark"] .m-menu-icon.corp-icon { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
[data-theme="dark"] .m-menu-icon.learn-icon { background: rgba(52, 211, 153, 0.15); color: #34d399; }
[data-theme="dark"] .m-menu-icon.app-icon { background: rgba(251, 146, 60, 0.15); color: #fb923c; }

.m-menu-label {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--color-text);
}

.m-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: transform 0.25s ease;
}

.m-menu-card.open > .m-menu-header .m-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}

.m-menu-body {
    display: none;
    padding: 10px;
    background: var(--color-surface);
}

.m-menu-card.open > .m-menu-body {
    display: block;
}

/* Sub Accordions */
.m-sub-section {
    background: var(--color-surface-hover);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
}

.m-sub-section:last-child {
    margin-bottom: 0;
}

.m-sub-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
}

.m-sub-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-sub-icon {
    display: flex;
    align-items: center;
    color: var(--color-primary);
}

.m-sub-icon.sme-sub-icon {
    color: #059669;
}

[data-theme="dark"] .m-sub-icon.sme-sub-icon {
    color: #34d399;
}

.m-sub-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text);
}

.m-sub-chevron {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    transition: transform 0.25s ease;
}

.m-sub-section.open .m-sub-chevron {
    transform: rotate(180deg);
}

.m-sub-body {
    display: none;
    padding: 0 10px 10px;
}

.m-sub-section.open .m-sub-body {
    display: block;
}

/* Quick Filter Chips (Chittorgarh Style Pills) */
.m-chips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.m-chip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

.m-chip-btn:hover,
.m-chip-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.m-live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: pulseLiveDot 1.5s infinite;
}

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

/* Structured Navigation Items List */
.m-links-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.m-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--color-surface-hover);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.m-nav-item:hover,
.m-nav-item.active {
    background: var(--color-primary-light);
    border-color: rgba(26, 86, 219, 0.2);
}

.m-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ncd-tint { background: #e0e7ff; color: #4338ca; }
.buyback-tint { background: #fae8ff; color: #a21caf; }
.ofs-tint { background: #fef3c7; color: #b45309; }
.rights-tint { background: #e0f2fe; color: #0369a1; }
.faq-tint { background: #ecfdf5; color: #047857; }
.news-tint { background: #fee2e2; color: #b91c1c; }

[data-theme="dark"] .ncd-tint { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
[data-theme="dark"] .buyback-tint { background: rgba(217, 70, 239, 0.15); color: #e879f9; }
[data-theme="dark"] .ofs-tint { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
[data-theme="dark"] .rights-tint { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
[data-theme="dark"] .faq-tint { background: rgba(16, 185, 129, 0.15); color: #34d399; }
[data-theme="dark"] .news-tint { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.m-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.m-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m-item-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m-item-arrow {
    font-size: 16px;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* App Download & Social */
.m-app-banner {
    background: var(--color-surface-hover);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
    margin-bottom: 8px;
}

.m-app-desc {
    font-size: 11.5px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    line-height: 1.35;
}

.m-app-buttons {
    display: flex;
    gap: 8px;
}

.m-store-btn {
    flex: 1;
    display: block;
}

.m-store-img {
    width: 100%;
    height: auto;
    max-height: 36px;
    object-fit: contain;
    border-radius: 4px;
}

.m-app-buttons img.badge-black-bg { display: block !important; }
.m-app-buttons img.badge-white-bg { display: none !important; }
[data-theme="dark"] .m-app-buttons img.badge-black-bg { display: none !important; }
[data-theme="dark"] .m-app-buttons img.badge-white-bg { display: block !important; }

.m-social-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.m-social-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tg-pill {
    background: rgba(56, 189, 248, 0.12);
    color: #0284c7;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

[data-theme="dark"] .tg-pill {
    color: #38bdf8;
}

.fb-pill {
    background: rgba(96, 165, 250, 0.12);
    color: #2563eb;
    border: 1px solid rgba(96, 165, 250, 0.25);
}

[data-theme="dark"] .fb-pill {
    color: #60a5fa;
}

/* Drawer Footer (Fixed at Bottom) */
.m-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-surface-hover);
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

.m-footer-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.m-footer-contact:hover {
    color: var(--color-primary);
}

.m-footer-close-btn {
    padding: 6px 16px;
    background: var(--color-text-secondary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.m-footer-close-btn:hover {
    background: var(--color-text);
}

/* ─── Main Content ─── */
.main-content {
    min-height: calc(100vh - var(--header-height) - 300px);
    padding: var(--space-xl) 0;
}

/* ─── Section Titles ─── */
.section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.section-title .icon { font-size: 24px; }
.section-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: -12px;
    margin-bottom: var(--space-lg);
}

/* ─── Cards ─── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px var(--color-shadow);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.card:hover {
    box-shadow: 0 4px 16px var(--color-shadow-lg);
}
.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text);
}
.card-body { padding: var(--space-md) var(--space-lg); }
.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border-light);
    text-align: right;
}
.card-footer a {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

/* ─── Stats Bar ─── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow-lg);
}
.stat-number {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}
.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    font-weight: 500;
}

/* ─── Dashboard Grid ─── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}
.dashboard-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}
@media (max-width: 768px) {
    .dashboard-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ─── IPO / SME Dashboard Grid: tighter spacing ─── */
/* Reduce gap between the two boxes from 24px → 12px  */
.dashboard-grid--ipo {
    gap: 12px;
}
/* Remove left/right padding inside card-header & card-body so
   the table fills edge-to-edge (the table cells keep their own padding) */
.dashboard-grid--ipo .card-header {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}
.dashboard-grid--ipo .card-body {
    padding: 0;
}
/* Tighten table cell horizontal padding: 16px → 10px */
.dashboard-grid--ipo .data-table th,
.dashboard-grid--ipo .data-table td {
    padding-left: 10px;
    padding-right: 10px;
}

/* ─── Tables ─── */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}
.data-table th {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}
.data-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
    vertical-align: middle;
}
.data-table tr:hover td {
    background: var(--color-surface-hover);
}
.data-table .company-name {
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.4;
    word-break: break-word;
}
.data-table .company-name a {
    color: inherit;
}
.data-table .company-name a:hover {
    text-decoration: underline;
}

/* ─── Status Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    border: 1px solid transparent;
    line-height: 1.5;
}
.badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
    opacity: 0.75;
}

/* Open — emerald green */
.badge-open {
    color: #047857;
    background: #d1fae5;
    border-color: #6ee7b7;
}
[data-theme="dark"] .badge-open {
    color: #34d399;
    background: #064e3b;
    border-color: #065f46;
}

/* Closing Today — vivid red, pulsing */
.badge-closing {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fca5a5;
    animation: pulse-badge 1.4s ease-in-out infinite;
}
[data-theme="dark"] .badge-closing {
    color: #f87171;
    background: #7f1d1d;
    border-color: #991b1b;
}

/* Upcoming — golden yellow */
.badge-upcoming {
    color: #854d0e;
    background: #fef9c3;
    border-color: #fde047;
}
[data-theme="dark"] .badge-upcoming {
    color: #fde047;
    background: #422006;
    border-color: #a16207;
}

/* Allotment — amber/orange */
.badge-allotment {
    color: #c2410c;
    background: #ffedd5;
    border-color: #fdba74;
}
[data-theme="dark"] .badge-allotment {
    color: #fb923c;
    background: #7c2d12;
    border-color: #9a3412;
}

/* Allotment OUT — teal/cyan with live pulse dot */
.badge-allotment-out {
    color: #0e7490;
    background: #cffafe;
    border-color: #67e8f9;
}
.badge-allotment-out .badge-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0e7490;
    animation: pulse-dot 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
[data-theme="dark"] .badge-allotment-out {
    color: #22d3ee;
    background: #164e63;
    border-color: #0e7490;
}
[data-theme="dark"] .badge-allotment-out .badge-live-dot {
    background: #22d3ee;
}

/* Listing Today — purple, glowing */
.badge-listing {
    color: #6d28d9;
    background: #ede9fe;
    border-color: #c4b5fd;
    animation: glow-badge 2s ease-in-out infinite;
}
[data-theme="dark"] .badge-listing {
    color: #c4b5fd;
    background: #4c1d95;
    border-color: #5b21b6;
}

/* Listed — indigo */
.badge-listed {
    color: #3730a3;
    background: #e0e7ff;
    border-color: #a5b4fc;
}
[data-theme="dark"] .badge-listed {
    color: #a5b4fc;
    background: #1e1b4b;
    border-color: #3730a3;
}

/* Closed — grey */
.badge-closed {
    color: #374151;
    background: #f3f4f6;
    border-color: #d1d5db;
}
[data-theme="dark"] .badge-closed {
    color: #9ca3af;
    background: #1f2937;
    border-color: #374151;
}

/* Proposed / Announced — teal/cyan */
.badge-proposed {
    color: #0e7490;
    background: #cffafe;
    border-color: #67e8f9;
}
[data-theme="dark"] .badge-proposed {
    color: #67e8f9;
    background: #164e63;
    border-color: #0e7490;
}

/* Cancelled / Withdrawn — muted grey, strikethrough */
.badge-cancelled {
    color: #6b7280;
    background: #f9fafb;
    border-color: #e5e7eb;
    text-decoration: line-through;
    opacity: 0.75;
}
[data-theme="dark"] .badge-cancelled {
    color: #6b7280;
    background: #1f2937;
    border-color: #374151;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(0.97); }
}
@keyframes glow-badge {
    0%, 100% { box-shadow: 0 0 0 rgba(109, 40, 217, 0); }
    50% { box-shadow: 0 0 8px rgba(109, 40, 217, 0.45); }
}

/* ─── Table Row Status Color Coding ─── */
/* Left-border accent + subtle background tint per status */
.data-table tr[data-status] td:first-child {
    border-left: 3px solid transparent;
    padding-left: calc(var(--space-md) - 3px);
}
.data-table tr[data-status="open"] td:first-child            { border-left-color: #059669; }
.data-table tr[data-status="closing"] td:first-child         { border-left-color: #dc2626; }
.data-table tr[data-status="upcoming"] td:first-child        { border-left-color: #ca8a04; }
.data-table tr[data-status="allotment"] td:first-child       { border-left-color: #ea580c; }
.data-table tr[data-status="allotment_out"] td:first-child   { border-left-color: #0e7490; }
.data-table tr[data-status="listing"] td:first-child         { border-left-color: #7c3aed; }
.data-table tr[data-status="listed"] td:first-child          { border-left-color: #3730a3; }
.data-table tr[data-status="closed"] td:first-child          { border-left-color: #9ca3af; }
.data-table tr[data-status="proposed"] td:first-child        { border-left-color: #0e7490; }

/* Subtle row background tints for active statuses */
.data-table tr[data-status="open"] td           { background: rgba(5, 150, 105, 0.04); }
.data-table tr[data-status="closing"] td        { background: rgba(220, 38, 38, 0.05); }
.data-table tr[data-status="upcoming"] td       { background: rgba(202, 138, 4, 0.05); }
.data-table tr[data-status="allotment"] td      { background: rgba(234, 88, 12, 0.04); }
.data-table tr[data-status="allotment_out"] td  { background: rgba(14, 116, 144, 0.05); }
.data-table tr[data-status="listing"] td        { background: rgba(124, 58, 237, 0.05); }
.data-table tr[data-status="listed"] td         { background: rgba(55, 48, 163, 0.05); }

.data-table tr[data-status]:hover td {
    filter: brightness(0.96);
}
[data-theme="dark"] .data-table tr[data-status="open"] td           { background: rgba(5, 150, 105, 0.07); }
[data-theme="dark"] .data-table tr[data-status="closing"] td        { background: rgba(220, 38, 38, 0.09); }
[data-theme="dark"] .data-table tr[data-status="upcoming"] td       { background: rgba(202, 138, 4, 0.09); }
[data-theme="dark"] .data-table tr[data-status="allotment"] td      { background: rgba(234, 88, 12, 0.08); }
[data-theme="dark"] .data-table tr[data-status="allotment_out"] td  { background: rgba(14, 116, 144, 0.09); }
[data-theme="dark"] .data-table tr[data-status="listing"] td        { background: rgba(124, 58, 237, 0.09); }
[data-theme="dark"] .data-table tr[data-status="listed"] td         { background: rgba(55, 48, 163, 0.1); }

/* ─── Status Legend (shown on listing pages) ─── */
.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    align-items: center;
}
.status-legend-label {
    font-weight: 600;
    color: var(--color-text-muted);
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Homepage sub-card status left-border ─── */
.sub-card[data-status="open"]           { border-left: 3px solid #059669; }
.sub-card[data-status="closing"]        { border-left: 3px solid #dc2626; }
.sub-card[data-status="upcoming"]       { border-left: 3px solid #ca8a04; }
.sub-card[data-status="allotment"]      { border-left: 3px solid #ea580c; }
.sub-card[data-status="allotment_out"]  { border-left: 3px solid #0e7490; }
.sub-card[data-status="listing"]        { border-left: 3px solid #7c3aed; }
.sub-card[data-status="listed"]         { border-left: 3px solid #3730a3; }
.sub-card[data-status="closed"]         { border-left: 3px solid #9ca3af; }
.sub-card[data-status="proposed"]       { border-left: 3px solid #0e7490; }


/* ─── Rating Badges ─── */
.rating {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}
.rating-recommended { color: #fff; background: var(--rating-recommended, #2F6717); }
.rating-subscribe { color: #fff; background: var(--rating-subscribe, #D67700); }
.rating-apply { color: #fff; background: #059669; }
.rating-may-apply { color: #fff; background: #2563eb; }
.rating-neutral { color: #fff; background: var(--rating-neutral, #8F77E5); }
.rating-avoid { color: #fff; background: var(--rating-avoid, #FF0000); }
.rating-listing-only { color: #fff; background: #0284c7; }
.rating-not-rated { color: #fff; background: #64748b; }
.rating-pending { color: var(--color-text-muted); background: var(--badge-closed-bg); }

/* ─── Review Rating Badge Highlight ─── */
.review-rating-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
    margin: 0 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.review-rating-badge.rating-recommended { background: var(--rating-recommended, #2F6717); color: #ffffff; }
.review-rating-badge.rating-subscribe   { background: var(--rating-subscribe, #D67700); color: #ffffff; }
.review-rating-badge.rating-apply       { background: #059669; color: #ffffff; }
.review-rating-badge.rating-may-apply   { background: #2563eb; color: #ffffff; }
.review-rating-badge.rating-neutral     { background: var(--rating-neutral, #8F77E5); color: #ffffff; }
.review-rating-badge.rating-avoid       { background: var(--rating-avoid, #FF0000); color: #ffffff; }
.review-rating-badge.rating-listing-only{ background: #0284c7; color: #ffffff; }
.review-rating-badge.rating-not-rated   { background: #64748b; color: #ffffff; }
.review-rating-badge.rating-pending     { background: var(--rating-pending, #9ca3af); color: #ffffff; }

/* ─── Filter Tabs ─── */
.filter-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}
.filter-tab {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.filter-tab:hover, .filter-tab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
}
.page-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}
.page-link:hover, .page-link.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.page-dots {
    color: var(--color-text-muted);
    padding: 0 var(--space-sm);
}

/* ─── Detail Page ─── */
.detail-hero {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: 0 2px 8px var(--color-shadow);
}
.detail-hero h1 {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}
.meta-item {
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
}
.meta-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.meta-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
    margin-top: 2px;
}

/* ─── Timeline ─── */
.timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-md);
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--color-border);
    transform: translateY(-50%);
    z-index: 0;
}
.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}
.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-border);
    border: 3px solid var(--color-surface);
    box-shadow: 0 0 0 2px var(--color-border);
    margin-bottom: var(--space-sm);
}
.timeline-dot.completed {
    background: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}
.timeline-dot.active {
    background: var(--badge-open);
    box-shadow: 0 0 0 2px var(--badge-open), 0 0 8px rgba(5, 150, 105, 0.4);
}
.timeline-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: center;
}
.timeline-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-align: center;
    margin-top: 2px;
}

/* ─── Discussion ─── */
.discussion-list {
    list-style: none;
}
.discussion-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.15s ease;
}
.discussion-item:hover {
    background: var(--color-surface-hover);
}
.discussion-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}
.discussion-user {
    font-weight: 600;
    color: var(--color-primary);
    font-size: var(--font-size-sm);
}
.discussion-time {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.discussion-message {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}
.discussion-entity {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

/* ─── Comment Form ─── */
.comment-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-lg);
}
.comment-form h3 {
    margin-bottom: var(--space-md);
    font-size: var(--font-size-lg);
    font-weight: 700;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.form-group { display: flex; flex-direction: column; gap: var(--space-xs); }
.form-group label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input,
.form-group textarea {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xl);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--color-shadow-lg);
}
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
}
.alert-success {
    background: var(--badge-open-bg);
    color: var(--badge-open);
    border: 1px solid var(--badge-open);
}
.alert-error {
    background: var(--badge-closing-bg);
    color: var(--badge-closing);
    border: 1px solid var(--badge-closing);
}

/* ─── FAQ Accordion ─── */
.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
}
.faq-question {
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}
.faq-question:hover { background: var(--color-surface-hover); }
.faq-question .faq-toggle {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    transition: transform 0.3s ease;
}
.faq-item.open .faq-question .faq-toggle {
    transform: rotate(45deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.faq-answer-inner {
    padding: 0 var(--space-lg) var(--space-lg);
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ─── Subscription Widget ─── */
.subscription-widget {
    margin-bottom: var(--space-xl);
}
.sub-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    transition: transform 0.15s ease;
}
.sub-card:hover { transform: translateX(4px); }
.sub-card-name {
    font-weight: 600;
    color: var(--color-primary);
}
.sub-card-value {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--badge-open);
}
.sub-card-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ─── News / Notification Feed ─── */
.news-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}
.news-type-badge {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.news-content h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}
.news-content p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}
.news-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

/* ─── View All Link ─── */
.view-all {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-primary);
}
.view-all:hover { text-decoration: underline; }

/* ─── Listing Performance ─── */
.listing-gain { color: var(--badge-open); font-weight: 700; }
.listing-loss { color: var(--badge-closing); font-weight: 700; }

/* ─── Page Header ─── */
.page-header {
    margin-bottom: var(--space-xl);
}
.page-header h1 {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin-bottom: var(--space-xs);
}
.page-header p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--color-text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: var(--space-md); }
.empty-state p { font-size: var(--font-size-lg); }

/* ─── HTML Content Styling (Description) ─── */
.html-content {
    color: var(--color-text-secondary);
    line-height: 1.8;
}
.html-content p {
    margin-bottom: var(--space-md);
}
.html-content h1, .html-content h2, .html-content h3, .html-content h4 {
    color: var(--color-text);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    font-weight: 700;
}
.html-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-md) 0;
}
.html-content th, .html-content td {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}
.html-content th {
    background: var(--color-surface-hover);
    font-weight: 600;
}
.html-content ul, .html-content ol {
    margin-left: var(--space-xl);
    margin-bottom: var(--space-md);
}
.html-content li {
    margin-bottom: var(--space-xs);
}

/* ─── Footer ─── */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-3xl) 0 var(--space-xl);
    margin-top: var(--space-3xl);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}
.footer-col h4 {
    font-size: var(--font-size-base);
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--space-sm); }
.footer-col a {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--color-primary); }
.footer-text {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}
.app-badges {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: var(--space-md);
    /* No max-width restriction on container, allow flow */
}
.store-badge-link {
    display: block;
    text-decoration: none;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    line-height: 0;
    height: 42px; /* Fixed height ensures both buttons align perfectly */
}
.store-badge-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}
.store-badge-img {
    height: 100%;
    width: auto;
    display: block;
    border-radius: 6px;
}

/* Light Theme: Black background badges for contrast */
.app-badges img.badge-black-bg { display: block !important; }
.app-badges img.badge-white-bg { display: none !important; }

/* Dark Theme: White background badges for contrast */
[data-theme="dark"] .app-badges img.badge-black-bg { display: none !important; }
[data-theme="dark"] .app-badges img.badge-white-bg { display: block !important; }
.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-lg);
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}
.footer-bottom a { color: var(--color-primary); }

/* ─── HTML Content & Database Table Styling ─── */
.html-content {
    color: var(--color-text);
    font-size: var(--font-size-base);
    line-height: 1.65;
    word-break: break-word;
}
.html-content p {
    margin-bottom: var(--space-md);
    color: var(--color-text);
}
.html-content p:last-child {
    margin-bottom: 0;
}
.html-content h1, .html-content h2, .html-content h3, .html-content h4, .html-content h5, .html-content h6 {
    color: var(--color-text);
    font-weight: 700;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}
.html-content h3 { font-size: var(--font-size-lg); border-bottom: 2px solid var(--color-border-light); padding-bottom: var(--space-xs); }
.html-content h4 { font-size: var(--font-size-base); }
.html-content ul, .html-content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}
.html-content li {
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}
.html-content strong, .html-content b {
    color: var(--color-text);
    font-weight: 700;
}
.html-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.html-content a:hover {
    color: var(--color-primary-hover);
}

/* Database HTML Tables */
.html-content .table-responsive {
    width: 100%;
    margin-bottom: var(--space-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}
.html-content table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    font-size: var(--font-size-sm);
    text-align: left;
}
.html-content th, .html-content td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
}
.html-content th {
    background: var(--color-surface-hover);
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}
.html-content tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.02);
}
[data-theme="dark"] .html-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}
.html-content tr:hover td {
    background: var(--color-surface-hover);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-meta { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .main-nav { display: none !important; }

    .form-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .detail-meta { grid-template-columns: 1fr; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }

    .timeline {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        padding: var(--space-lg);
    }
    .timeline::before {
        top: 0;
        bottom: 0;
        left: 26px;
        right: auto;
        width: 3px;
        height: auto;
        transform: none;
    }
    .timeline-step {
        flex-direction: row;
        gap: var(--space-md);
    }

    .utility-left { display: none; }
}

@media (max-width: 480px) {
    .stats-bar { grid-template-columns: 1fr; }
    .detail-hero h1 { font-size: var(--font-size-xl); }
    .container { padding: 0 var(--space-md); }
}

/* ─── VALUATIONS DESIGN (MATCHING DESIGN IMAGE) ─── */
.valuation-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    overflow: hidden;
}

.valuation-header {
    background: #f8fafc;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.valuation-header-icon {
    background: #ebf4ff;
    color: #2563eb;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.valuation-header-title {
    font-weight: 700;
    color: #2563eb;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.valuation-header-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    text-transform: none;
    letter-spacing: normal;
}

.valuation-body {
    padding: 16px;
    background: #ffffff;
}

.valuation-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.val-metric {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.val-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.val-value {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
    font-family: inherit;
    line-height: 1.2;
}

@media (max-width: 991px) {
    .valuation-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ─── NCD Specific Styling ─── */
.ncd-credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    line-height: 1.3;
    margin: 2px 2px 2px 0;
}
.ncd-credit-badge .ncd-agency {
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
}

.ncd-credit-badge .ncd-rating-value {
    font-weight: 800;
    color: #2563eb;
    background: #dbeafe;
    padding: 1px 5px;
    border-radius: 4px;
}
.ncd-credit-badge .ncd-outlook {
    color: #64748b;
    font-size: 11px;
}
.ncd-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.ncd-detail-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 10px 12px;
}
.ncd-detail-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-top: 1px solid #e2e8f0;
}

/* ── Floating Share Dock ── */
.floating-share-dock {
    position: fixed;
    right: 14px;
    top: 45%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 7px;
    z-index: 1050;
    background: var(--color-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    padding: 9px 7px;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.14);
    transition: all 0.2s ease;
}
[data-theme="dark"] .floating-share-dock {
    background: rgba(20, 30, 48, 0.97);
    border-color: rgba(255,255,255,0.1);
}
.dock-divider {
    width: 28px;
    height: 1px;
    background: var(--color-border);
    align-self: center;
    margin: 1px 0;
}
.dock-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    flex-shrink: 0;
}
.dock-btn:hover {
    transform: scale(1.13);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
.dock-btn svg { display: block; }
.dock-wa { background: #25d366; }
.dock-tg { background: #2ca5e0; }
.dock-tw { background: #000; }
.dock-join-tg { background: linear-gradient(135deg, #0088cc 0%, #00aaff 100%); }
.dock-join-fb { background: #1877f2; }

@media (max-width: 768px) {
    .floating-share-dock {
        right: 8px;
        top: auto;
        bottom: 12px;
        transform: none;
        flex-direction: row;
        border-radius: 50px;
        padding: 7px 10px;
    }
    .dock-divider { width: 1px; height: 24px; margin: 0 1px; }
    .dock-btn { width: 32px; height: 32px; }
}


