@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Premium Color Palette - Turquoise, Silver, Fluorescent Green */
    --primary: #1A234E;
    /* Rich Noticeable Navy */
    --primary-dark: #121836;
    --turquoise: #00D2D3;
    --green: #39FF14;
    --silver: #E2E8F0;
    --platinum: #F8FAFB;
    /* Very clean background */
    --white: #FFFFFF;

    --secondary: var(--turquoise);
    --secondary-glow: rgba(0, 210, 211, 0.3);
    --accent: var(--green);

    --text-main: #2D3748;
    --text-muted: #A0AEC0;
    --text-silver: #718096;

    --border: #F1F5F9;
    --border-glow: linear-gradient(90deg, var(--turquoise), var(--green));

    --shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--platinum);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
.logo-text {
    font-family: 'Outfit', sans-serif;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-rich);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling - Premium Dark with Turquoise Accents */
aside.sidebar {
    width: 250px;
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0.75rem;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 100;
    border-right: 1px solid rgba(0, 210, 211, 0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.25rem;
    padding: 10px 15px;
    background: rgba(0, 210, 211, 0.05);
    border: 1px solid rgba(0, 210, 211, 0.2);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 210, 211, 0.1);
    transition: var(--transition);
    cursor: pointer;
    width: fit-content;
}

.logo-container:hover {
    background: rgba(0, 210, 211, 0.08);
    border-color: rgba(0, 210, 211, 0.4);
    box-shadow: 0 0 30px rgba(0, 210, 211, 0.2);
    transform: translateY(-2px);
}

.logo-icon {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px var(--turquoise)) drop-shadow(0 0 15px rgba(57, 255, 20, 0.4));
    animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px var(--turquoise)) drop-shadow(0 0 15px rgba(57, 255, 20, 0.4));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 12px var(--turquoise)) drop-shadow(0 0 25px rgba(57, 255, 20, 0.6));
        transform: scale(1.05);
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    20%,
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #FFFFFF 0%, var(--turquoise) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-top: 1px;
}

nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* hide scrollbar visually but still scrollable */
    scrollbar-width: none;
}

nav::-webkit-scrollbar {
    display: none;
}


nav ul {
    list-style: none;
}

nav li {
    margin-bottom: 0.1rem;
}

nav a {
    color: var(--text-silver);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.82rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

nav a:hover {
    color: white;
    background: rgba(0, 210, 211, 0.05);
    transform: translateX(4px);
}

nav a.active {
    background: linear-gradient(90deg, rgba(0, 210, 211, 0.15) 0%, transparent 100%);
    color: var(--secondary);
    border-left: 3px solid var(--secondary);
    border-radius: 0 6px 6px 0;
    margin-left: -0.75rem;
    padding-left: calc(0.75rem + 1px);
    font-weight: 600;
}

nav a svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
    flex-shrink: 0;
}

/* Sidebar Footer (Settings) — matches nav a style */
.sidebar-footer {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-footer a {
    color: var(--text-silver);
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: var(--transition);
    border: 1px solid transparent;
    width: 100%;
}

.sidebar-footer a:hover {
    color: white;
    background: rgba(0, 210, 211, 0.05);
    transform: translateX(6px);
}

.sidebar-footer a svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
    flex-shrink: 0;
}


/* ============================================================
   MODAL SYSTEM
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 36, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-group label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}


main {
    flex: 1;
    min-width: 0;
    padding: 2.5rem 3rem;
    overflow-x: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Premium Buttons - Active Version Style */
button.premium-btn {
    background: var(--primary);
    color: white;
    padding: 0.8rem 2rem 0.8rem 0.8rem;
    /* Space for icon box */
    border-radius: var(--radius-lg);
    font-weight: 800;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px -10px rgba(90, 74, 238, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: relative;
}

.btn-icon-box {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.premium-btn:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
    box-shadow: 0 15px 40px -10px rgba(90, 74, 238, 0.5);
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.btn-label {
    font-size: 0.65rem;
    font-weight: 700;
    opacity: 0.8;
}

.btn-value {
    font-size: 1.1rem;
    font-weight: 800;
}

/* Stats Cards - Inspiration Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--white);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-premium);
    border: 1px solid transparent;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--border-glow);
    opacity: 0.8;
}

.stat-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.box-blue {
    background: rgba(90, 74, 238, 0.08);
    color: var(--primary);
}

.box-green {
    background: rgba(57, 255, 20, 0.08);
    color: #059669;
}

.box-turquoise {
    background: rgba(0, 210, 211, 0.08);
    color: #00A8A9;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a202c;
    line-height: 1.2;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 800;
    margin-top: 8px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Main Cards & Sections */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border);
    padding: 2.25rem;
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}

