/* ============================================================================
   MGTickets Reseller Portal - Main Stylesheet
   Globale styles, variabelen, layout en componenten
   ============================================================================ */

:root {
    /* Brand Colors */
    --primary: #E53935;
    --primary-dark: #C62828;
    --primary-light: #FFEBEE;

    /* Grays */
    --gray-900: #1a1a2e;
    --gray-800: #2d2d44;
    --gray-700: #404060;
    --gray-600: #6c6c8a;
    --gray-500: #9999b3;
    --gray-400: #b3b3c6;
    --gray-300: #d1d1e0;
    --gray-200: #e8e8f0;
    --gray-100: #f5f5f9;
    --gray-50: #fafafc;

    /* Status Colors */
    --success: #4CAF50;
    --success-light: #E8F5E9;
    --warning: #FF9800;
    --warning-light: #FFF3E0;
    --error: #F44336;
    --error-light: #FFEBEE;
    --info: #2196F3;
    --info-light: #E3F2FD;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

    /* Sizing */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 8px;
    --radius-lg: 12px;
}

/* ============================================================================
   Reset & Base
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-100);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================================
   Layout
   ============================================================================ */

.app-container {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-logo {
    height: 32px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 8px 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray-400);
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--gray-800);
    color: white;
    text-decoration: none;
}

.nav-item.active {
    background: var(--gray-800);
    color: white;
    border-left-color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Sidebar sub-items (support tickets) */
.nav-item.nav-item-sub {
    padding: 6px 24px 6px 36px;
    font-size: 13px;
    gap: 8px;
}

.status-dot-inline {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sidebar-ticket-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Recent Orders Sidebar */
.recent-order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 24px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    border-left: 3px solid transparent;
}
.recent-order-item:hover {
    background: var(--gray-800);
    color: white;
}
.recent-order-item .recent-order-nr {
    font-weight: 600;
    color: var(--gray-300);
    font-size: 12px;
    white-space: nowrap;
}
.recent-order-item .recent-order-naam {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}
.recent-orders-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 24px;
    color: var(--gray-500);
    font-size: 11px;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}
.recent-orders-toggle:hover {
    color: var(--gray-300);
}
.recent-orders-toggle.expanded i {
    transform: rotate(180deg);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-700);
}

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

.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    margin: -8px -12px;
    border-radius: var(--radius);
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.sidebar-user-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-user-avatar i {
    font-size: 18px;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: calc(100vw - var(--sidebar-width));
}

/* Header */
.header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

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

.header-search {
    position: relative;
}

.header-search input {
    width: 280px;
    padding: 8px 16px 8px 40px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header-search i.fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 1;
}

.header-search-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    color: var(--gray-400);
    font-family: inherit;
    pointer-events: none;
}
.header-search input:focus ~ .header-search-shortcut {
    display: none;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 420px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    display: none;
    max-height: 460px;
    overflow-y: auto;
}
.search-results-dropdown.active {
    display: block;
}

.search-results-category {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}
.search-result-item:hover,
.search-result-item.active {
    background: var(--gray-50);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.search-result-icon.type-event { background: #eef2ff; color: #4f46e5; }
.search-result-icon.type-member { background: #f0fdf4; color: #16a34a; }
.search-result-icon.type-order { background: #eff6ff; color: #2563eb; }
.search-result-icon.type-pinautomaat { background: #fefce8; color: #ca8a04; }
.search-result-icon.type-scanner { background: #fdf2f8; color: #db2777; }

.search-result-info {
    flex: 1;
    min-width: 0;
}
.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-600);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-results-empty,
.search-results-loading {
    padding: 30px 16px;
    text-align: center;
    color: var(--gray-400);
    font-size: 14px;
}
.search-results-empty i,
.search-results-loading i {
    position: static;
    transform: none;
    font-size: 20px;
    margin-bottom: 8px;
    display: block;
    color: var(--gray-300);
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.header-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Header User Dropdown */
.header-user-dropdown {
    position: relative;
}

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.header-user-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.header-user-chevron {
    font-size: 10px;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.header-user-dropdown.open .header-user-chevron {
    transform: rotate(180deg);
}

.header-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
}

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

.header-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.header-dropdown-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.header-dropdown-email {
    font-size: 13px;
    color: var(--gray-500);
}

.header-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 8px 0;
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-700);
    text-decoration: none;
    transition: background-color 0.15s;
}

.header-dropdown-item:hover {
    background: var(--gray-50);
}

.header-dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--gray-400);
}

.header-dropdown-item span:first-of-type {
    flex: 1;
}

.header-dropdown-badge {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.header-dropdown-item-danger {
    color: #ef4444;
}

.header-dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.05);
}

.header-dropdown-item-danger i {
    color: #ef4444;
}

/* Notifications Dropdown */
.header-notifications-dropdown {
    position: relative;
}

.notifications-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 100;
    overflow: hidden;
}

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

