/* ==========================================================================
   KRIVIYA — Krishi, Shuddhi, Samriddhi
   Indian Folk Cultural Heritage & Mandi Intelligence Design System
   ========================================================================== */

:root {
    /* Royal Indian Heritage Color Palette */
    --kriviya-gold-light: #FFF2A3;
    --kriviya-gold: #E5A93C;
    --kriviya-gold-deep: #C28723;
    --kriviya-gold-bronze: #915B06;
    --kriviya-brass: #D4AF37;
    
    /* Sacred Earth & Flora Accents */
    --terracotta: #C2410C;
    --terracotta-warm: #EA580C;
    --terracotta-glow: rgba(194, 65, 12, 0.25);
    
    --emerald-neem: #10B981;
    --emerald-deep: #059669;
    --emerald-glow: rgba(16, 185, 129, 0.22);
    
    --kumkum-red: #E11D48;
    --kumkum-glow: rgba(225, 29, 72, 0.22);
    
    --indigo-royal: #38BDF8;
    --indigo-deep: #1E293B;

    /* Backgrounds & Textures */
    --bg-kohl: #070B12;
    --bg-card: rgba(14, 20, 32, 0.88);
    --bg-card-hover: rgba(22, 31, 48, 0.95);
    --bg-input: rgba(10, 15, 26, 0.92);
    
    /* Borders & Ornaments */
    --border-gold-subtle: rgba(229, 169, 60, 0.22);
    --border-gold-bright: rgba(245, 194, 91, 0.55);
    --border-ornament: rgba(212, 175, 55, 0.35);
    
    /* Typography */
    --text-pure: #FFFFFF;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-gold: #FCD34D;

    --font-heritage: 'Rozha One', 'Yatra One', 'Cinzel', serif;
    --font-heading: 'Philosopher', 'Cinzel', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-devanagari: 'Yatra One', 'Rozha One', serif;

    /* Elevation & Aesthetics */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-royal: 0 12px 40px 0 rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(229, 169, 60, 0.15);
    --shadow-gold-glow: 0 0 24px rgba(229, 169, 60, 0.22);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-kohl);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 1.5rem 1rem 3rem;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Folk Art Motifs */
.folk-bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(229, 169, 60, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(194, 65, 12, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.folk-mandala-left, .folk-mandala-right {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
    background: repeating-radial-gradient(
        circle,
        var(--kriviya-gold),
        var(--kriviya-gold) 2px,
        transparent 4px,
        transparent 16px
    );
}

.folk-mandala-left {
    top: -150px;
    left: -150px;
}

.folk-mandala-right {
    bottom: -150px;
    right: -150px;
}

/* Top Traditional Toran Arch */
.toran-border-top {
    position: relative;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto 0.5rem;
    overflow: hidden;
}

.toran-leaves {
    display: flex;
    justify-content: space-around;
    padding-bottom: 2px;
}

.toran-leaves span {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #10B981, #047857);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    opacity: 0.85;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.toran-leaves span:nth-child(even) {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    height: 14px;
    width: 14px;
}

.gold-marigold-string {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--kriviya-gold), var(--terracotta), var(--kriviya-gold), transparent);
    box-shadow: 0 0 8px rgba(229, 169, 60, 0.5);
}

/* Application Container */
.app-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Folk Art Frame & Corner Ornaments
   ========================================================================== */

.folk-frame {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-gold-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-royal);
    transition: var(--transition);
}

.folk-frame-sm {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-gold-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Traditional Brass Corner Filigree (Rangoli / Kolam Corners) */
.corner-ornament {
    position: absolute;
    width: 22px;
    height: 22px;
    pointer-events: none;
    z-index: 2;
}

.corner-ornament::before,
.corner-ornament::after {
    content: '';
    position: absolute;
    background: var(--kriviya-gold);
    box-shadow: 0 0 6px rgba(229, 169, 60, 0.6);
}

.corner-ornament.top-left { top: 6px; left: 6px; }
.corner-ornament.top-left::before { top: 0; left: 0; width: 14px; height: 2px; }
.corner-ornament.top-left::after { top: 0; left: 0; width: 2px; height: 14px; }

.corner-ornament.top-right { top: 6px; right: 6px; }
.corner-ornament.top-right::before { top: 0; right: 0; width: 14px; height: 2px; }
.corner-ornament.top-right::after { top: 0; right: 0; width: 2px; height: 14px; }

.corner-ornament.bottom-left { bottom: 6px; left: 6px; }
.corner-ornament.bottom-left::before { bottom: 0; left: 0; width: 14px; height: 2px; }
.corner-ornament.bottom-left::after { bottom: 0; left: 0; width: 2px; height: 14px; }

.corner-ornament.bottom-right { bottom: 6px; right: 6px; }
.corner-ornament.bottom-right::before { bottom: 0; right: 0; width: 14px; height: 2px; }
.corner-ornament.bottom-right::after { bottom: 0; right: 0; width: 2px; height: 14px; }

/* ==========================================================================
   Royal Heritage Header & Branding
   ========================================================================== */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    gap: 1.5rem;
    border-top: 2px solid var(--kriviya-gold);
}

