/* ==========================================================================
   SmartPalm Dark Command Center Theme — Home Dashboard (home-dark.css)
   ========================================================================== */

:root {
    --sp-bg-deep: #080a0e;
    --sp-bg-panel: rgba(18, 22, 28, 0.82);
    --sp-bg-panel-solid: #12161c;
    --sp-bg-card: rgba(26, 31, 40, 0.72);
    --sp-bg-card-hover: rgba(36, 43, 55, 0.88);
    --sp-border: rgba(255, 255, 255, 0.08);
    --sp-border-bright: rgba(255, 255, 255, 0.16);
    --sp-text-primary: #f8fafc;
    --sp-text-secondary: #94a3b8;
    --sp-text-muted: #64748b;
    --sp-accent-green: #10b981;
    --sp-accent-emerald: #34d399;
    --sp-accent-amber: #f59e0b;
    --sp-accent-orange: #f97316;
    --sp-accent-red: #ef4444;
    --sp-accent-cyan: #06b6d4;
    --sp-radius-lg: 18px;
    --sp-radius-md: 12px;
    --sp-radius-sm: 8px;
    --sp-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

body.sp-dark-home {
    margin: 0;
    padding: 0;
    background-color: var(--sp-bg-deep) !important;
    color: var(--sp-text-primary) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    user-select: none;
}

body.sp-dark-home .cms-layout {
    background: var(--sp-bg-deep) !important;
    background-image: none !important;
    color: var(--sp-text-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* --------------------------------------------------------------------------
   1. TOP NAVIGATION BAR (Matches reference image top bar + left panel links)
   -------------------------------------------------------------------------- */
body.sp-dark-home .cms-top-panel {
    height: 60px;
    background: rgba(11, 14, 18, 0.88) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--sp-border) !important;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 9999999;
}

.sp-top-left-group {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.sp-brand-box {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding-right: 12px;
    border-right: 1px solid var(--sp-border);
}

.sp-brand-logo-wrap {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.sp-brand-logo-wrap img {
    height: 34px;
    width: auto;
    display: block;
}

/* Top Pill Navigation (Same items as Left Sidebar) */
.sp-top-nav-pills {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-top-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--sp-text-secondary);
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.sp-top-pill img.pill-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.85;
}

.sp-top-pill:hover {
    color: var(--sp-text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--sp-border);
}

.sp-top-pill.active {
    color: var(--sp-text-primary);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* KPSM Dropdown inside Top Bar */
.sp-top-pill-dropdown {
    position: relative;
}

.sp-top-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: rgba(18, 22, 29, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid var(--sp-border-bright);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
    z-index: 10000000;
    flex-direction: column;
    gap: 2px;
}

.sp-top-pill-dropdown.open .sp-top-dropdown-menu {
    display: flex;
}

.sp-top-dropdown-item {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--sp-text-secondary);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.sp-top-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Top Right Controls (Search, Settings, Notifications, Profile) */
.sp-top-right-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--sp-border);
    border-radius: 999px;
    padding: 0 12px;
    height: 34px;
    width: 230px;
    transition: all 0.2s ease;
}

.sp-search-box:focus-within {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    width: 265px;
}

.sp-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--sp-text-primary);
    font-size: 12px;
    width: 100%;
    font-family: inherit;
}

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

.sp-search-box .search-shortcut {
    font-size: 10px;
    color: var(--sp-text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 6px;
    white-space: nowrap;
}

.sp-search-box svg {
    width: 14px;
    height: 14px;
    color: var(--sp-text-secondary);
    flex-shrink: 0;
}

.sp-search-results-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(16, 20, 26, 0.98);
    border: 1px solid var(--sp-border-bright);
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7);
    z-index: 10000001;
}

.sp-search-result-item {
    padding: 8px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--sp-text-primary);
    cursor: pointer;
}

.sp-search-result-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* WiFi Speed Connection Pill */
.sp-wifi-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sp-wifi-pill:hover {
    background: rgba(255, 255, 255, 0.14);
}