.section-title::before {
    content: '';
    width: 6px;
    height: 24px;
    background: linear-gradient(to bottom, var(--secondary), var(--accent));
    border-radius: 4px;
}

/* Premium Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
}

th {
    text-align: left;
    padding: 1rem 1.75rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

td {
    padding: 1.25rem 1.75rem;
    background: white;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

td:first-child {
    border-left: 1px solid var(--border);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

td:last-child {
    border-right: 1px solid var(--border);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

tr:hover td {
    background: #fdfdfd;
    border-color: var(--secondary-glow);
    box-shadow: 0 10px 20px rgba(0, 210, 211, 0.05);
    transform: translateY(-2px);
    z-index: 10;
}

/* Status Badges - Premium Style */
.status-pill {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-active {
    background: rgba(57, 255, 20, 0.1);
    color: #065f46;
}

.status-active::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

.status-pending {
    background: rgba(251, 191, 36, 0.1);
    color: #92400e;
}

/* Forms & Inputs */
input,
select,
textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-silver);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px var(--secondary-glow);
}

/* Map Container Premium */
#map-container {
    height: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 210, 211, 0.1);
    border: 1px solid var(--border-rich);
}

/* Modals - Glassmorphism */
#edit-modal {
    backdrop-filter: blur(12px);
    background: rgba(5, 11, 24, 0.7) !important;
}