.header-main-brand {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Royal Emblem */
.royal-emblem {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #2A170A 0%, #100804 100%);
    border: 2px solid var(--kriviya-gold);
    box-shadow: 0 0 20px var(--shadow-gold-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.emblem-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Brand Titles */
.brand-titles {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.brand-kriviya-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.brand-title {
    font-family: var(--font-heritage);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF2A3 30%, #E5A93C 70%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(229, 169, 60, 0.2);
    line-height: 1.1;
}

.hindi-script-title {
    font-family: var(--font-devanagari);
    font-size: 1.4rem;
    color: var(--kriviya-gold);
    font-weight: 600;
    opacity: 0.9;
}

.motto-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.motto-flourish {
    color: var(--kriviya-gold);
    font-size: 0.95rem;
    opacity: 0.8;
}

.brand-motto {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-gold);
    text-transform: uppercase;
}

.motto-hindi {
    font-family: var(--font-devanagari);
    font-size: 0.95rem;
    color: var(--terracotta-warm);
    font-weight: 500;
}

.patrika-badge-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.patrika-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    background: rgba(194, 65, 12, 0.15);
    border: 1px solid rgba(234, 88, 12, 0.4);
    color: #FDBA74;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.date-stamp {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Header Action Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.folk-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(229, 169, 60, 0.1);
    color: var(--kriviya-gold-light);
    border: 1px solid var(--border-gold-subtle);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.folk-btn-action:hover {
    background: rgba(229, 169, 60, 0.22);
    border-color: var(--kriviya-gold);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(229, 169, 60, 0.25);
}

#btn-snapshot-mode {
    background: linear-gradient(135deg, rgba(194, 65, 12, 0.3), rgba(229, 169, 60, 0.2));
    border-color: rgba(229, 169, 60, 0.4);
}

/* Ornate Divider with Lotus */
.folk-divider-ornament {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: -0.25rem auto 0;
    width: 100%;
    max-width: 900px;
    opacity: 0.75;
}

.folk-divider-ornament .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--kriviya-gold), transparent);
}

.motif-center {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--kriviya-gold);
    font-size: 0.85rem;
}

.lotus-glyph {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 6px rgba(229, 169, 60, 0.6));
}

/* ==========================================================================
   Folk Navigation Tabs (Unit Rate 1st Position)
   ========================================================================== */

.folk-tab-container {
    display: flex;
    gap: 0.75rem;
    background: var(--bg-card);
    padding: 0.6rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-gold-subtle);
    box-shadow: var(--shadow-royal);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    position: relative;
    min-width: 200px;
}

.tab-btn .tab-icon {
    font-size: 1.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.tab-content-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tab-label {
    font-family: var(--font-heading);
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition);
}

.tab-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tab-btn:hover {
    background: rgba(229, 169, 60, 0.06);
    border-color: rgba(229, 169, 60, 0.2);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(229, 169, 60, 0.18) 0%, rgba(194, 65, 12, 0.12) 100%);
    border: 1px solid var(--border-gold-bright);
    box-shadow: 0 4px 20px rgba(229, 169, 60, 0.15);
}

.tab-btn.active .tab-label {
    color: var(--kriviya-gold-light);
}

.tab-btn.active .tab-sub {
    color: var(--text-gold);
}

.tab-btn .active-gem {
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    transition: var(--transition);
}

.tab-btn.active .active-gem {
    background: var(--kriviya-gold);
    box-shadow: 0 0 8px var(--kriviya-gold);
}