.notifications-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.notifications-dropdown-title {
    font-weight: 600;
    color: var(--gray-900);
}

.notifications-dropdown-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

.notifications-dropdown-link:hover {
    text-decoration: underline;
}

.notifications-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background-color 0.15s;
    text-decoration: none;
    color: inherit;
}

.notification-dropdown-item:last-child {
    border-bottom: none;
}

.notification-dropdown-item:hover {
    background: var(--gray-50);
}

.notification-dropdown-item.unread {
    background: rgba(229, 57, 53, 0.03);
}

.notification-dropdown-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notification-dropdown-icon.storing {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-dropdown-icon.aankondiging {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-dropdown-icon.update {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notification-dropdown-icon.nieuws {
    background: var(--gray-100);
    color: var(--gray-600);
}

.notification-dropdown-content {
    flex: 1;
    min-width: 0;
}

.notification-dropdown-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-dropdown-meta {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-dropdown-type {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
}

.notification-dropdown-type.storing {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-dropdown-type.aankondiging {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-dropdown-type.update {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notification-dropdown-type.nieuws {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Status badges in notification dropdown */
.notification-dropdown-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.notification-dropdown-status i {
    font-size: 9px;
}

.notification-dropdown-status.status-resolved {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notification-dropdown-status.status-ongoing {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-dropdown-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.notifications-dropdown-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--gray-400);
}

.notifications-dropdown-empty i {
    font-size: 32px;
    margin-bottom: 12px;
}

.notifications-dropdown-empty p {
    margin: 0;
    font-size: 14px;
}

.notifications-dropdown-footer {
    padding: 12px 16px;
    background: var(--gray-50);
    text-align: center;
    border-top: 1px solid var(--gray-100);
}

.notifications-dropdown-footer a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.notifications-dropdown-footer a:hover {
    text-decoration: underline;
}

.notifications-dropdown-footer a i {
    margin-left: 4px;
    font-size: 11px;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 32px;
    overflow-x: hidden;
    max-width: 100%;
}

/* Page loading state */
#app {
    min-height: 200px;
}

#app.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-loader {
    text-align: center;
    padding: 48px;
    color: var(--gray-500);
}

.page-loader i {
    font-size: 32px;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

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

/* ============================================================================
   Components
   ============================================================================ */

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body {
    padding: 24px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-card-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-card-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-card-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 14px;
    color: var(--gray-600);
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--gray-50);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.success {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.success::before {
    background: var(--success);
}

.status-badge.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.warning::before {
    background: var(--warning);
}

.status-badge.error {
    background: var(--error-light);
    color: var(--error);
}

.status-badge.error::before {
    background: var(--error);
}

.status-badge.info {
    background: var(--info-light);
    color: var(--info);
}

.status-badge.info::before {
    background: var(--info);
}

/* Stats Row (gedeeld component) */
.stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-width: 160px;
}

.stat-mini-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-mini-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-mini-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-mini-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-mini-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-mini-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-mini-icon.secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

.stat-mini-content {
    display: flex;
    flex-direction: column;
}

.stat-mini-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-mini-label {
    font-size: 13px;
    color: var(--gray-500);
    white-space: nowrap;
}

/* Clickable Table Rows */
tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

tr.clickable-row:hover {
    background-color: var(--gray-50);
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

/* Bootstrap dropdown aanpassingen */
.dropdown-toggle.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-800);
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}

.dropdown-toggle.btn-filter:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.dropdown-toggle.btn-filter:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.dropdown-toggle.form-select-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    text-align: left;
}

.dropdown-toggle.form-select-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.dropdown-item.active, .dropdown-item:active {
    background-color: var(--primary);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.alert i {
    font-size: 18px;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-danger {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid var(--error);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}

/* Form elements */
.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-label .required {
    color: var(--primary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: all 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* E-mail bounce check status */
.email-status {
    position: absolute;
    right: 12px;
    top: 38px;
    font-size: 14px;
    pointer-events: none;
}

.email-status-loading { color: var(--gray-400); }
.email-status-ok { color: var(--success); }
.email-status-error { color: var(--error); }

.email-bounce-warning,
.email-duplicate-warning {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Adres validatie status */
.address-status {
    position: absolute;
    right: 12px;
    top: 38px;
    font-size: 14px;
    pointer-events: none;
}

.address-status-ok { color: var(--success); }
.address-status-error { color: var(--error); }

.address-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
}

/* Telefoon validatie status */
.phone-status {
    position: absolute;
    right: 12px;
    top: 38px;
    font-size: 14px;
    pointer-events: none;
}

.phone-status-ok { color: var(--success); }
.phone-status-error { color: var(--error); }

.phone-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.notification {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.2s ease;
    box-shadow: var(--shadow);
}

.notification span {
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.15s;
    color: inherit;
    font-size: 14px;
}

.notification-close:hover {
    opacity: 1;
}

.notification-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.notification-error {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid var(--error);
}

.notification-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}

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

/* ============================================================================
   Modal (mg-modal - custom, geen Bootstrap conflict)
   ============================================================================ */

.mg-modal-backdrop,
.mg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mg-modal-backdrop.active,
.mg-modal-overlay.active {
    display: flex;
}

.mg-modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease;
}

.mg-modal-md {
    max-width: 560px;
}

.mg-modal-lg {
    max-width: 700px;
}

.mg-modal-xl {
    max-width: 900px;
}

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

.mg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.mg-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.mg-modal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mg-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.mg-modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.mg-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.mg-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    gap: 12px;
}

.mg-modal-footer-right {
    display: flex;
    gap: 12px;
}

/* Confirm Dialog */
.mg-modal-confirm {
    max-width: 420px;
    padding: 32px;
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.confirm-icon-danger {
    background: var(--error-light);
    color: var(--error);
}

.confirm-icon-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.confirm-icon-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.confirm-icon-success {
    background: #E8F5E9;
    color: #2E7D32;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 24px;
}

.mg-modal-confirm.mg-modal-wide {
    max-width: 520px;
    text-align: left;
}
.mg-modal-confirm.mg-modal-wide .confirm-icon { display: none; }
.mg-modal-confirm.mg-modal-wide .confirm-title { text-align: left; font-size: 18px; }

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 120px;
    padding: 10px 20px;
}

.btn-confirm-danger {
    background: var(--error);
    color: white;
    border: 1px solid var(--error);
}

.btn-confirm-danger:hover {
    background: #d32f2f;
    border-color: #d32f2f;
}

.btn-confirm-warning {
    background: var(--warning);
    color: white;
    border: 1px solid var(--warning);
}

.btn-confirm-warning:hover {
    background: #e68900;
    border-color: #e68900;
}

.btn-confirm-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.btn-confirm-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-confirm-success {
    background: #2E7D32;
    color: white;
    border: 1px solid #2E7D32;
}

.btn-confirm-success:hover {
    background: #1B5E20;
    border-color: #1B5E20;
}

/* Contact Info Note */
.contact-info-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--info-light);
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: var(--radius);
    color: var(--info);
    font-size: 13px;
    margin-top: 16px;
}

.contact-info-note i {
    font-size: 14px;
    flex-shrink: 0;
}

/* ============================================================================
   Auto-Save Indicator (Globaal)
   ============================================================================ */

/* Input wrapper voor correcte positionering */
/* Form group save indicator */
.form-group.has-save-indicator {
    position: relative;
}

.form-group.has-save-indicator .save-indicator {
    position: absolute;
    right: 12px;
    bottom: 10px;
}

/* Save indicator base */
.save-indicator {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.save-indicator.pending {
    opacity: 1;
    color: var(--gray-400);
}

.save-indicator.saving {
    opacity: 1;
    color: var(--primary);
}

.save-indicator.success {
    opacity: 1;
    color: var(--success);
}

.save-indicator.error {
    opacity: 1;
    color: var(--error);
}

/* Toggle group save indicator */
.toggle-group.has-save-indicator {
    position: relative;
}

.toggle-group.has-save-indicator .save-indicator {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
}

/* Dropdown save indicator */
.form-group.has-save-indicator .dropdown,
.dropdown.has-save-indicator {
    position: relative;
}

.form-group.has-save-indicator .dropdown .save-indicator,
.dropdown.has-save-indicator .save-indicator {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
}

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

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Overlay achter sidebar als die open is */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
    }

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

    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }

    .page-content {
        padding: 16px;
    }

    .header {
        padding: 0 16px;
    }

    .header-title {
        font-size: 16px;
    }

    /* Hamburger menu knop */
    .header-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: none;
        color: var(--gray-700);
        font-size: 20px;
        cursor: pointer;
        margin-right: 8px;
        border-radius: var(--radius);
        flex-shrink: 0;
    }

    .header-hamburger:hover {
        background: var(--gray-100);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .header-search {
        display: none;
    }

    .header-user-btn {
        padding: 6px 8px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-row {
        flex-direction: column;
    }

    .stat-mini {
        min-width: 0;
    }

    /* Modals fullscreen op mobiel */
    .mg-modal-backdrop,
    .mg-modal-overlay {
        padding: 10px;
    }

    .mg-modal {
        max-height: calc(100vh - 20px);
    }

    .mg-modal-lg,
    .mg-modal-xl {
        max-width: 100%;
    }

    .mg-modal-header {
        padding: 12px 16px;
    }

    .mg-modal-body {
        padding: 16px;
    }

    .mg-modal-footer {
        padding: 12px 16px;
    }
}

/* =========================================================================
   Order Detail Modal (Globaal)
   ========================================================================= */

.order-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.order-modal-amount {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
}

.order-modal-refresh {
    font-size: 14px;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.order-modal-refresh:hover {
    color: var(--gray-700);
}

.order-modal-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.order-info-section .info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--gray-700);
}

.order-info-section .info-row i {
    width: 16px;
    color: var(--gray-400);
}

.klant-badges {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    margin-top: 4px;
}

.order-event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 14px;
}

.order-event-row + .order-event-row {
    margin-top: 6px;
}

.order-event-row .order-event-qty {
    min-width: 40px;
    color: var(--gray-500);
    font-size: 13px;
    flex-shrink: 0;
}

.order-event-row .order-event-name {
    flex: 1;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-event-member {
    font-size: 12px;
    font-weight: 400;
    color: var(--gray-400);
}

.order-event-member-link {
    color: var(--gray-400);
    text-decoration: none;
}

.order-event-member-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.order-event-row .order-event-total {
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.order-event-row.retour {
    background: #FFF3E0;
    border: 1px solid #FFB74D;
}

.order-event-row.retour .order-event-qty {
    color: #E65100;
}

.order-event-row.retour .order-event-total {
    color: #E65100;
}

.order-event-row.order-event-admin {
    background: var(--gray-50);
}

.order-event-admin-label {
    color: var(--gray-500);
    font-size: 13px;
}

.order-event-link {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.order-event-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.order-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-single {
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
}

.price-total {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
}

.order-timestamps {
    display: flex;
    gap: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.timestamp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
}

.timestamp-item i {
    color: var(--gray-400);
}

.timestamp-item strong {
    color: var(--gray-800);
}

.order-counters {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-top: -16px;
    margin-bottom: 24px;
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-600);
}

.counter-item i {
    color: var(--gray-400);
}

.counter-item strong {
    color: var(--gray-800);
}

.btn-mollie-info {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 14px;
    padding: 0 4px;
    transition: color 0.15s;
}

.btn-mollie-info:hover {
    color: var(--primary-hover);
}

.mollie-details-panel {
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 24px;
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
}

.mollie-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mollie-detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-700);
}

.mollie-detail-row i {
    width: 16px;
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
}

.mollie-detail-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

/* Tickets */
.order-tickets-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-select-all-tickets {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-select-all-tickets:hover {
    color: var(--primary);
    background: var(--gray-50);
}

.order-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.ticket-barcode {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.ticket-barcode i {
    color: var(--gray-400);
}

.ticket-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ticket-status.scanned {
    background: var(--success);
}

.ticket-status.not-scanned {
    background: var(--gray-300);
}

.ticket-scan-info {
    flex: 1;
    font-size: 13px;
    color: var(--gray-600);
}

.ticket-scan-info .scan-user {
    color: var(--gray-500);
    font-style: italic;
}

.ticket-not-scanned {
    font-size: 13px;
    color: var(--gray-400);
    font-style: italic;
}

.ticket-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.ticket-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.ticket-type {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: 10px;
    flex-shrink: 0;
}

.ticket-row.refunded {
    background: #F4433610;
    border-color: #F4433626;
}

.ticket-refund-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    background: #F443361A;
    color: var(--error);
    border-radius: 10px;
    flex-shrink: 0;
}

.ticket-refund-info {
    flex: 1;
    font-size: 12px;
    color: var(--gray-500);
    font-style: italic;
    text-align: right;
}

.ticket-free-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    background: var(--info-light);
    color: var(--info);
    border-radius: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

.refund-badge-header {
    background: var(--error-light) !important;
    color: var(--error) !important;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.support-badge-header {
    background: var(--info-light) !important;
    color: var(--info) !important;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Mails */
.order-mails-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.order-mails-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.order-mails-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mail-item {
    display: flex;
    flex-direction: column;
}

.mail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 13px;
}

.mail-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    background: var(--info-light);
    color: var(--info);
}

.mail-content {
    flex: 1;
}

.mail-text {
    color: var(--gray-700);
}

.mail-date {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.mail-info-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--gray-200);
    border-radius: 50%;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 12px;
}

.mail-info-btn:hover {
    background: var(--info);
    color: white;
}

.mail-info-btn.active {
    background: var(--info);
    color: white;
}

.mail-detail-panel {
    display: none;
    margin-top: 8px;
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 12px;
}

.mail-detail-panel.active {
    display: block;
}

.mail-detail-grid {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 6px 12px;
}

.mail-detail-label {
    color: var(--gray-500);
}

.mail-detail-value {
    color: var(--gray-800);
}

.mail-detail-value.code {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    word-break: break-all;
    color: var(--gray-600);
}

.mail-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 10px;
}