.modal-content {
    background: white !important;
    padding: 3rem !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Visit Feed Item - Premium Glassmorphism */
.visit-feed-item {
    background: white;
    margin-bottom: 14px;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.visit-feed-item:hover {
    transform: translateX(8px);
    border-color: var(--secondary);
    box-shadow: 0 12px 24px rgba(0, 210, 211, 0.08);
}

.visit-salesman {
    font-weight: 800;
    color: var(--primary);
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.visit-time {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    background: rgba(0, 210, 211, 0.08);
    padding: 4px 10px;
    border-radius: 99px;
}

.tag-gps {
    font-size: 0.7rem;
    background: rgba(57, 255, 20, 0.1);
    color: #166534;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Responsive & Mobile Sidebar Override */
@media (max-width: 1024px) {
    main {
        padding: 2rem;
    }
}

/* Desktop styles for toggle */
@media (min-width: 769px) {
    #menu-toggle {
        display: none !important;
    }
}

@media (max-width: 768px) {
    #menu-toggle {
        display: block !important;
    }


    aside.sidebar {
        display: flex !important;
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        transition: left 0.3s ease-in-out;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    aside.sidebar.open {
        left: 0;
    }

    main {
        padding: 1rem;
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    header h1 {
        font-size: 1.25rem;
    }

    #map-container {
        height: 300px;
        margin-bottom: 2rem;
    }

    section.card {
        padding: 0;
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }
}

/* --- Approval Flow UI --- */
.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.bg-success {
    background-color: var(--success);
}

.bg-danger {
    background-color: var(--danger);
}

.btn-approve {
    background-color: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn-approve:hover {
    opacity: 0.9;
}

.btn-reject {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn-reject:hover {
    opacity: 0.9;
}

/* Data Freshness Badges */
.data-freshness-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    vertical-align: middle;
}

.freshness-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.freshness-badge.sales {
    background: rgba(0, 210, 211, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(0, 210, 211, 0.2);
}

.freshness-badge.stock {
    background: rgba(26, 35, 78, 0.05);
    color: var(--primary);
    border: 1px solid rgba(26, 35, 78, 0.1);
}

/* Sidebar Section Labels */
.sidebar-section-label {
    margin-top: 1.5rem;
    padding: 0 1.25rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.25);
    display: block;
}

/* Header UI Components */
.header-breadcrumb {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-breadcrumb .active {
    color: var(--primary);
    font-weight: 700;
}

.live-view-indicator {
    position: absolute;
    top: 25px;
    left: 25px;
    z-index: 500;
    background: var(--surface-glass);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-rich);
}

.dot-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent);
    margin-right: 8px;
}

.activity-feed-card {
    display: flex;
    flex-direction: column;
    background: var(--platinum);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    margin-top: 4rem;
}

.empty-state i {
    width: 48px;
    height: 48px;
    opacity: 0.2;
    margin-bottom: 1rem;
}

/* Threshold Page Styles */
.threshold-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.threshold-card {
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.threshold-preview {
    flex: 1;
    background: var(--platinum);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-bar {
    height: 40px;
    width: 100%;
    background: #e2e8f0;
    border-radius: 10px;
    display: flex;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

/* --- Live Ticker System --- */
.ticker-container {
    width: 100%;
    background: var(--primary);
    color: white;
    overflow: hidden;
    height: 28px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-family: 'JetBrains Mono', monospace;
    position: sticky;
    top: 0;
    z-index: 2000;
}

.ticker-wrap {
    display: flex;
    width: 100%;
}

.ticker-move {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite; /* Slower, smoother scroll */
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 60px; /* More spacing for clarity */
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.85);
}

.ticker-item i {
    margin-right: 10px;
    color: var(--secondary);
    width: 14px;
    height: 14px;
}

.ticker-item b {
    color: white;
    margin-left: 5px;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Half translate for duplicated content */
}

/* --- Responsive Layout Fixes --- */
@media (max-width: 900px) {
    .universe-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .universe-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .data-freshness-wrapper {
        margin-left: 0;
        margin-top: 8px;
        flex-wrap: wrap;
    }
}

/* Component Overrides for Lint Fixes */
.user-profile-btn {
    width: 48px; 
    height: 48px; 
    border-radius: 14px; 
    background: var(--silver); 
    border: 2px solid white; 
    box-shadow: var(--shadow-premium); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--primary);
}

.breadcrumb-label {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-active {
    color: var(--primary);
    font-weight: 700;
}

/* ============================================================
   SHARED SEARCH COMPONENTS (Violation #19 Fix)
   ============================================================ */
.search-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper i,
.search-input-wrapper svg {
    position: absolute !important;
    left: 1.25rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--text-muted) !important;
    width: 20px !important;
    height: 20px !important;
    pointer-events: none;
    z-index: 10;
}

.search-input {
    padding-left: 3.5rem !important;
    height: 60px !important;
    border-radius: 16px !important;
    border: 2px solid var(--border) !important;
    font-size: 1rem !important;
    background: white !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    transition: var(--transition) !important;
    width: 100%;
    outline: none;
}

.search-input:focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 8px 25px rgba(0, 210, 211, 0.1) !important;
}

/* ============================================================
   SIDEBAR SECTION HEADERS (Violation #20 Fix)
   ============================================================ */
.sidebar-section-header {
    margin-top: 1.5rem;
    padding: 0 1.25rem;
    display: block;
}

.sidebar-section-header span {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   TABLE CELL REUSABLES (Violation #24 Fix)
   ============================================================ */
.cell-code {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.85rem;
    padding-left: 1.5rem;
}

.cell-bold {
    font-weight: 700;
}

.cell-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cell-center {
    text-align: center;
}

.cell-right {
    text-align: right;
}

.cell-secondary {
    font-weight: 800;
    color: var(--secondary);
}

.cell-num {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
    text-align: center;
}

.cell-inf {
    font-weight: 900;
    color: var(--primary);
    background: var(--platinum);
    text-align: center;
}

.tfoot-accent {
    background: var(--platinum);
    border-top: 2px solid var(--border);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.tfoot-label {
    font-weight: 900;
    color: var(--primary);
    padding: 1.25rem 1.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tfoot-value {
    text-align: center;
    font-weight: 900;
    color: var(--primary);
    font-size: 1rem;
    border-left: 1px solid rgba(0,0,0,0.05);
}

.schedule-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.schedule-date {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-beat {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--platinum);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary);
    white-space: nowrap;
}

/* Matrix Table System */
.matrix-container {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
    margin-bottom: 2rem;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.matrix-table th {
    padding: 0.75rem 0.6rem;
    background: #F8FAFC;
    border-bottom: 2px solid var(--border);
    text-align: right;
    white-space: nowrap;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.78rem;
}

.matrix-table th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 20;
    background: #F8FAFC;
    border-right: 2px solid var(--border);
}

.matrix-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.8rem;
}

.matrix-sticky-col {
    position: sticky;
    left: 0;
    background: white !important;
    font-weight: 800;
    color: var(--primary);
    z-index: 10;
    border-right: none;
    text-align: left !important;
    min-width: 130px;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.matrix-metric-col {
    position: sticky;
    left: 130px;
    background: white !important;
    z-index: 10;
    border-right: 2px solid var(--border);
    text-align: left !important;
    min-width: 72px;
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-muted);
    font-weight: 500;
}

.matrix-table th.matrix-metric-col {
    background: #F8FAFC !important;
    z-index: 20;
    font-weight: 700;
}

.matrix-table th.matrix-sticky-col {
    background: #F8FAFC !important;
    z-index: 20;
    border-right: none;
}

.matrix-summary-row .matrix-sticky-col {
    background: #F1F5F9 !important;
}

.matrix-summary-row .matrix-metric-col {
    background: #F1F5F9 !important;
}

.matrix-summary-row {
    background: #F1F5F9 !important;
    font-weight: 800 !important;
}

.matrix-summary-row td {
    color: var(--primary);
    font-weight: 900 !important;
    border-top: 2px solid var(--border);
}

.beat-cell {
    background: rgba(0, 210, 211, 0.1);
    color: var(--secondary);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.empty-cell {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.5;
}

.today-col {
    background: rgba(5, 150, 105, 0.05) !important;
}

/* Threshold Management System */
.threshold-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.config-panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
}

.config-panel h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.config-panel p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.threshold-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.zone-label {
    font-weight: 800;
    margin-bottom: 2px;
}

.zone-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Zone Specifics */
.label-purple { color: #8B5CF6; }
.label-yellow { color: #EAB308; }
.label-red { color: #EF4444; }
.label-green { color: #10B981; }

.dot-purple { background: #8B5CF6; }
.dot-yellow { background: #F59E0B; }
.dot-red { background: #EF4444; }
.dot-green { background: #10B981; }

.threshold-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.threshold-input-group span {
    font-size: 0.8rem;
    font-weight: 700;
}

.threshold-field {
    width: 80px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-weight: 800;
    text-align: center;
}

.save-all-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.04em;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.save-all-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(26, 35, 78, 0.3);
}

.preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
}

.preview-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.coverage-bar {
    position: relative;
    height: 36px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    margin-bottom: 1rem;
}

.bar-seg {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: white;
    transition: var(--transition);
}

.bar-red { background: #EF4444; }
.bar-yellow { background: #F59E0B; }
.bar-green { background: #10B981; }
.bar-purple { background: #8B5CF6; }

.legend-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rule-summary {
    background: var(--platinum);
    border-radius: 12px;
    padding: 1rem;
}

.rule-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.rule-row:last-child {
    border-bottom: none;
}

.rule-label {
    font-weight: 600;
    color: var(--text-muted);
}

.rule-val {
    font-weight: 800;
}

.save-status-msg {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    min-height: 20px;
}

.breadcrumb-sep {
    width: 12px;
}

.btn-icon {
    width: 20px;
    color: white;
}

.btn-icon-sm {
    width: 16px;
}

/* Territory Management System */
.territory-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.control-panel {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.assignment-matrix {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
}

.bulk-header {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    display: block;
}

.salesman-hero {
    background: var(--platinum);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.salesman-hero .avatar {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
}

.method-card {
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.method-card:hover {
    border-color: var(--secondary);
    background: rgba(0, 210, 211, 0.02);
}

.method-card.active {
    border-color: var(--secondary);
    background: rgba(0, 210, 211, 0.05);
    box-shadow: 0 4px 20px rgba(0, 210, 211, 0.1);
}

.method-card h4 {
    font-size: 0.95rem;
    color: var(--primary);
    margin: 0 0 4px 0;
    font-weight: 700;
}

.method-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.assignment-row {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assignment-row:last-child {
    border-bottom: none;
}

.retailer-info small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.owner-tag {
    background: rgba(0, 210, 211, 0.1);
    color: var(--secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
}

.btn-assign {
    width: 100%;
    padding: 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.95rem;
    margin-top: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-assign:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-assign:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.search-badge {
    background: var(--platinum);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
}

/* Searchable Dropdown Management */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    margin-top: 5px;
}

.dropdown-item {
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(0, 210, 211, 0.1);
    color: var(--secondary);
}

/* Global Profile & Toast Notifications (Extracted from common.js) */
.profile-modal {
    display: none;
    position: fixed;
    top: 80px;
    right: 30px;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-premium);
    z-index: 3000;
    padding: 1.5rem;
    animation: slideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.profile-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, #1e2a5e 100%);
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-name {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.1rem;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 4px;
}

.profile-menu-item:hover {
    background: rgba(0, 210, 211, 0.05);
    color: var(--secondary);
}

.profile-menu-item.danger:hover {
    background: rgba(220, 38, 38, 0.05);
    color: #DC2626;
}

.profile-menu-item i {
    width: 16px;
    height: 16px;
}

.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    color: var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    font-weight: 700;
    font-size: 0.9rem;
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 5px solid var(--secondary);
    transition: var(--transition);
}

.toast.danger { border-left-color: #DC2626; }
.toast.success { border-left-color: #059669; }

@keyframes toast-in {
    from { transform: translateX(100%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast-faded {
    opacity: 0;
    transform: translateX(20px);
}

.toast-icon {
    width: 18px;
    height: 18px;
}

/* Target Management System */
.page-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.form-panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
}

.form-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.25rem;
}

.field-group label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.field-group input,
.field-group select {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    background: var(--platinum);
    transition: var(--transition);
}

.field-group input:focus,
.field-group select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 210, 211, 0.15);
    background: white;
}

.month-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.04em;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26, 35, 78, 0.3);
}

.table-panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
}

.table-panel h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.filter-row select,
.filter-row input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    background: var(--platinum);
    flex: 1;
}

.target-pill {
    background: rgba(0, 210, 211, 0.08);
    color: #007A7B;
    padding: 6px 14px;
    border-radius: 99px;
    font-weight: 800;
    font-size: 0.85rem;
    display: inline-block;
}

.brand-tag {
    background: rgba(26, 35, 78, 0.08);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
}

.period-tag {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.del-btn {
    background: rgba(220, 38, 38, 0.08);
    color: #DC2626;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: var(--transition);
}

.del-btn:hover {
    background: rgba(220, 38, 38, 0.15);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    opacity: 0.2;
    margin-bottom: 1rem;
}

.salesman-name-cell {
    font-weight: 700;
}

.status-msg {
    margin-top: 1rem;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 600;
    min-height: 20px;
}

.status-msg.success { color: #059669; }
.status-msg.error { color: #DC2626; }
.status-msg.loading { color: var(--text-muted); }

/* Inventory & Stock Alert Styles */
.inventory-table {
    min-width: 1000px;
    border-spacing: 0;
    width: 100%;
}

.inventory-table th {
    font-size: 0.7rem;
    background: var(--platinum);
    border-bottom: 2px solid var(--border);
    padding: 0.75rem 0.5rem;
    white-space: normal !important;
    min-width: 120px;
    max-width: 140px;
    text-align: center;
    line-height: 1.2;
    vertical-align: middle;
    height: 80px;
    letter-spacing: 0.02em;
    word-wrap: break-word;
}

.inventory-table td {
    padding: 0.75rem !important;
    min-width: 120px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

/* Sticky First Column for Inventory */
.inventory-table th:first-child,
.inventory-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background: white;
    border-right: 2px solid var(--border);
    min-width: 200px;
    width: 200px;
    text-align: left;
    white-space: normal !important;
    padding-left: 1.5rem !important;
}

.inventory-table th:first-child {
    background: var(--platinum);
    z-index: 30;
    height: 90px;
}

/* Stock Status Colors */
.critical-stock { background: #DC2626 !important; color: white !important; font-weight: 800; }
.warning-stock  { background: #FACC15 !important; color: #1A234E !important; font-weight: 800; }
.healthy-stock  { background: #059669 !important; color: white !important; font-weight: 800; }
.surplus-stock  { background: #A855F7 !important; color: white !important; font-weight: 800; }
.inactive-stock { background: #3B82F6 !important; color: white !important; font-weight: 800; }

.stock-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 100%;
    min-height: 48px;
    transition: var(--transition);
}

.doc-value {
    font-size: 0.65rem;
    opacity: 0.8;
    margin-top: 2px;
}

.legend-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--platinum);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    width: fit-content;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Retailer & Paging Styles */
.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    align-items: center;
}

.total-count-badge {
    background: var(--platinum);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary);
    border: 1px solid var(--border);
}

.search-engine-btn {
    min-width: 140px;
    height: 60px;
    justify-content: center;
    background: var(--primary) !important;
    color: white !important;
    border-radius: 16px !important;
    font-weight: 800;
    border: none !important;
    box-shadow: 0 4px 15px rgba(26, 35, 78, 0.2);
}

.modal-footer {
    margin-top: 3rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.tag-gps {
    background: rgba(26, 35, 78, 0.04);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tag-gps i {
    width: 12px;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-group-span {
    grid-column: span 2;
}

.detail-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.detail-value-bold {
    font-weight: 800;
    color: var(--primary);
}

.detail-value-secondary {
    font-weight: 800;
    color: var(--secondary);
}

.detail-value-mono {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 700;
}

.detail-value-muted {
    font-weight: 700;
    color: var(--text-muted);
}

/* Dashboard Pulse Styles */
.stat-trend-default { color: var(--text-muted); }
.stat-trend-verified { color: var(--secondary); font-weight: 800; }
.stat-trend-live { color: var(--primary); font-weight: 800; }

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.map-card {
    padding: 10px;
    overflow: hidden;
    height: 550px;
    position: relative;
    background: var(--platinum);
}

.map-badge {
    position: absolute;
    top: 25px;
    left: 25px;
    z-index: 500;
    background: var(--surface-glass);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-rich);
}

.map-badge h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent);
}

.activity-card {
    display: flex;
    flex-direction: column;
    background: var(--platinum);
}

.activity-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.activity-empty {
    text-align: center;
    color: var(--text-muted);
    margin-top: 4rem;
}

.activity-empty i {
    width: 48px;
    height: 48px;
    opacity: 0.2;
    margin-bottom: 1rem;
}

#map-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Modal System Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26,35,78,0.6);
    backdrop-filter: blur(8px);
    z-index: 4000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { transform: scale(0.95) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.modal-title h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.modal-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.modal-close-btn {
    background: var(--platinum);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.modal-form {
    display: grid;
    gap: 1.5rem;
}

.form-group-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.modal-btn-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-btn-row button {
    flex: 1;
    justify-content: center;
}

/* Schedule Chips */
.schedule-chip {
    background: rgba(0, 210, 211, 0.08);
    border: 1px solid rgba(0, 210, 211, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.schedule-date {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--secondary);
    text-transform: uppercase;
}

.schedule-beat {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
}

.status-pill.hub-active {
    background: rgba(0, 210, 211, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(0, 210, 211, 0.2);
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.page-btn {
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--secondary);
    color: var(--secondary);
    transform: translateY(-2px);
}

.matrix-empty-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

.retailer-name-title {
    font-weight: 700;
    color: var(--primary);
}

.assignment-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.assignment-meta-text {
    text-align: right;
}

.assignment-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 4px;
}

.btn-terminate {
    padding: 4px;
    border-radius: 6px;
    color: #DC2626;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn-terminate:hover {
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.2);
}

.status-success {
    color: #059669;
}

.status-error {
    color: #DC2626;
}

.input-label-sm {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.territory-select {
    padding-left: 1rem;
    width: 100%;
    height: 54px;
    border-radius: 12px;
    cursor: pointer;
}

.hero-details {
    display: flex;
    flex-direction: column;
}

.hero-name {
    font-weight: 800;
    color: var(--primary);
}

.hero-coverage {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.header-p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.field-group-mb {
    margin-bottom: 1.5rem;
}

/* Universe Cards */
.universe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.u-card {
    background: white;
    padding: 1.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.u-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
}

/* Specific Accents */
.u-card.accent-purple {
    border-left: 4px solid #8B5CF6;
}
.u-card.accent-purple .u-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}
.u-card.accent-purple .u-val {
    color: #6D28D9;
}

.u-card.accent-green {
    border-left: 4px solid #10B981;
}
.u-card.accent-green .u-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}
.u-card.accent-green .u-val {
    color: #059669;
}

.u-val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.u-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.brand-badge {
    background: rgba(26, 35, 78, 0.05);
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.85rem;
}

.cases-val {
    font-family: 'JetBrains Mono', monospace;
    color: var(--secondary);
    font-weight: 800;
}

.cell-premium {
    font-weight: 800;
    color: var(--primary);
    background: rgba(26, 35, 78, 0.05);
    padding: 4px 12px;
    border-radius: 6px;
}

/* ============================================================
   LAYOUT CONSISTENCY (Violation #21 Fix)
   ============================================================ */
main {
    padding: 2rem 2.5rem !important;
    min-width: 0 !important;
}

.brand-table-card {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
    padding: 2rem;
    margin-top: 1rem;
}

.brand-table-card h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-table {
    width: 100%;
    border-collapse: collapse;
}

.brand-table th {
    text-align: left;
    padding: 1rem;
    background: var(--platinum);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.brand-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
}