/* ============================================================
   WingWays RDW Dashboard — Design System & Custom Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ──────────────────────────────── */
:root {
    /* WingWays Brand Colors */
    --ww-gold: #F6D450;
    --ww-gold-hover: #E5C340;
    --ww-gold-light: #FEF9E7;
    --ww-gold-muted: #F6D45033;
    --ww-dark: #1A1A1A;
    --ww-dark-hover: #2D2D2D;
    --ww-dark-light: #3A3A3A;
    
    /* Text */
    --ww-text-primary: #1F2937;
    --ww-text-secondary: #6B7280;
    --ww-text-muted: #9CA3AF;
    --ww-text-inverse: #FFFFFF;
    
    /* Backgrounds */
    --ww-bg-primary: #FFFFFF;
    --ww-bg-secondary: #F8F9FB;
    --ww-bg-tertiary: #F1F3F5;
    
    /* Borders */
    --ww-border: #E5E7EB;
    --ww-border-light: #F3F4F6;
    
    /* Status Colors */
    --ww-success: #10B981;
    --ww-success-light: #D1FAE5;
    --ww-danger: #EF4444;
    --ww-danger-light: #FEE2E2;
    --ww-warning: #F59E0B;
    --ww-warning-light: #FEF3C7;
    --ww-info: #3B82F6;
    --ww-info-light: #DBEAFE;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-gold: 0 4px 14px rgba(246, 212, 80, 0.35);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ww-text-primary);
    background-color: var(--ww-bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar Styling ──────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--ww-bg-secondary);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb {
    background: var(--ww-border);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--ww-text-muted);
}

/* ── Login Page ─────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Fullscreen background image */
.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.login-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Hero text overlay */
.login-hero-text {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-10%);
    max-width: 620px;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.login-hero-text h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 4px 30px rgba(0, 0, 0, 0.4);
}

.login-hero-text p {
    font-size: 1.3rem;
    font-weight: 500;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 4px 30px rgba(0, 0, 0, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Login panel overlay */
.login-panel {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 48px 80px 48px 48px;
    position: absolute;
    inset: 0;
    z-index: 1;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 520px;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    padding: 48px 40px;
    animation: fadeInUp 0.6s ease-out;
}

.login-card .logo-container {
    text-align: center;
    margin-bottom: 36px;
}

.login-card .logo-container img {
    height: 48px;
    width: auto;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--ww-text-primary);
}

.login-card .subtitle {
    text-align: center;
    color: var(--ww-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ww-text-primary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--ww-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--ww-text-primary);
    background: var(--ww-bg-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-group input:focus {
    border-color: var(--ww-gold);
    box-shadow: 0 0 0 3px var(--ww-gold-muted);
}

.form-group input::placeholder {
    color: var(--ww-text-muted);
}

.btn-primary {
    width: 100%;
    padding: 13px 24px;
    background: var(--ww-gold);
    color: var(--ww-dark);
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--ww-gold-hover);
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(26, 26, 26, 0.2);
    border-top-color: var(--ww-dark);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .spinner { display: block; }

.login-error {
    display: none;
    padding: 12px 16px;
    background: var(--ww-danger-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--ww-danger);
    font-size: 0.8125rem;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

.login-error.active {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--ww-border-light);
    color: var(--ww-text-muted);
    font-size: 0.75rem;
}

/* ── Dashboard Layout ───────────────────────────────────── */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--ww-dark);
    color: var(--ww-text-inverse);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform var(--transition-normal);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1); /* Make logo white */
}

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

.sidebar-nav .nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: 12px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    color: var(--ww-text-inverse);
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
    color: var(--ww-dark);
    background: var(--ww-gold);
    font-weight: 500;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ww-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ww-dark);
    flex-shrink: 0;
}

.sidebar-user .user-info {
    overflow: hidden;
}

.sidebar-user .user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ww-text-inverse);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-email {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Header */
.dashboard-header {
    height: var(--header-height);
    background: var(--ww-bg-primary);
    border-bottom: 1px solid var(--ww-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-xs);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ww-text-primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--ww-text-primary);
    border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
    background: var(--ww-bg-tertiary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--ww-gold-light);
    color: var(--ww-dark);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.header-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--ww-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    border: 1.5px solid var(--ww-border);
    border-radius: var(--radius-full);
    color: var(--ww-text-secondary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    border-color: var(--ww-danger);
    color: var(--ww-danger);
    background: var(--ww-danger-light);
}

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

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    padding: 20px 24px;
    min-width: 0;
}