.mail-status-badge.delivered {
    background: var(--success-light);
    color: var(--success);
}

.mail-status-badge.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.mail-status-badge.failed {
    background: var(--error-light);
    color: var(--error);
}

/* History */
.order-history-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.order-history-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.order-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 13px;
}

.history-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.history-icon.mail {
    background: var(--info-light);
    color: var(--info);
}

.history-icon.edit {
    background: var(--warning-light);
    color: var(--warning);
}

.history-icon.admin {
    background: var(--primary-light);
    color: var(--primary);
}

.history-icon.refund {
    background: #F443361A;
    color: var(--error);
}

.history-content {
    flex: 1;
}

.history-text {
    color: var(--gray-700);
}

.history-text strong {
    font-weight: 600;
}

.history-date {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.history-icon.system {
    background: var(--gray-100);
    color: var(--gray-600);
}

.history-icon.payment {
    background: #4CAF501A;
    color: #4CAF50;
}

.history-icon.cancel {
    background: #F443361A;
    color: var(--error);
}

.history-row {
    cursor: default;
}

.history-row.has-detail {
    cursor: pointer;
    transition: background 0.15s;
}

.history-row.has-detail:hover {
    background: var(--gray-100);
}

.history-detail-toggle {
    color: var(--gray-400);
    font-size: 11px;
    margin-left: 6px;
    transition: transform 0.2s;
    display: inline-block;
}

.history-row.detail-open .history-detail-toggle {
    transform: rotate(90deg);
}

.history-detail-panel {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 12px;
}

.history-row.detail-open .history-detail-panel {
    display: block;
}

.history-detail-item {
    display: flex;
    gap: 8px;
    padding: 3px 0;
    color: var(--gray-600);
}

.history-detail-item .detail-label {
    font-weight: 600;
    color: var(--gray-700);
    min-width: 80px;
}

.history-detail-item .detail-value {
    color: var(--gray-600);
    word-break: break-all;
}

/* Refund Section */
.order-refund-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 3px solid var(--error);
}