.sp-wifi-pill svg {
    width: 15px;
    height: 15px;
}

.sp-wifi-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
}

/* Top Icon Buttons */
.sp-icon-btn {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--sp-border);
    color: var(--sp-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sp-icon-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--sp-border-bright);
}

.sp-icon-btn svg {
    width: 16px;
    height: 16px;
}

.sp-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: #52525b;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #0b0e12;
}

/* Top-Right Notification Dropdown */
.sp-notif-dropdown-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sp-top-notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    background: rgba(16, 20, 27, 0.97);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.75);
    z-index: 10000002;
    flex-direction: column;
    overflow: hidden;
}

.sp-top-notif-dropdown.open {
    display: flex;
}

.sp-notif-dd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.sp-notif-dd-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-notif-dd-count-pill {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.sp-notif-dd-mark-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.15s ease;
}

.sp-notif-dd-mark-btn:hover {
    color: #ffffff;
}

.sp-notif-dd-list {
    max-height: 330px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sp-notif-dd-list::-webkit-scrollbar {
    width: 4px;
}

.sp-notif-dd-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.sp-notif-dd-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: #f8fafc;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.sp-notif-dd-item:last-child {
    border-bottom: none;
}

.sp-notif-dd-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.sp-notif-dd-item.unread {
    background: rgba(255, 255, 255, 0.03);
}

.sp-notif-dd-item.unread:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sp-notif-dd-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #e2e8f0;
    margin-top: 1px;
}

.sp-notif-dd-icon.profile {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.32);
    color: #fbbf24;
}

.sp-notif-dd-icon.run {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.32);
    color: #34d399;
}

.sp-notif-dd-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sp-notif-dd-text {
    font-size: 12.5px;
    line-height: 1.45;
    color: #e2e8f0;
    font-weight: 400;
}

.sp-notif-dd-text b {
    color: #ffffff;
    font-weight: 600;
}

.sp-notif-dd-sub {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sp-notif-dd-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #38bdf8;
    flex-shrink: 0;
    margin-top: 6px;
}

.sp-notif-dd-footer {
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.sp-notif-dd-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    color: #f8fafc;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.sp-notif-dd-view-all:hover {
    color: #38bdf8;
}

/* Profile Login Pill */
.sp-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 11px 0 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--sp-border);
    color: var(--sp-text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sp-profile-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: var(--sp-border-bright);
}

.sp-avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #27272a;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    position: relative;
}

.sp-avatar-status {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #0b0e12;
}

/* --------------------------------------------------------------------------
   2. LEFT SIDEBAR (Kept as-is functionally, styled in dark glass monochrome)
   -------------------------------------------------------------------------- */
body.sp-dark-home .cms-sidebar {
    top: 60px;
    height: calc(100vh - 60px);
    width: 84px;
    background: rgba(11, 14, 18, 0.86) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid var(--sp-border) !important;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.45);
}

body.sp-dark-home .cms-sidebar:hover {
    width: 255px;
    background: rgba(14, 18, 24, 0.96) !important;
}

body.sp-dark-home .cms-nav-item {
    color: var(--sp-text-secondary);
    padding: 10px 14px;
    margin: 0 8px;
    box-sizing: border-box;
}

body.sp-dark-home .cms-nav-item .icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin-right: 14px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

body.sp-dark-home .cms-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    transform: none;
}

body.sp-dark-home .cms-nav-item.active {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    border-left: none !important;
    box-shadow: inset 3.5px 0 0 #ffffff, 0 4px 14px rgba(0, 0, 0, 0.5) !important;
}

body.sp-dark-home .cms-sub-nav-item {
    color: var(--sp-text-secondary);
}

body.sp-dark-home .cms-sub-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   3. MAIN COMMAND CENTER WORKSPACE & MAP LAYER
   -------------------------------------------------------------------------- */