/* ── KPI Cards ──────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--ww-bg-primary);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    border: 1px solid var(--ww-border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--kpi-accent, var(--ww-gold));
    border-radius: 0 4px 4px 0;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-card .kpi-subtitle {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ww-text-muted);
    margin-bottom: 6px;
}

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

.kpi-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kpi-bg, var(--ww-gold-light));
}

.kpi-card .kpi-icon svg {
    width: 22px;
    height: 22px;
    color: var(--kpi-accent, var(--ww-gold));
}

.kpi-card .kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-full);
}

.kpi-card .kpi-trend.up {
    color: var(--ww-success);
    background: var(--ww-success-light);
}

.kpi-card .kpi-trend.down {
    color: var(--ww-danger);
    background: var(--ww-danger-light);
}

.kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ww-text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.kpi-card .kpi-label {
    font-size: 0.8125rem;
    color: var(--ww-text-secondary);
    font-weight: 400;
}

/* KPI Accent Variants */
.kpi-card[data-accent="gold"] { --kpi-accent: #F6D450; --kpi-bg: #FEF9E7; }
.kpi-card[data-accent="blue"] { --kpi-accent: #3B82F6; --kpi-bg: #DBEAFE; }
.kpi-card[data-accent="green"] { --kpi-accent: #10B981; --kpi-bg: #D1FAE5; }
.kpi-card[data-accent="purple"] { --kpi-accent: #8B5CF6; --kpi-bg: #EDE9FE; }

/* ── Top-3 KPI Cards ───────────────────────────────────── */
.top3-grid {
    margin-bottom: 16px !important;
}

.top3-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top3-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    background: var(--ww-bg-secondary);
    font-size: 0.78rem;
}

.top3-rank {
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--ww-text-muted);
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--kpi-bg, var(--ww-gold-light));
    color: var(--kpi-accent, var(--ww-gold));
    flex-shrink: 0;
}

.top3-name {
    flex: 1;
    font-weight: 500;
    color: var(--ww-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top3-count {
    font-weight: 700;
    color: var(--ww-text-primary);
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--ww-bg-primary);
    border: 1.5px solid var(--ww-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ww-text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--ww-gold);
    background: var(--ww-gold-light);
}

.filter-btn.active {
    border-color: var(--ww-gold);
    background: var(--ww-gold-light);
    color: var(--ww-dark);
}

.filter-btn svg {
    width: 16px;
    height: 16px;
    color: var(--ww-text-muted);
}

.filter-btn .filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--ww-gold);
    color: var(--ww-dark);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
}

/* Filter Dropdown */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: var(--ww-bg-primary);
    border: 1px solid var(--ww-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}

.filter-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-dropdown .dropdown-search {
    padding: 12px;
    border-bottom: 1px solid var(--ww-border-light);
}

.filter-dropdown .dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--ww-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8125rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.filter-dropdown .dropdown-search input:focus {
    border-color: var(--ww-gold);
}

.filter-dropdown .dropdown-actions {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--ww-border-light);
}

.filter-dropdown .dropdown-actions button {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ww-gold-hover);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.filter-dropdown .dropdown-actions button:hover {
    background: var(--ww-gold-light);
}

.filter-dropdown .dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px;
}

.filter-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 0.8125rem;
}

.filter-dropdown .dropdown-item:hover {
    background: var(--ww-bg-secondary);
}

.filter-dropdown .dropdown-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ww-gold);
    cursor: pointer;
    flex-shrink: 0;
}

/* Export Buttons */
.export-group {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1.5px solid var(--ww-border);
    border-radius: var(--radius-sm);
    background: var(--ww-bg-primary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ww-text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-export:hover {
    border-color: var(--ww-gold);
    background: var(--ww-gold-light);
    color: var(--ww-dark);
}

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

.btn-export.btn-excel:hover {
    border-color: #217346;
    background: #E8F5E9;
    color: #217346;
}

.btn-export.btn-pdf:hover {
    border-color: #1976D2;
    background: #E3F2FD;
    color: #1976D2;
}

/* ── Data Table ─────────────────────────────────────────── */
.table-container {
    background: var(--ww-bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--ww-border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ww-border-light);
}

.table-toolbar .table-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ww-text-primary);
}