.order-refund-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--error);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refund-summary {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
}

.refund-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.refund-label {
    color: var(--gray-600);
}

.refund-value {
    font-weight: 600;
    color: var(--gray-800);
}

.refund-value.muted {
    color: var(--gray-500);
    font-weight: 400;
}

.refund-row-option {
    padding: 8px 0;
}

.refund-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-600);
}

.refund-checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--error);
}

.refund-extra-input {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
    width: 120px;
}

.refund-euro-prefix {
    padding: 4px 8px;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
    border-right: 1px solid var(--gray-300);
}

.refund-extra-input input {
    border: none;
    outline: none;
    padding: 4px 8px;
    font-size: 13px;
    width: 100%;
    text-align: right;
    font-weight: 500;
    color: var(--gray-800);
}

.refund-divider {
    height: 1px;
    background: var(--gray-300);
    margin: 8px 0;
}

.refund-row-total {
    padding: 8px 0;
}

.refund-row-total .refund-label {
    font-weight: 600;
    color: var(--gray-800);
}

.refund-row-total .refund-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--error);
}

.btn.btn-refund {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background-color: var(--error);
    border: 1px solid var(--error);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.btn.btn-refund:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.btn.btn-refund:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Cancelled ticket badge */
.ticket-cancelled-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    background: var(--gray-100);
    color: var(--gray-500);
    border-radius: 10px;
    font-weight: 500;
    flex-shrink: 0;
}