/* ==========================================================================
   Toolbar & Filters
   ========================================================================== */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.1rem 1.5rem;
    border-top: 2px solid rgba(229, 169, 60, 0.3);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border-gold-subtle);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    flex: 1;
    min-width: 260px;
    max-width: 440px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--kriviya-gold);
    box-shadow: 0 0 12px rgba(229, 169, 60, 0.25);
}

.search-icon {
    color: var(--kriviya-gold);
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-pure);
    font-size: 0.92rem;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.clear-search-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.clear-search-btn:hover {
    color: var(--kriviya-gold);
}

/* Filter Toggles & Sorting */
.filter-toggles {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}

.toggle-switch-label input {
    display: none;
}

.toggle-pill {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-gold-subtle);
    border-radius: 9999px;
    position: relative;
    transition: var(--transition);
}

.toggle-pill::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch-label input:checked + .toggle-pill {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--emerald-neem);
}

.toggle-switch-label input:checked + .toggle-pill::after {
    left: 18px;
    background: var(--emerald-neem);
    box-shadow: 0 0 6px var(--emerald-neem);
}

.sort-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.sort-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.sort-dropdown {
    background: var(--bg-input);
    border: 1px solid var(--border-gold-subtle);
    color: var(--text-gold);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.sort-dropdown:focus {
    border-color: var(--kriviya-gold);
}

/* Param Controls */
.param-controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.param-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.param-group.hidden {
    display: none;
}

.param-input {
    background: var(--bg-input);
    border: 1px solid var(--border-gold-subtle);
    color: var(--text-primary);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    outline: none;
    transition: var(--transition);
}

.param-input:focus {
    border-color: var(--kriviya-gold);
    box-shadow: 0 0 10px rgba(229, 169, 60, 0.25);
}

/* Royal Refresh Button */
.btn-royal-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 50%, #B45309 100%);
    color: #1A0D03;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    border: 1px solid #FCD34D;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.35);
}

.btn-royal-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    filter: brightness(1.1);
}

.btn-royal-primary:active {
    transform: translateY(0);
}

/* ==========================================================================
   Market Metrics / Pulse Cards Grid
   ========================================================================== */

.market-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.metric-card.gold-border { border: 1px solid rgba(229, 169, 60, 0.4); border-left: 4px solid var(--kriviya-gold); }
.metric-card.terracotta-border { border: 1px solid rgba(194, 65, 12, 0.4); border-left: 4px solid var(--terracotta-warm); }
.metric-card.emerald-border { border: 1px solid rgba(16, 185, 129, 0.4); border-left: 4px solid var(--emerald-neem); }
.metric-card.indigo-border { border: 1px solid rgba(56, 189, 248, 0.4); border-left: 4px solid var(--indigo-royal); }

.metric-bg-motif {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 3rem;
    opacity: 0.12;
    pointer-events: none;
}

.metric-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.65rem;
}

.metric-title {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.metric-main-val {
    font-family: var(--font-heritage);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-pure);
    letter-spacing: -0.02em;
}

.metric-main-val.highlight-gold {
    color: var(--kriviya-gold-light);
    text-shadow: 0 0 12px rgba(229, 169, 60, 0.3);
}

.metric-main-val.highlight-emerald {
    color: var(--emerald-neem);
    text-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.metric-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-tag.gold { background: rgba(229, 169, 60, 0.15); color: var(--kriviya-gold-light); border: 1px solid rgba(229, 169, 60, 0.3); }
.metric-tag.emerald { background: rgba(16, 185, 129, 0.15); color: var(--emerald-neem); border: 1px solid rgba(16, 185, 129, 0.3); }
.metric-tag.indigo { background: rgba(56, 189, 248, 0.15); color: var(--indigo-royal); border: 1px solid rgba(56, 189, 248, 0.3); }
.metric-tag.info { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* ==========================================================================
   Main Content Area & Data Table
   ========================================================================== */

.main-content {
    padding: 2rem 2rem 1.5rem;
    min-height: 460px;
    border-top: 2px solid var(--kriviya-gold);
}

/* View Header Banner */
.view-header-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-gold-subtle);
}

.banner-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.ornament-leaf {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 6px var(--emerald-glow));
}

.view-title {
    font-family: var(--font-heritage);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--kriviya-gold-light);
    letter-spacing: 0.02em;
}