.table-toolbar .table-count {
    font-size: 0.8125rem;
    color: var(--ww-text-secondary);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

table.data-table thead {
    background: var(--ww-bg-secondary);
    position: sticky;
    top: 0;
    z-index: 5;
}

table.data-table thead th {
    padding: 10px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--ww-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--ww-border);
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

table.data-table thead th:hover {
    color: var(--ww-text-primary);
}

table.data-table thead th.sorted {
    color: var(--ww-gold-hover);
}

table.data-table thead th .sort-arrow {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.3;
    transition: opacity var(--transition-fast);
}

table.data-table thead th.sorted .sort-arrow {
    opacity: 1;
}

table.data-table tbody tr {
    border-bottom: 1px solid var(--ww-border-light);
    transition: background var(--transition-fast);
}

table.data-table tbody tr:hover {
    background: rgba(246, 212, 80, 0.04);
}

table.data-table tbody tr:last-child {
    border-bottom: none;
}

table.data-table tbody td {
    padding: 10px 10px;
    color: var(--ww-text-primary);
    white-space: nowrap;
    font-size: 0.8rem;
}

/* Collapsible Rows */
.row-merk {
    cursor: pointer;
    font-weight: 600;
    background: var(--ww-bg-primary);
}

.row-merk:hover {
    background: rgba(246, 212, 80, 0.06) !important;
}

.row-merk td:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.row-merk .expand-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
    color: var(--ww-text-muted);
    flex-shrink: 0;
}

.row-merk.expanded .expand-icon {
    transform: rotate(90deg);
    color: var(--ww-gold);
}

.row-model {
    background: var(--ww-bg-secondary);
}

.row-model td:first-child {
    padding-left: 52px;
    font-weight: 400;
    color: var(--ww-text-secondary);
}

.row-model.hidden {
    display: none;
}

.row-model.showing {
    animation: fadeIn 0.2s ease;
}

/* Number formatting */
td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

td .trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

td .trend-badge.up {
    color: var(--ww-success);
    background: var(--ww-success-light);
}

td .trend-badge.down {
    color: var(--ww-danger);
    background: var(--ww-danger-light);
}

td .trend-badge.neutral {
    color: var(--ww-text-muted);
    background: var(--ww-bg-tertiary);
}

/* Y-1 dim columns */
td.dim {
    color: var(--ww-text-muted) !important;
    font-size: 0.75rem;
}

/* Market share badge */
td .ma-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: #1E40AF;
    background: #DBEAFE;
}