body.sp-dark-home .cms-main-content {
    padding-left: 84px;
    padding-top: 60px;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.sp-command-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 455px 1fr;
    grid-template-rows: 1fr;
    gap: 14px;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Full-Bleed Background Map inside the Command Stage */
.sp-map-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #07090c;
}

#sp-home-map {
    width: 100%;
    height: 100%;
    background: #07090c;
}

/* Dark vignette around map edges so floating panels pop like the reference photo */
.sp-map-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        radial-gradient(circle at 50% 42%, transparent 38%, rgba(6, 8, 12, 0.55) 100%),
        linear-gradient(180deg, rgba(8, 10, 14, 0.45) 0%, transparent 16%, transparent 76%, rgba(8, 10, 14, 0.72) 100%);
}

/* Leaflet Dark Theme Overrides */
.sp-dark-satellite-tiles {
    filter: brightness(0.72) contrast(1.18) saturate(0.85);
}

.leaflet-container {
    font-family: 'Inter', sans-serif !important;
}

.sp-map-tooltip {
    background: rgba(14, 18, 24, 0.94) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 10px !important;
    color: #f8fafc !important;
    padding: 8px 11px !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65) !important;
}

.sp-map-tooltip::before {
    border-top-color: rgba(14, 18, 24, 0.94) !important;
}

/* Estate Pin Marker on Map (Smaller Dot, No Outline, Red Glow) */
.sp-estate-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    outline: none;
    box-shadow: 0 0 8px 3px rgba(239, 68, 68, 0.88), 0 0 16px 6px rgba(239, 68, 68, 0.45);
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sp-estate-pin:hover {
    transform: translate(-50%, -50%) scale(1.35);
    box-shadow: 0 0 11px 4px rgba(239, 68, 68, 1), 0 0 22px 8px rgba(239, 68, 68, 0.65);
    z-index: 9999 !important;
}

.sp-estate-pin-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fecaca;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   4. FLOATING GLASS PANELS (Left, Center Map HUD)
   -------------------------------------------------------------------------- */
.sp-glass-panel {
    position: relative;
    z-index: 5;
    background: var(--sp-bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-lg);
    box-shadow: var(--sp-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* LEFT COLUMN: Total Estate Summary & Estate Quick-Jump Directory */
.sp-left-column {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 5;
    min-height: 0;
}

.sp-left-column-header {
    padding: 4px 6px 2px 6px;
    flex-shrink: 0;
}

.sp-left-main-title {
    margin: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.15;
    text-shadow: none;
    background: transparent;
}

/* Region filter pills at top of Left Column */
.sp-region-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: var(--sp-bg-panel);
    backdrop-filter: blur(18px);
    border: 1px solid var(--sp-border);
    border-radius: 999px;
    padding: 5px;
    box-shadow: var(--sp-shadow);
}

.sp-region-chip {
    background: transparent;
    border: none;
    color: var(--sp-text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 4px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
    white-space: nowrap;
}

.sp-region-chip:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.sp-region-chip.active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Total Estate KPI Card (Online Only) */
.sp-total-estate-card {
    padding: 14px;
    flex-shrink: 0;
}

.sp-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sp-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--sp-text-primary);
    letter-spacing: -0.1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-card-subtitle {
    font-size: 13px;
    color: var(--sp-text-secondary);
}

.sp-status-duo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.sp-status-tile {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--sp-border);
    border-radius: 14px;
    padding: 8px 13px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sp-status-tile:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--sp-border-bright);
}

.sp-status-icon-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.sp-status-icon-circle.online {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: none;
    font-size: 12px;
}

.sp-status-icon-circle.offline {
    background: rgba(255, 255, 255, 0.08);
    color: #a1a1aa;
    box-shadow: none;
}

.sp-status-bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.sp-status-label {
    font-size: 13.5px;
    color: var(--sp-text-secondary);
    font-weight: 500;
}

.sp-status-num {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--sp-text-primary);
    line-height: 1;
}