.view-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.table-meta-pills {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.meta-pill {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-pill.date {
    background: rgba(229, 169, 60, 0.12);
    color: var(--kriviya-gold-light);
    border-color: rgba(229, 169, 60, 0.3);
}

/* Visual Highlights Container (For Storage Movement / Capacity) */
.visual-summary {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: rgba(10, 15, 26, 0.8);
    border: 1px solid var(--border-gold-subtle);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.visual-summary.hidden {
    display: none;
}

.v-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.v-item .v-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.v-item .v-val {
    font-family: var(--font-heritage);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--kriviya-gold);
}

.v-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.4rem;
}

.v-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--kriviya-gold), var(--emerald-neem));
    border-radius: 9999px;
    transition: width 0.6s ease-out;
}

/* Table Wrapper & Folk Table Styling */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-gold-subtle);
    background: rgba(10, 15, 26, 0.6);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.data-table th {
    background: linear-gradient(180deg, #182236 0%, #101726 100%);
    color: var(--kriviya-gold-light);
    font-family: var(--font-heading);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1.1rem 1.25rem;
    font-weight: 700;
    border-bottom: 2px solid var(--kriviya-gold);
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

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

.data-table tbody tr:hover {
    background: rgba(229, 169, 60, 0.06);
}

.data-table tbody tr.dormant-row {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.2);
}

.unit-name-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.unit-bullet {
    color: var(--kriviya-gold);
    font-size: 0.75rem;
    opacity: 0.7;
}

.unit-name-text {
    font-weight: 600;
    color: var(--text-pure);
    letter-spacing: 0.01em;
}

.price-val {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-pure);
}

.price-val.gold {
    color: var(--kriviya-gold-light);
}

.price-zero {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
}

/* Price Movement Badges */
.badge-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-change.up {
    background: rgba(16, 185, 129, 0.18);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-change.down {
    background: rgba(225, 29, 72, 0.18);
    color: #FB7185;
    border: 1px solid rgba(225, 29, 72, 0.35);
}

.badge-change.flat {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-release {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.15);
    color: #7DD3FC;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

/* Patrika Card Footer (Included inside the card for screenshot capture) */
.patrika-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-gold-subtle);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.card-footer-seal {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--kriviya-gold);
    font-family: var(--font-heading);
    font-weight: 700;
}

.card-footer-motto {
    font-family: var(--font-devanagari);
    color: var(--text-gold);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.card-footer-url strong {
    color: var(--text-primary);
}

/* ==========================================================================
   Loading Skeleton & Error States
   ========================================================================== */

.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 0;
}

.skeleton-container.hidden {
    display: none;
}