.ticket-row.cancelled {
    opacity: 0.5;
}

.ticket-row.cancelled .ticket-barcode {
    text-decoration: line-through;
}

/* Cancel Free Tickets Section */
.order-cancel-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 3px solid var(--warning);
}

.order-cancel-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cancel-summary {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
}

.cancel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.cancel-label {
    color: var(--gray-600);
}

.cancel-value {
    font-weight: 600;
    color: var(--gray-800);
}

.cancel-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    margin-top: 8px;
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: var(--radius);
    font-size: 12px;
    color: #795548;
    line-height: 1.4;
}

.cancel-info i {
    color: var(--warning);
    margin-top: 1px;
    flex-shrink: 0;
}

.btn.btn-cancel-tickets {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background-color: var(--warning);
    border: 1px solid var(--warning);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.btn.btn-cancel-tickets:hover {
    background: #e67e22;
    border-color: #e67e22;
}

.btn.btn-cancel-tickets:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Support Tickets in Order Modal */
.order-support-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 3px solid var(--info);
}

.order-support-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--info);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-support-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.support-ticket-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    border-left: 3px solid var(--info);
}

.support-ticket-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.support-ticket-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--info);
}

.support-ticket-onderwerp {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
}

.support-ticket-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.support-ticket-prioriteit {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: capitalize;
}