/* Estate Directory Card */
.sp-estate-directory-card {
    flex: 0 1 auto;
    min-height: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-estate-list-scroll {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 3px;
}

.sp-estate-list-scroll::-webkit-scrollbar,
.sp-notif-scroll::-webkit-scrollbar,
.sp-stress-bars-scroll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.sp-estate-list-scroll::-webkit-scrollbar-thumb,
.sp-notif-scroll::-webkit-scrollbar-thumb,
.sp-stress-bars-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.sp-estate-row-item {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--sp-border);
    border-radius: 12px;
    padding: 15px 14px;
    min-height: 58px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.sp-estate-row-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.sp-estate-row-item.active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.38);
}

.sp-estate-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
}

.sp-estate-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sp-estate-row-name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--sp-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-estate-row-meta {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--sp-text-secondary);
}

.sp-estate-owner-sublist {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--sp-text-secondary);
    line-height: 1.45;
    margin-top: 2px;
}

.sp-estate-row-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 2px;
}

.sp-stress-pill-mini {
    font-size: 12.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

/* Quick Module Launcher Footer inside Left Panel */
.sp-module-shortcuts {
    border-top: 1px solid var(--sp-border);
    padding-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.sp-module-mini-btn {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--sp-border);
    border-radius: 9px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--sp-text-primary);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
}

.sp-module-mini-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.sp-module-mini-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   5. CENTER MAP HUD OVERLAYS (Header, Dropdowns, Callout Card, Zoom Buttons)
   -------------------------------------------------------------------------- */
.sp-center-hud {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 4;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 10px;
}

.sp-map-top-hud {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

.sp-welcome-banner {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    max-width: 490px;
    padding: 18px 22px;
    border-radius: 16px;
    background: rgba(18, 22, 28, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sp-welcome-banner:hover {
    background: rgba(28, 33, 42, 0.94);
    border-color: rgba(255, 255, 255, 0.32);
}

.sp-welcome-header-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.sp-welcome-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: none;
    flex-shrink: 0;
}

.sp-welcome-title {
    font-size: 16.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.sp-welcome-banner b {
    color: #ffffff;
    font-weight: 700;
}

.sp-welcome-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #cbd5e1;
    font-weight: 400;
}

#sp-kpi-company-count {
    font-size: 33px;
}

/* Top-Right 3 Separated Cards Stack: 1. Overall Nutrient Level, 2. Overall Stress Level, 3. Stress Areas */
.sp-company-cards-stack {
    pointer-events: auto;
    width: 286px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.sp-company-subcard {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(18, 22, 28, 0.86);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.52);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-comp-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.65px;
    color: #94a3b8;
}

.sp-stress-areas-card {
    background: rgba(14, 19, 28, 0.42) !important;
    backdrop-filter: blur(12px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.sp-comp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sp-comp-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sp-comp-card-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    flex-shrink: 0;
}

.sp-comp-card-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-comp-card-count {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Top Horizontal Bar Chart (N, P, K, Mg, B, Ca) */
.sp-comp-nutrient-bars {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sp-comp-bar-row {
    display: grid;
    grid-template-columns: 24px 1fr 56px;
    align-items: center;
    gap: 9px;
}

.sp-comp-bar-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.1px;
}

.sp-comp-bar-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.sp-comp-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.45) 0%, #ffffff 100%);
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-comp-bar-val {
    font-family: 'Outfit', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    color: #cbd5e1;
    text-align: right;
    white-space: nowrap;
}

.sp-comp-card-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    width: 100%;
}

/* Card 2: Circular Stress Graphic */
.sp-comp-stress-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 2px 0;
}

.sp-comp-circle-wrap {
    position: relative;
    width: 74px;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-comp-ring-svg {
    width: 74px;
    height: 74px;
    transform: rotate(-90deg);
}

.sp-comp-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.09);
    stroke-width: 6.5;
}

.sp-comp-ring-prog {
    fill: none;
    stroke: #ffffff;
    stroke-width: 6.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.55s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
}