.skeleton-row {
    height: 46px;
    background: linear-gradient(90deg, rgba(229, 169, 60, 0.03) 25%, rgba(229, 169, 60, 0.1) 50%, rgba(229, 169, 60, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.error-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: rgba(225, 29, 72, 0.12);
    border: 1px solid rgba(225, 29, 72, 0.35);
    border-radius: var(--radius-md);
    color: #FECDD3;
    margin: 1rem 0;
}

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

.error-icon {
    font-size: 1.75rem;
}

.error-details h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #FDA4AF;
    margin-bottom: 0.2rem;
}

.error-details p {
    font-size: 0.85rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Art Snapshot Mode (Optimized for High-Res Screenshots & Social Sharing)
   ========================================================================== */

body.snapshot-active {
    padding: 1rem;
    background: #060910;
}

body.snapshot-active .folk-tab-container,
body.snapshot-active .toolbar,
body.snapshot-active .header-actions,
body.snapshot-active .app-footer,
body.snapshot-active .toran-border-top {
    display: none !important;
}

body.snapshot-active .app-container {
    max-width: 1000px;
    gap: 1rem;
}

body.snapshot-active .app-header {
    border: 2px solid var(--kriviya-gold);
    background: #0E1524;
}

body.snapshot-active .main-content {
    border: 2px solid var(--kriviya-gold);
    background: #0E1524;
}

body.snapshot-active .data-table th {
    background: #151F33;
}

.snapshot-exit-bar {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(14, 20, 32, 0.96);
    border: 1px solid var(--kriviya-gold);
    border-radius: 9999px;
    padding: 0.6rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(229, 169, 60, 0.3);
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

.snapshot-exit-bar.hidden {
    display: none;
}

.snapshot-tip {
    font-size: 0.88rem;
    color: var(--kriviya-gold-light);
}

.snapshot-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.snapshot-control-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    transition: var(--transition);
}

.snapshot-control-btn.primary {
    background: var(--kriviya-gold);
    color: #1A0D03;
    border-color: #FCD34D;
}

.snapshot-control-btn:hover {
    transform: scale(1.04);
}

@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    background: #0E1524;
    border: 1px solid var(--border-gold-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    font-size: 0.88rem;
    color: var(--text-pure);
    animation: slideIn 0.3s ease-out;
}

.toast.success { border-color: var(--emerald-neem); }
.toast.info { border-color: var(--kriviya-gold); }
.toast.warn { border-color: var(--terracotta-warm); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.75rem 0 1rem;
    border-top: 1px solid var(--border-gold-subtle);
    color: var(--text-muted);
    font-size: 0.84rem;
}

.footer-brand-title {
    font-family: var(--font-heritage);
    font-size: 1.2rem;
    color: var(--kriviya-gold);
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.footer-sub {
    font-family: var(--font-devanagari);
    font-size: 1rem;
    color: var(--terracotta-warm);
    margin-left: 0.4rem;
}

.footer-motto-block {
    text-align: right;
}

.shloka {
    font-family: var(--font-devanagari);
    color: var(--kriviya-gold-light);
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.25rem;
}

.footer-trademark {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */

@media print {
    body {
        background: #FFFFFF !important;
        color: #000000 !important;
        padding: 0 !important;
    }

    .folk-bg-pattern, .folk-mandala-left, .folk-mandala-right,
    .nav-tabs, .toolbar, .header-actions, .snapshot-exit-bar {
        display: none !important;
    }

    .folk-frame, .folk-frame-sm, .main-content, .app-header {
        background: #FFFFFF !important;
        border: 1px solid #000000 !important;
        color: #000000 !important;
        box-shadow: none !important;
    }

    .brand-title {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
    }

    .data-table th {
        background: #F3F4F6 !important;
        color: #000000 !important;
    }

    .data-table td {
        color: #000000 !important;
        border-bottom: 1px solid #E5E7EB !important;
    }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* ==========================================================================
   Responsive Adaptations & Mobile Experience
   ========================================================================== */

@media (max-width: 900px) {
    body {
        padding: 1rem 0.75rem 2.5rem;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1rem;
        gap: 1.25rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-box {
        max-width: 100%;
        min-width: 100%;
    }

    .param-controls {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .market-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .footer-motto-block {
        text-align: left;
    }
}

@media (max-width: 640px) {
    body {
        padding: max(0.75rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
    }

    .app-container {
        gap: 1rem;
    }

    /* Brand Header on Mobile */
    .brand-title {
        font-size: 1.6rem;
    }

    .brand-tagline {
        font-size: 0.75rem;
    }

    .brand-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.45rem;
    }

    .header-actions .folk-btn-action {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
        padding: 0.65rem 0.75rem;
        font-size: 0.82rem;
    }

    /* Horizontal Swipeable Tabs on Mobile */
    .folk-tab-container {
        padding: 0.4rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .folk-tab-container::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex: 0 0 auto;
        min-width: 130px;
        padding: 0.65rem 0.9rem;
        font-size: 0.8rem;
    }

    .tab-title-main {
        font-size: 0.82rem;
    }

    .tab-subtitle {
        font-size: 0.68rem;
    }

    /* Param Controls on Mobile */
    .param-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .param-group {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .param-group input,
    .param-group select {
        width: 100%;
        min-height: 42px;
    }

    .btn-royal-primary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* Market Metrics on Small Screens */
    .market-metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-main-val {
        font-size: 1.5rem;
    }

    /* Main Content & Table Container */
    .main-content {
        padding: 1rem 0.75rem;
        min-height: 380px;
    }

    .view-header-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.65rem;
        font-size: 0.82rem;
    }

    /* Toast Container for Mobile */
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 1rem;
        max-width: none;
    }

    .toast {
        width: 100%;
        font-size: 0.85rem;
    }

    /* Snapshot Exit Bar */
    .snapshot-exit-bar {
        left: 0.5rem;
        right: 0.5rem;
        transform: none;
        width: auto;
        flex-direction: column;
        gap: 0.5rem;
    }

    .snapshot-actions {
        width: 100%;
        justify-content: stretch;
    }

    .snapshot-actions button {
        flex: 1;
        justify-content: center;
    }
}