.support-ticket-prioriteit.urgent {
    background: var(--error-light);
    color: var(--error);
}

.support-ticket-prioriteit.normaal {
    background: var(--gray-200);
    color: var(--gray-600);
}

.support-ticket-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-600);
}

.support-ticket-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.support-ticket-status .status-dot.open {
    background: var(--success);
}

.support-ticket-status .status-dot.wacht_op_klant {
    background: var(--info);
}

.support-ticket-status .status-dot.gesloten {
    background: var(--gray-400);
}

.support-ticket-datum {
    font-size: 12px;
    color: var(--gray-500);
}

.support-ticket-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--info);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.support-ticket-link:hover {
    text-decoration: underline;
}

.support-empty {
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.btn-new-support {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 14px;
    background: none;
    border: 1px dashed var(--info);
    border-radius: var(--radius);
    color: var(--info);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-new-support:hover {
    background: var(--info-light);
}

/* Memo's */
.order-memos-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.order-memos-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-memos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.memo-item {
    padding: 12px 14px;
    background: #FFF9E6;
    border: 1px solid #F0E4B8;
    border-radius: var(--radius);
    border-left: 3px solid #E6C94E;
}

.memo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.memo-auteur {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.memo-auteur i {
    color: var(--gray-400);
}

.memo-datum {
    font-size: 11px;
    color: var(--gray-500);
}

.memo-text {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
}

.memo-empty {
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.memo-input-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: flex-start;
}

.memo-textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 40px;
    color: var(--gray-800);
    transition: border-color 0.15s;
}

.memo-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.memo-textarea::placeholder {
    color: var(--gray-400);
}

.btn-add-memo {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
    border-color: #27ae60;
}

/* =========================================================================
   Inline Edit (info-row-editable) - Globaal voor order modal
   ========================================================================= */

.info-row-editable {
    cursor: pointer;
    border-radius: 6px;
    padding: 8px !important;
    margin: 0 -8px;
    transition: background 0.15s;
    position: relative;
}

.info-row-editable:hover {
    background: var(--gray-50);
}

.info-row-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.info-row-edit-icon {
    font-size: 11px !important;
    color: var(--gray-300) !important;
    opacity: 0;
    transition: opacity 0.15s;
    width: auto !important;
    flex-shrink: 0;
}

.info-row-editable:hover .info-row-edit-icon {
    opacity: 1;
}

.info-row-editable.editing {
    background: var(--gray-50);
    cursor: default;
    overflow: visible;
}

.info-row-editable.editing .info-row-value {
    overflow: visible;
    white-space: normal;
}

.info-row-editable.editing .info-row-edit-icon {
    display: none;
}

.info-row-edit-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    position: relative;
}

.info-row-edit-input {
    flex: 1;
    min-width: 0;
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    outline: none;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    transition: border-color 0.15s;
}

.info-row-edit-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.info-row-edit-input.invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.info-row-edit-input:disabled {
    background: var(--gray-50);
    color: var(--gray-500);
}

select.info-row-edit-select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

.info-row-edit-save,
.info-row-edit-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: background 0.15s, opacity 0.15s;
}