/* ── Period Selector ────────────────────────────────────── */
.period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-selector select {
    padding: 9px 32px 9px 12px;
    border: 1.5px solid var(--ww-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ww-text-primary);
    background: var(--ww-bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.period-selector select:focus {
    border-color: var(--ww-gold);
}

/* ── Skeleton Shimmer Loading ──────────────────────────── */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

@keyframes progressBar {
    0% { width: 0; }
    20% { width: 25%; }
    50% { width: 60%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

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

/* Top progress bar */
.loading-progress {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 3px;
    z-index: 999;
    background: var(--ww-border-light);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-progress.active {
    opacity: 1;
}

.loading-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--ww-gold), #F9E580, var(--ww-gold));
    border-radius: 0 2px 2px 0;
    animation: progressBar 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Skeleton base element */
.skeleton {
    background: linear-gradient(90deg,
        #f0f0f0 25%,
        #e0e0e0 37%,
        #f0f0f0 63%
    );
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: 6px;
}

/* Skeleton KPI cards */
.kpi-card.is-loading .kpi-value,
.kpi-card.is-loading .kpi-label {
    color: transparent;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.kpi-card.is-loading .kpi-value::after,
.kpi-card.is-loading .kpi-label::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: 6px;
}

.kpi-card.is-loading .kpi-value::after {
    width: 70%;
    height: 32px;
    top: 50%;
    transform: translateY(-50%);
}

.kpi-card.is-loading .kpi-label::after {
    width: 85%;
    height: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.kpi-card.is-loading .kpi-trend,
.kpi-card.is-loading #distributionBar,
.kpi-card.is-loading #distributionLegend {
    visibility: hidden;
}

.kpi-card.is-loading .kpi-icon {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.kpi-card.is-loading .kpi-icon svg {
    opacity: 0;
}

/* Skeleton table rows */
.skeleton-row td {
    padding: 14px 16px !important;
}

.skeleton-cell {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
    background-size: 800px 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-cell.wide { width: 120px; }
.skeleton-cell.medium { width: 70px; }
.skeleton-cell.small { width: 50px; }

.skeleton-row:nth-child(1) { animation: skeletonFadeIn 0.4s ease 0.0s both; }
.skeleton-row:nth-child(2) { animation: skeletonFadeIn 0.4s ease 0.05s both; }
.skeleton-row:nth-child(3) { animation: skeletonFadeIn 0.4s ease 0.10s both; }
.skeleton-row:nth-child(4) { animation: skeletonFadeIn 0.4s ease 0.15s both; }
.skeleton-row:nth-child(5) { animation: skeletonFadeIn 0.4s ease 0.20s both; }
.skeleton-row:nth-child(6) { animation: skeletonFadeIn 0.4s ease 0.25s both; }
.skeleton-row:nth-child(7) { animation: skeletonFadeIn 0.4s ease 0.30s both; }
.skeleton-row:nth-child(8) { animation: skeletonFadeIn 0.4s ease 0.35s both; }

/* Loading overlay text */
.loading-overlay-text {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--ww-dark);
    color: var(--ww-text-inverse);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(calc(-50% + var(--sidebar-width) / 2));
    z-index: 100;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.loading-overlay-text.active {
    opacity: 1;
}

.loading-overlay-text .dot-loader {
    display: flex;
    gap: 4px;
}

.loading-overlay-text .dot-loader span {
    width: 6px;
    height: 6px;
    background: var(--ww-gold);
    border-radius: 50%;
    animation: pulse 1.2s infinite;
}

.loading-overlay-text .dot-loader span:nth-child(2) { animation-delay: 0.2s; }
.loading-overlay-text .dot-loader span:nth-child(3) { animation-delay: 0.4s; }

/* Data reveal animation after loading */
.data-reveal .kpi-card {
    animation: fadeInUp 0.5s ease-out both !important;
}

.data-reveal .kpi-card:nth-child(1) { animation-delay: 0.05s !important; }
.data-reveal .kpi-card:nth-child(2) { animation-delay: 0.12s !important; }
.data-reveal .kpi-card:nth-child(3) { animation-delay: 0.19s !important; }
.data-reveal .kpi-card:nth-child(4) { animation-delay: 0.26s !important; }

/* ── Loading & Empty States ─────────────────────────────── */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    color: var(--ww-text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ww-border);
    border-top-color: var(--ww-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--ww-text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ww-text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--ww-text-secondary);
    max-width: 360px;
}

/* ── Toast Notifications ────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--ww-bg-primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--ww-gold);
    font-size: 0.8125rem;
    animation: slideInRight 0.3s ease;
    max-width: 380px;
}

.toast.success { border-left-color: var(--ww-success); }
.toast.error { border-left-color: var(--ww-danger); }

.toast.fade-out {
    animation: fadeOutRight 0.3s ease forwards;
}

/* ── Sidebar Overlay (Mobile) ───────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 45;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(80px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(80px);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

/* Staggered animations for KPI cards */
.kpi-card:nth-child(1) { animation: fadeInUp 0.5s ease-out 0.05s both; }
.kpi-card:nth-child(2) { animation: fadeInUp 0.5s ease-out 0.15s both; }
.kpi-card:nth-child(3) { animation: fadeInUp 0.5s ease-out 0.25s both; }
.kpi-card:nth-child(4) { animation: fadeInUp 0.5s ease-out 0.35s both; }

/* ── Disclaimer ────────────────────────────────────────── */
.disclaimer {
    margin-top: 24px;
    padding: 14px 18px;
    background: var(--ww-bg-primary);
    border: 1px solid var(--ww-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 0.7rem;
    line-height: 1.6;
    color: color-mix(in srgb, var(--ww-text-muted) 65%, transparent);
}

.disclaimer p {
    margin: 0;
}

.disclaimer strong {
    color: var(--ww-text-muted);
    font-weight: 500;
}

/* ── Responsive Design ──────────────────────────────────── */
@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .dashboard-content {
        padding: 20px 16px;
    }
    
    .dashboard-header {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .export-group {
        margin-left: 0;
    }
    
    .login-page {
        flex-direction: column;
    }

    .login-bg {
        position: absolute;
        height: 40vh;
    }

    .login-panel {
        padding: 24px;
        justify-content: center;
    }

    .login-card {
        max-width: 100%;
    }
    
    .table-toolbar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .period-selector {
        width: 100%;
    }
    
    .period-selector select {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .kpi-card .kpi-value {
        font-size: 1.5rem;
    }
    
    .dashboard-header h2 {
        font-size: 0.9375rem;
    }
}

/* ── Print Styles ───────────────────────────────────────── */
@media print {
    .sidebar,
    .dashboard-header,
    .filter-bar,
    .export-group,
    .btn-logout,
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .kpi-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .table-container {
        box-shadow: none;
    }
}

/* ============================================================
   News Module — Apple-News-style hero + grid
   Toegevoegd voor Nieuws-pagina (zie js/nieuws.js).
   Alle classes prefixed met `news-` om collisions te vermijden.
   ============================================================ */

/* ── Meta row ────────────────────────────────────────────── */
.news-meta-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem;
}
.news-meta { color: var(--ww-text-muted); font-size: 0.8rem; margin: 0; }
.news-refresh-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid var(--ww-border);
    padding: 7px 12px; border-radius: 8px;
    font-family: inherit; font-size: 0.75rem; color: var(--ww-text-secondary);
    cursor: pointer; transition: all var(--transition-fast);
}
.news-refresh-btn:hover:not(:disabled) { background: var(--ww-bg-secondary); }
.news-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.news-refresh-btn svg { width: 13px; height: 13px; }

/* ── Filter pills ────────────────────────────────────────── */
.news-pills {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 2rem; padding: 12px 0;
    position: sticky;
    top: var(--header-height);
    z-index: 30;
    background: rgba(248, 249, 251, 0.92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    /* Extend background full-width by negative margins matching dashboard-content padding (24px) */
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
    border-bottom: 1px solid var(--ww-border-light);
}
.news-pill {
    padding: 8px 16px; border-radius: 999px;
    font-family: inherit; font-size: 0.8rem; font-weight: 500;
    background: #fff; border: 1px solid var(--ww-border);
    color: var(--ww-text-secondary); cursor: pointer;
    transition: all var(--transition-fast); white-space: nowrap;
}
.news-pill:hover { border-color: var(--ww-text-muted); color: var(--ww-text-primary); }
.news-pill.active {
    background: var(--ww-dark); color: #fff;
    border-color: var(--ww-dark); font-weight: 600;
}
.news-pill-count {
    background: var(--ww-bg-secondary); color: var(--ww-text-muted);
    font-size: 0.7rem; padding: 1px 7px; border-radius: 999px;
    margin-left: 6px; font-weight: 600;
}
.news-pill.active .news-pill-count {
    background: rgba(246, 212, 80, 0.9); color: var(--ww-dark);
}

/* ── Hero card ───────────────────────────────────────────── */
.news-hero {
    position: relative; height: 380px;
    border-radius: 20px; overflow: hidden;
    margin-bottom: 2rem; cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.news-hero:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.news-hero-bg { position: absolute; inset: 0; }
.news-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.news-hero-bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.85) 100%);
}
.news-hero-content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 36px 40px; color: #fff;
}
.news-hero-meta {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
    flex-wrap: wrap;
}
.news-hero-cat {
    display: inline-flex; align-items: center;
    background: var(--ww-gold); color: var(--ww-dark);
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
    padding: 5px 11px; border-radius: 999px; text-transform: uppercase;
}
.news-hero-source { font-size: 0.75rem; opacity: 0.85; font-weight: 500; }
.news-hero-time { font-size: 0.75rem; opacity: 0.6; }
.news-hero-time::before { content: '·'; margin-right: 8px; opacity: 0.5; }
.news-hero-title {
    font-size: 1.85rem; font-weight: 700; line-height: 1.2;
    max-width: 75%; letter-spacing: -0.5px; margin-bottom: 12px;
}
.news-hero-summary {
    font-size: 0.95rem; line-height: 1.6; opacity: 0.85;
    max-width: 65%;
}

/* ── Section heading ─────────────────────────────────────── */
.news-section-title {
    font-size: 1.1rem; font-weight: 700; letter-spacing: -0.2px;
    margin: 0.5rem 0 1.2rem;
}

/* ── Grid + cards ────────────────────────────────────────── */
.news-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.news-card {
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: var(--shadow-sm); transition: all var(--transition-normal);
    cursor: pointer; display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.news-card-image { height: 160px; position: relative; overflow: hidden; }
.news-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card-image::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.15) 100%);
    pointer-events: none;
}
.news-card-cat {
    position: absolute; top: 12px; left: 12px;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
    color: var(--ww-text-primary);
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px;
    padding: 5px 9px; border-radius: 999px; text-transform: uppercase;
    z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.news-card-lang {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); color: #fff;
    font-size: 0.65rem; font-weight: 700; padding: 4px 8px;
    border-radius: 5px; z-index: 2; letter-spacing: 0.3px;
}
.news-card-body { padding: 18px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.news-card-title {
    font-size: 1rem; font-weight: 600; line-height: 1.35;
    letter-spacing: -0.2px; margin-bottom: 10px; color: var(--ww-text-primary);
}
.news-card-summary {
    font-size: 0.8rem; line-height: 1.55;
    color: var(--ww-text-secondary); margin-bottom: 14px; flex: 1;
}
.news-card-meta {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.7rem; color: var(--ww-text-muted);
    margin-top: auto; padding-top: 10px; border-top: 1px solid var(--ww-border);
}
.news-card-source { font-weight: 600; color: var(--ww-text-secondary); }
.news-card-time::before { content: '·'; margin: 0 6px; opacity: 0.5; }

/* ── Category tints (image fallback) ─────────────────────── */
.news-tint {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.5);
}
.news-tint svg { width: 64px; height: 64px; }
.news-tint-markt       { background: linear-gradient(135deg, #F6D450 0%, #E5C340 60%, #C99E0F 100%); }
.news-tint-ev          { background: linear-gradient(135deg, #064E3B 0%, #10B981 60%, #6EE7B7 100%); }
.news-tint-leasing     { background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 60%, #93C5FD 100%); }
.news-tint-regelgeving { background: linear-gradient(135deg, #581C87 0%, #8B5CF6 60%, #C4B5FD 100%); }
.news-tint-merken      { background: linear-gradient(135deg, #7C2D12 0%, #EA580C 60%, #FDBA74 100%); }
.news-tint-dealers     { background: linear-gradient(135deg, #831843 0%, #EC4899 60%, #F9A8D4 100%); }
.news-tint-aftersales  { background: linear-gradient(135deg, #451A03 0%, #78350F 60%, #B45309 100%); }
.news-tint-truck       { background: linear-gradient(135deg, #7F1D1D 0%, #DC2626 60%, #FCA5A5 100%); }
.news-tint-algemeen    { background: linear-gradient(135deg, #1F2937 0%, #4B5563 60%, #9CA3AF 100%); }

/* ── Sidebar badge for live news count ───────────────────── */
.nav-badge {
    margin-left: auto; background: var(--ww-gold); color: var(--ww-dark);
    font-size: 0.65rem; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
}
.nav-item.active .nav-badge { background: var(--ww-dark); color: var(--ww-gold); }

/* ── Mobile responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
    .news-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .news-hero { height: 280px; }
    .news-hero-content { padding: 24px 28px; }
    .news-hero-title { font-size: 1.5rem; max-width: 90%; }
    .news-hero-summary { max-width: 80%; font-size: 0.85rem; }
}

@media (max-width: 640px) {
    .news-grid { grid-template-columns: 1fr; }
    .news-hero { height: 220px; border-radius: 14px; }
    .news-hero-content { padding: 18px 20px; }
    .news-hero-title { font-size: 1.15rem; max-width: 100%; }
    .news-hero-summary { display: none; }
    .news-pills {
        flex-wrap: nowrap; overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -1rem; margin-right: -1rem; padding: 0 1rem 4px;
    }
    .news-pill { flex-shrink: 0; }
    .news-meta-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* News card anchor: reset link styling, keep card layout */
a.news-card { text-decoration: none; color: inherit; }
a.news-card:hover { text-decoration: none; color: inherit; }
.news-hero-link { display: block; width: 100%; height: 100%; color: inherit; text-decoration: none; }
.news-hero-link:hover { text-decoration: none; color: inherit; }

/* ── Share button + popover ──────────────────────────────── */
.news-card-share {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: none;
    color: var(--ww-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-fast), background var(--transition-fast);
    padding: 0;
}
.news-card-share:hover {
    background: var(--ww-gold);
    transform: scale(1.1);
}
.news-card-share svg { width: 16px; height: 16px; }

/* If language badge is present, push share button left of it */
.news-card-image .news-card-lang ~ .news-card-share,
.news-card-image .news-card-share ~ .news-card-lang {
    /* Place language badge top-right (existing styling); share button slightly to its left */
}
.news-card-image .news-card-lang { right: 52px; }  /* was 12px; shift left when share is also present */

.news-hero-share {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform var(--transition-fast), background var(--transition-fast);
    padding: 0;
}
.news-hero-share:hover {
    background: var(--ww-gold);
    color: var(--ww-dark);
    transform: scale(1.1);
}
.news-hero-share svg { width: 18px; height: 18px; }

.news-share-popover {
    background: #fff;
    border: 1px solid var(--ww-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 100;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: news-share-pop-in 150ms ease-out;
}
@keyframes news-share-pop-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.news-share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ww-text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}
.news-share-option:hover {
    background: var(--ww-bg-secondary);
    color: var(--ww-text-primary);
    text-decoration: none;
}
.news-share-option[data-channel="whatsapp"]:hover { background: rgba(37, 211, 102, 0.1); }
.news-share-option[data-channel="email"]:hover { background: rgba(59, 130, 246, 0.1); }

/* ── Category-tinted badges (cards + hero) ──────────────── */
/* Solid mid-tone colors matching each tint gradient. Override the
   default white-card-cat / gold-hero-cat backgrounds. */
.news-card-cat.news-cat-markt,
.news-hero-cat.news-cat-markt       { background: #E5C340; color: var(--ww-dark); }
.news-card-cat.news-cat-ev,
.news-hero-cat.news-cat-ev          { background: #10B981; color: #fff; }
.news-card-cat.news-cat-leasing,
.news-hero-cat.news-cat-leasing     { background: #3B82F6; color: #fff; }
.news-card-cat.news-cat-regelgeving,
.news-hero-cat.news-cat-regelgeving { background: #8B5CF6; color: #fff; }
.news-card-cat.news-cat-merken,
.news-hero-cat.news-cat-merken      { background: #EA580C; color: #fff; }
.news-card-cat.news-cat-dealers,
.news-hero-cat.news-cat-dealers     { background: #EC4899; color: #fff; }
.news-card-cat.news-cat-aftersales,
.news-hero-cat.news-cat-aftersales  { background: #92400E; color: #fff; }
.news-card-cat.news-cat-truck,
.news-hero-cat.news-cat-truck       { background: #DC2626; color: #fff; }
.news-card-cat.news-cat-algemeen,
.news-hero-cat.news-cat-algemeen    { background: #4B5563; color: #fff; }

/* ── Sidebar collapsible nav-groups (NL Car / NL Truck) ── */
.nav-parent {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    /* inherit nav-item base styling */
}
.nav-parent .nav-chevron {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
    opacity: 0.6;
}
.nav-parent[aria-expanded="true"] .nav-chevron {
    transform: rotate(90deg);
}
.nav-parent.has-active-child {
    color: var(--ww-gold);
}
.nav-children {
    overflow: hidden;
    max-height: 0;
    transition: max-height 220ms ease;
}
.nav-children.expanded {
    max-height: 240px;
}
.nav-child {
    padding-left: 48px;
    font-size: 0.92em;
    opacity: 0.78;
}
.nav-child:hover {
    opacity: 1;
}
.nav-child.active {
    opacity: 1;
}

/* ── Period preset pills (in filter-bar above the dropdowns) ── */
.period-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 8px;
}
.preset-pill {
    padding: 6px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid var(--ww-border);
    color: var(--ww-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.preset-pill:hover {
    border-color: var(--ww-text-muted);
    color: var(--ww-text-primary);
}
.preset-pill.active {
    background: var(--ww-dark);
    color: #fff;
    border-color: var(--ww-dark);
    font-weight: 600;
}

/* ── Partial-month banner (pro-rata scaling notice) ──────── */
.partial-month-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 0 1.25rem 0;
    background: var(--ww-warning-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 3px solid var(--ww-warning);
    border-radius: var(--radius-sm);
    color: #92580B;
    font-size: 0.82rem;
    line-height: 1.5;
}
.partial-month-banner svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--ww-warning);
}
.partial-month-banner strong {
    font-weight: 600;
    color: var(--ww-text-primary);
}

/* ── Stacked dropdown items (main + sub-label, e.g. type filter kg-range) ── */
.dropdown-item-stacked {
    align-items: flex-start;
}
.dropdown-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}
.dropdown-item-sub {
    font-size: 0.7rem;
    color: var(--ww-text-muted);
    font-weight: 400;
}

/* Info-icoon in tabel-header (ⓘ): toont pro-rata Y-1 uitleg op hover */
.col-info-icon {
    display: inline-block;
    color: #f59e0b;           /* amber, matching partial-month banner accent */
    font-size: 0.85em;
    cursor: help;
    margin-left: 2px;
    user-select: none;
}
.col-info-icon:hover {
    color: #d97706;
}

/* ────────────────────────────────────────────────────────────
   EU Car view — herbruikt NL-style filter-bar; alleen klein
   styling-extra voor land-ISO suffix in dropdown items.
   ──────────────────────────────────────────────────────────── */
.eu-filter-bar {
    margin-bottom: 1.25rem;
}
.eu-filter-bar .filter-dropdown .dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}
.eu-land-iso-suffix {
    color: var(--ww-text-muted, #6b7280);
    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    margin-left: 0.4em;
}

/* EU KPI grid */
.eu-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.eu-kpi {
    position: relative;
    overflow: hidden;
}
.eu-kpi .kpi-trend {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 0.35rem;
}
.eu-kpi .kpi-trend.up   { color: #059669; }
.eu-kpi .kpi-trend.down { color: #dc2626; }

/* EU merken-tabel */
#euMerkTable .rank-cell {
    width: 3rem;
    text-align: center;
    font-weight: 600;
    color: var(--ww-text-muted);
}
#euMerkTable .merk-cell {
    font-weight: 600;
    color: var(--ww-text-primary);
}
#euMerkTable .num-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
#euMerkTable .bev-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #d1fae5;
    color: #065f46;
}
#euMerkTable .trend-up   { color: #059669; font-weight: 600; }
#euMerkTable .trend-down { color: #dc2626; font-weight: 600; }
#euMerkTable .text-muted { color: var(--ww-text-muted); }

/* Trend chart */
.eu-trend-card {
    padding: 1.25rem 1.5rem;
}
.eu-trend-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ww-text-primary);
}
.eu-trend-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.85rem;
    color: var(--ww-text-secondary);
    margin-bottom: 0.5rem;
}
.eu-trend-chart .eu-trend-svg {
    width: 100%;
    height: auto;
    display: block;
}
.eu-trend-svg .eu-trend-grid {
    stroke: var(--ww-border, #e5e7eb);
    stroke-width: 1;
    stroke-dasharray: 2 3;
    opacity: 0.6;
}
.eu-trend-svg .eu-trend-yaxis,
.eu-trend-svg .eu-trend-xaxis {
    font-size: 11px;
    fill: var(--ww-text-muted, #6b7280);
}
.eu-trend-svg .eu-trend-dot {
    fill: #3b82f6;
    transition: r 0.15s ease;
}
.eu-trend-svg .eu-trend-dot:hover {
    r: 5;
}
.chart-empty,
.eu-trend-footnote {
    margin: 0.75rem 0 0;
    text-align: center;
    color: var(--ww-text-muted);
    font-size: 0.8rem;
}
.eu-trend-footnote {
    text-align: left;
    font-style: italic;
}

/* ── ACEA tabel-stijlen ──────────────────────────────────────── */
#euAceaMerkTable tr.acea-group-row td {
    background: rgba(246, 212, 80, 0.08);
    font-weight: 600;
}
#euAceaMerkTable tr.acea-sub-row td:first-child {
    padding-left: 1.75rem;
    color: var(--ww-text-muted, #6b7280);
}
#euAceaMerkTable .acea-indent {
    color: var(--ww-text-muted, #9ca3af);
    margin-right: 4px;
}
#euAceaMerkTable .acea-parent {
    display: block;
    font-size: 0.7rem;
    color: var(--ww-text-muted, #9ca3af);
    font-weight: 400;
    margin-top: 2px;
}
#euAceaLandTable tr.acea-agg-row td {
    background: rgba(59, 130, 246, 0.06);
    font-weight: 600;
    border-top: 2px solid var(--ww-border, #e5e7eb);
}
#euAceaMerkTable .acea-chevron {
    display: inline-block;
    width: 14px;
    margin-right: 6px;
    color: var(--ww-text-muted, #6b7280);
    transition: transform 0.15s ease;
    user-select: none;
    font-size: 0.7rem;
}
#euAceaMerkTable .acea-chevron.expanded {
    transform: rotate(90deg);
}
#euAceaMerkTable .acea-chevron-spacer {
    display: inline-block;
    width: 14px;
    margin-right: 6px;
}
#euAceaMerkTable tr.acea-group-row:hover td {
    background: rgba(246, 212, 80, 0.16);
}