.sp-comp-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sp-comp-ring-val {
    font-family: 'Outfit', sans-serif;
    font-size: 16.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1;
}

.sp-comp-stress-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.sp-comp-stress-label {
    font-size: 11.5px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.1px;
}

.sp-comp-stress-badge {
    font-size: 11.5px;
    font-weight: 600;
    color: #f8fafc;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Card 3: Sleek Translucent Geospatial Stress Choropleth Map */
.sp-comp-geo-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sp-comp-geo-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sp-comp-geo-select {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 8px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.18s ease;
}

.sp-comp-geo-select:hover,
.sp-comp-geo-select:focus {
    border-color: rgba(255, 255, 255, 0.28);
}

.sp-comp-geo-select option {
    background: #12161c;
    color: #f8fafc;
}

.sp-comp-geo-mode-btn {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 7px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sp-comp-geo-mode-btn:hover,
.sp-comp-geo-mode-btn.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.sp-comp-geo-map-box {
    position: relative;
    width: 100%;
    height: 132px;
    border-radius: 12px;
    background: rgba(8, 12, 18, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.sp-comp-geo-svg-holder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
}

.sp-comp-geo-svg-holder svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.sp-comp-geo-svg-holder path,
.sp-comp-geo-svg-holder circle {
    transition: opacity 0.15s ease, stroke-width 0.15s ease;
}

.sp-comp-geo-svg-holder path:hover,
.sp-comp-geo-svg-holder circle:hover {
    opacity: 0.96;
    stroke: #ffffff !important;
    stroke-width: 1.4px !important;
}

.sp-comp-geo-tooltip {
    position: absolute;
    bottom: 6px;
    left: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(14, 18, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-comp-geo-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 10.5px;
    font-weight: 500;
    color: #cbd5e1;
}

.sp-comp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sp-comp-legend-item i {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    display: inline-block;
}

.sp-comp-geo-disclaimer {
    font-size: 9.8px;
    line-height: 1.38;
    color: rgba(203, 213, 225, 0.78);
    font-style: italic;
    margin-top: 1px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sp-map-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.75);
}

.sp-map-Hud-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    pointer-events: auto;
}

.sp-hud-pill-select {
    background: rgba(18, 22, 29, 0.86);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    font-family: inherit;
}

.sp-hud-pill-select:hover {
    border-color: rgba(255, 255, 255, 0.28);
}

.sp-hud-pill-btn {
    background: rgba(18, 22, 29, 0.86);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: all 0.18s ease;
}

.sp-hud-pill-btn:hover,
.sp-hud-pill-btn.active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.38);
    color: #ffffff;
}

/* Floating Estate Focus Callout on Map */
.sp-map-focus-callout {
    pointer-events: auto;
    align-self: flex-start;
    margin-left: 16px;
    background: rgba(18, 22, 29, 0.86);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 13px 16px;
    min-width: 215px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}

.sp-focus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sp-text-primary);
}

.sp-focus-sub {
    font-size: 11px;
    color: var(--sp-text-secondary);
    margin: 2px 0 8px 0;
}

.sp-focus-big-metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.sp-focus-pct {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.sp-focus-open-link {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    transition: all 0.18s ease;
}

.sp-focus-open-link:hover {
    background: #ffffff;
    color: #080a0e;
}

/* Bottom-Left Map Zoom Controls (+, Target, -) */
.sp-map-bottom-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.sp-map-zoom-cluster {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-zoom-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(18, 22, 29, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fafc;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    transition: all 0.18s ease;
}

.sp-zoom-circle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------------------------------
   6. RIGHT COLUMN: Notifications, Run History, Weekly Runs Left & Fertilizer Schedule
   -------------------------------------------------------------------------- */
.sp-right-column {
    grid-column: 3;
    grid-row: 1;
    z-index: 5;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-height: 0;
}

/* Weekly Runs Quota Strip */
.sp-weekly-quota-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 13px;
    padding: 10px 12px;
    flex-shrink: 0;
}

.sp-quota-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.sp-quota-title {
    font-size: 11.5px;
    font-weight: 600;
    color: #d1fae5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-quota-count {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #34d399;
}

.sp-quota-bar-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-bottom: 5px;
}