.info-row-edit-save {
    background: var(--success);
    color: #fff;
}

.info-row-edit-save:hover {
    background: #059669;
}

.info-row-edit-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.info-row-edit-cancel {
    background: var(--gray-200);
    color: var(--gray-600);
}

.info-row-edit-cancel:hover {
    background: var(--gray-300);
}

.info-row-edit-error {
    display: none;
    font-size: 11px;
    color: var(--error);
    padding: 2px 0 0 28px;
    line-height: 1.3;
}

/* Plaats autocomplete suggesties */
.plaats-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
}

.plaats-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-800);
    transition: background 0.15s;
}

.plaats-suggestion-item:hover {
    background: var(--gray-100);
}

.plaats-suggestion-land {
    color: var(--gray-500);
    font-size: 12px;
}

/* =========================================================================
   Mail Status (globaal herbruikbaar — modal + history)
   ========================================================================= */

.mail-status-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 16px;
    margin-bottom: 20px;
}

.mail-status-label {
    font-weight: 600;
    color: var(--text-muted, #64748b);
    font-size: 13px;
}

.mail-status-value {
    font-size: 13px;
    word-break: break-all;
}

.mail-status-uuid {
    font-family: monospace;
    font-size: 12px;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.mail-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.mail-status-delivered {
    background: #dcfce7;
    color: #166534;
}

.mail-status-queued {
    background: #fef9c3;
    color: #854d0e;
}

.mail-status-sent {
    background: #dbeafe;
    color: #1e40af;
}

.mail-status-bounced,
.mail-status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.mail-status-timeline {
    margin-top: 16px;
}

.mail-status-timeline h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-color, #334155);
}

.mail-timeline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-left: 2px solid #e2e8f0;
    margin-left: 8px;
    padding-left: 16px;
    position: relative;
}

.mail-timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color, #3b82f6);
    border: 2px solid #fff;
}

.mail-timeline-item:last-child {
    border-left-color: transparent;
}

.mail-timeline-time {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    min-width: 120px;
    font-variant-numeric: tabular-nums;
}

.mail-timeline-content {
    font-size: 13px;
}

.mail-timeline-smtp {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
    word-break: break-all;
}

/* =========================================================================
   Mail History Component (herbruikbaar per entiteit)
   ========================================================================= */

.mail-history-panel {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.mail-history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color, #334155);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.mail-history-title i {
    color: #7c3aed;
}

.mail-history-list {
    display: flex;
    flex-direction: column;
}

.mail-history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    transition: background 0.1s;
}

.mail-history-item:last-child {
    border-bottom: none;
}

.mail-history-item:hover {
    background: #f8fafc;
}

.mail-history-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f3e8ff;
    color: #7c3aed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.mail-history-content {
    flex: 1;
    min-width: 0;
}

.mail-history-subject {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color, #334155);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mail-history-meta {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.mail-history-meta span {
    white-space: nowrap;
}

.mail-history-actions {
    flex-shrink: 0;
    margin-top: 2px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-500);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s;
    padding: 0;
}
.btn-icon:hover {
    background: var(--gray-50);
    color: var(--primary);
    border-color: var(--primary);
}
.btn-icon.tt-delete-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: #fef2f2;
}

.mail-history-actions .btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--card-bg, #fff);
    color: #7c3aed;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s;
}

.mail-history-actions .btn-icon:hover {
    background: #f3e8ff;
    border-color: #7c3aed;
}

.mail-history-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted, #64748b);
    font-size: 14px;
}

.mail-history-empty i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
    opacity: 0.4;
}

/* Hamburger standaard verborgen op desktop */
@media (min-width: 769px) {
    .header-hamburger {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* ============================================================================
   MGTEditor — Afbeelding spacing
   ============================================================================ */
.mgt-editor-content .mgt-image-resizer {
    margin: 4px 8px 8px 0;
}

/* ============================================================================
   PDF Viewer (pdfviewer.js)
   ============================================================================ */
.pdfviewer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary, #f5f5f5);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    position: sticky;
    top: 0;
    z-index: 10;
}

.pdfviewer-toolbar-left,
.pdfviewer-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdfviewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color, #d0d0d0);
    border-radius: 6px;
    background: #fff;
    color: var(--text-secondary, #555);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.pdfviewer-btn:hover {
    background: var(--primary-color, #4f46e5);
    color: #fff;
    border-color: var(--primary-color, #4f46e5);
}

.pdfviewer-zoom-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #555);
    min-width: 40px;
    text-align: center;
}

.pdfviewer-pages {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: #e8e8e8;
    min-height: 200px;
}

.pdfviewer-page {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pdfviewer-page canvas {
    display: block;
}

.pdfviewer-loader {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 40px 0;
    color: var(--text-muted, #888);
    font-size: 14px;
}

.pdfviewer-loader i {
    font-size: 18px;
}

.pdfviewer-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 40px 0;
    color: var(--danger-color, #dc3545);
    font-size: 14px;
}

.pdfviewer-error i {
    font-size: 18px;
}

/* ============================================================================
   Batch Detail Modal (global)
   ============================================================================ */

.batch-modal-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.batch-modal-title .mg-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-modal-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--success-light, #e8f5e9);
    color: var(--success);
}

.batch-modal-status.pending {
    background: var(--warning-light, #fff3e0);
    color: var(--warning);
}

.batch-modal-status.processing {
    background: #e3f2fd;
    color: #1565C0;
}

.batch-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.batch-info-card {
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-align: center;
}

.batch-info-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.batch-info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.batch-info-value.highlight {
    font-size: 20px;
    color: var(--success);
}

.batch-detail-table {
    margin-bottom: 24px;
}

.batch-detail-table table {
    width: 100%;
}

.batch-detail-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

.batch-events-section {
    margin-bottom: 24px;
}

.batch-events-section h4,
.batch-timeline-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.batch-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.batch-event-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-event-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.batch-event-details {
    display: flex;
    flex-direction: column;
}

.batch-event-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    text-decoration: none;
}

.batch-event-name:hover {
    color: var(--primary);
}

.batch-event-date {
    font-size: 12px;
    color: var(--gray-500);
}

.batch-event-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.batch-event-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
}

.batch-event-stat i {
    color: var(--gray-400);
}

.batch-event-stat.amount {
    font-weight: 600;
    color: var(--success);
}

.batch-timeline {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 24px;
}

.batch-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 0;
    position: relative;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gray-300);
    position: absolute;
    left: -24px;
    top: 14px;
    z-index: 1;
}

.timeline-item.completed .timeline-dot {
    background: var(--success);
}

.timeline-item.current .timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 103, 202, 0.2);
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.timeline-date {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ============================================================
   Tabs (globaal gedeeld component)
   ============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}

.tab:hover {
    color: var(--gray-800);
}

.tab.active {
    color: var(--primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tab-badge {
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: 10px;
}

.tab.active .tab-badge {
    background: var(--primary-light);
    color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   Badges (globaal gedeeld component)
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-success   { background: #DCFCE7; color: #15803D; }
.badge-warning   { background: #FFF3E0; color: #E65100; }
.badge-danger    { background: #FEE2E2; color: #DC2626; }
.badge-info      { background: #E3F2FD; color: #1565C0; }
.badge-secondary { background: #F1F5F9; color: #475569; }
.badge-primary   { background: #E3F2FD; color: #1976D2; }

/* ============================================================
   Knop-varianten (globaal gedeeld)
   ============================================================ */
.btn-danger {
    background: #DC2626;
    color: white;
    border: 1px solid #DC2626;
}
.btn-danger:hover {
    background: #B91C1C;
    border-color: #B91C1C;
}

.btn-warning {
    background: #F59E0B;
    color: white;
    border: 1px solid #F59E0B;
}
.btn-warning:hover {
    background: #D97706;
    border-color: #D97706;
}

.btn-info {
    background: #0EA5E9;
    color: white;
    border: 1px solid #0EA5E9;
}
.btn-info:hover {
    background: #0284C7;
    border-color: #0284C7;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    color: #DC2626;
    border: 1px solid #DC2626;
}
.btn-outline-danger:hover {
    background: #DC2626;
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* ============================================================
   Filter-tabs (gebruikt in pinautomaten / overzicht-pagina's)
   ============================================================ */
.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-tab:hover {
    color: var(--gray-800);
    background: rgba(255, 255, 255, 0.6);
}
.filter-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.filter-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-600);
    background: var(--gray-200);
    border-radius: 999px;
}
.filter-tab.active .filter-tab-count {
    background: var(--primary-light, #E3F2FD);
    color: var(--primary);
}