.sp-quota-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    transition: width 0.3s ease;
}

.sp-quota-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--sp-text-secondary);
}

/* Scrollable Notifications + Fertilizer Schedule Feed */
.sp-notif-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 3px;
}

.sp-section-divider-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--sp-text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.2px;
}

.sp-alert-card {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sp-alert-card.amber {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
}

.sp-alert-card.emerald {
    background: rgba(16, 185, 129, 0.11);
    border-color: rgba(16, 185, 129, 0.26);
}

.sp-alert-card.neutral {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--sp-border);
}

.sp-alert-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sp-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: #f8fafc;
}

.sp-alert-time {
    font-size: 10px;
    color: var(--sp-text-secondary);
}

.sp-alert-desc {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.4;
}

/* Fertilizer Schedule Builder Box inside Right Panel */
.sp-schedule-builder {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-sched-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.sp-sched-input,
.sp-sched-select {
    background: rgba(10, 13, 18, 0.85);
    border: 1px solid var(--sp-border-bright);
    border-radius: 7px;
    color: #f8fafc;
    font-size: 11px;
    padding: 6px 8px;
    font-family: inherit;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.sp-sched-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.sp-sched-btn:hover {
    opacity: 0.92;
}

/* --------------------------------------------------------------------------
   7. BOTTOM-LEFT PANEL: Stress Level for All Estates & Highest Stress Ratings
   -------------------------------------------------------------------------- */
.sp-bottom-left-panel {
    grid-column: 2;
    grid-row: 2;
    z-index: 5;
    padding: 13px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.sp-stress-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.sp-stress-headline-box {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.sp-stress-big-val {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.sp-highest-estate-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

/* Horizontal scrollable stress rating bars for all 20 estates */
.sp-stress-bars-scroll {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex: 1;
    min-height: 0;
}

.sp-stress-col-item {
    min-width: 74px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.sp-stress-col-item:hover,
.sp-stress-col-item.active {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
}

.sp-stress-col-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
}

.sp-stress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.sp-stress-fill {
    height: 100%;
    border-radius: 999px;
}

.sp-stress-col-name {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--sp-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-stress-col-rating {
    font-size: 9.5px;
    color: var(--sp-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --------------------------------------------------------------------------
   8. BOTTOM-RIGHT PANEL: 3 Months Back N, P, K, Mg, Ca, B Values per Estate
   -------------------------------------------------------------------------- */
.sp-bottom-right-panel {
    grid-column: 3;
    grid-row: 2;
    z-index: 5;
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.sp-nut-3m-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex: 1;
    min-height: 0;
}

.sp-nut-3m-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sp-nut-3m-card:hover {
    background: rgba(255, 255, 255, 0.075);
    border-color: var(--sp-border-bright);
}

.sp-nut-3m-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sp-nut-symbol {
    font-size: 11.5px;
    font-weight: 800;
    color: #ffffff;
}

.sp-nut-delta {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
}

.sp-nut-delta.up {
    color: #34d399;
    background: rgba(16, 185, 129, 0.14);
}

.sp-nut-delta.down {
    color: #f87171;
    background: rgba(239, 68, 68, 0.14);
}

.sp-nut-latest-val {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.1;
    margin: 2px 0;
}

.sp-nut-history-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9.2px;
    color: var(--sp-text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 3px;
}

/* Dark Modals (User Manual / System Settings / 3-Month Detail Modal) */
body.sp-dark-home .modal-content {
    background: #141922 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75) !important;
}

@media (max-width: 1280px) {
    .sp-command-stage {
        grid-template-columns: 375px 1fr;
    }
    .sp-top-pill span.pill-text {
        font-size: 11.5px;
    }
    .sp-search-box {
        width: 170px;
    }
}
