/**
 * DAM Marine - Styles principaux
 * Charte graphique DAM Marine
 * Couleurs: #051D60, #C31B1B, #F1F1F1, #767676, #1C3A72
 * Typographie: Open Sans
 */

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

/* ===== VARIABLES CSS ===== */
:root {
    /* Couleurs principales DAM Marine */
    --dam-blue-dark: #051D60;
    --dam-blue-light: #1C3A72;
    --dam-red: #C31B1B;
    --dam-gray-light: #F1F1F1;
    --dam-gray: #767676;

    /* Couleurs dérivées */
    --dam-blue-hover: #0a2d8a;
    --dam-red-hover: #a01515;
    --dam-blue-transparent: rgba(5, 29, 96, 0.1);
    --dam-red-transparent: rgba(195, 27, 27, 0.1);

    /* Couleurs de statut */
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #3498db;

    /* Neutres */
    --white: #ffffff;
    --black: #1a1a1a;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #767676;

    /* Ancien mapping pour compatibilité */
    --primary-color: var(--dam-blue-dark);
    --primary-dark: var(--dam-blue-hover);
    --success-color: var(--color-success);
    --warning-color: var(--color-warning);
    --danger-color: var(--dam-red);
    --info-color: var(--color-info);
    --dark-color: var(--dam-blue-dark);
    --light-gray: var(--dam-gray-light);
    --medium-gray: var(--dam-gray);
    --background: var(--bg-light);

    /* Espacements */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Bordures */
    --border-radius: 8px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Ombres */
    --box-shadow: 0 2px 8px rgba(5, 29, 96, 0.08);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    /* Transitions */
    --transition: all 0.25s ease;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dam-blue-dark);
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a {
    color: var(--dam-blue-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--dam-blue-dark);
}

/* ===== LAYOUT ===== */
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
.main-header {
    background: linear-gradient(135deg, var(--dam-blue-dark) 0%, var(--dam-blue-light) 100%);
    color: var(--white);
    padding: 20px 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 42px;
    width: auto;
}

.header-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    margin: 0;
}

.header-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    margin: 2px 0 0 0;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ===== BUTTONS ===== */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.12);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-action:hover {
    background: rgba(255,255,255,0.22);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-sync {
    background: var(--dam-red) !important;
    border-color: var(--dam-red) !important;
}

.btn-sync:hover {
    background: var(--dam-red-hover) !important;
}

.btn-sync-events {
    background: var(--color-success) !important;
    border-color: var(--color-success) !important;
}

.btn-sync-events:hover {
    background: #219a52 !important;
}

.btn-sync-laposte {
    background: linear-gradient(135deg, #f9c74f, #f3722c) !important;
    border-color: #f3722c !important;
    color: #000 !important;
}

.btn-sync-laposte:hover {
    background: linear-gradient(135deg, #f3722c, #f94144) !important;
    color: #fff !important;
}

.btn-resume-sync {
    background: var(--color-warning) !important;
    border-color: var(--color-warning) !important;
    animation: pulse-btn 2s infinite;
}

.btn-resume-sync:hover {
    background: #d68910 !important;
}

@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(243, 156, 18, 0); }
}

.btn-claims {
    background: var(--dam-red-transparent) !important;
    border-color: rgba(195, 27, 27, 0.3) !important;
}

.btn-claims:hover {
    background: rgba(195, 27, 27, 0.25) !important;
}

.btn-analytics {
    background: rgba(52, 152, 219, 0.15) !important;
}

.btn-admin {
    background: rgba(255,255,255,0.08) !important;
}

.btn-emails {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
    position: relative;
}

.btn-emails:hover {
    background: rgba(102, 126, 234, 0.35) !important;
}

/* Notification badge in header */
.notification-badge-header {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ff5722;
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    animation: notification-pulse 2s infinite;
}

@keyframes notification-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Standard buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--dam-blue-dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--dam-blue-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--dam-gray-light);
    color: var(--dam-blue-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--white);
    border-color: var(--dam-blue-dark);
}

/* ===== STAT CARDS ===== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--dam-blue-transparent);
    flex-shrink: 0;
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dam-blue-dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Variantes de couleurs */
.stat-card-total .stat-icon { background: var(--dam-blue-transparent); }
.stat-card-total .stat-value { color: var(--dam-blue-dark); }

.stat-card-delivered .stat-icon { background: rgba(39, 174, 96, 0.12); }
.stat-card-delivered .stat-value { color: var(--color-success); }

.stat-card-transit .stat-icon { background: rgba(52, 152, 219, 0.12); }
.stat-card-transit .stat-value { color: var(--color-info); }

.stat-card-late .stat-icon { background: var(--dam-red-transparent); }
.stat-card-late .stat-value { color: var(--dam-red); }

.stat-card-pending .stat-icon { background: rgba(243, 156, 18, 0.12); }
.stat-card-pending .stat-value { color: var(--color-warning); }

/* ===== CARDS ===== */
.card, .orders-card, .filters-card, .table-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 25px;
}

.card-header, .orders-header, .table-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2, .orders-header h2, .table-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dam-blue-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* ===== FILTERS ===== */
/* ===== FILTERS SECTION ===== */
.filters-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    overflow: hidden;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 24px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.filters-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dam-blue-dark);
}

.btn-toggle-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--dam-gray);
    cursor: pointer;
    transition: var(--transition);
}

.btn-toggle-filters:hover {
    background: var(--dam-gray-light);
    border-color: var(--dam-blue-dark);
    color: var(--dam-blue-dark);
}

.toggle-arrow {
    transition: transform var(--transition-fast);
}

.filters-content {
    padding: 20px 24px;
}

.filters-content.collapsed {
    display: none;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filters-card {
    padding: 20px 24px;
}

.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--dam-blue-dark);
    box-shadow: 0 0 0 3px var(--dam-blue-transparent);
}

/* Checkbox styles */
.filter-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    accent-color: var(--dam-blue-dark);
}

/* Filter buttons row */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.filter-buttons .btn,
.filter-buttons button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    border: none;
}

.filter-buttons .btn-primary,
.filter-buttons button[type="submit"] {
    background: var(--dam-blue-dark);
    color: var(--white);
}

.filter-buttons .btn-primary:hover,
.filter-buttons button[type="submit"]:hover {
    background: var(--dam-blue-hover);
}

.filter-buttons .btn-secondary,
.filter-buttons button[type="button"] {
    background: var(--dam-gray-light);
    color: var(--dam-blue-dark);
    border: 1px solid var(--border-color);
}

.filter-buttons .btn-secondary:hover,
.filter-buttons button[type="button"]:hover {
    background: var(--white);
    border-color: var(--dam-blue-dark);
}

/* Quick filter links */
.filter-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.filter-quick-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--dam-gray-light);
    color: var(--dam-blue-dark);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.filter-quick-links a:hover {
    background: var(--dam-blue-dark);
    color: var(--white);
}

/* Filter actions */
.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Quick filters bar */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.quick-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--white);
    color: var(--dam-blue-dark);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.quick-filter-btn:hover {
    background: var(--dam-blue-dark);
    color: var(--white);
    border-color: var(--dam-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-filter-btn.active {
    background: var(--dam-blue-dark);
    color: var(--white);
    border-color: var(--dam-blue-dark);
    box-shadow: 0 4px 12px rgba(5, 29, 96, 0.3);
}

.quick-filter-alert {
    background: #fff5f5;
    color: var(--dam-red);
    border-color: var(--dam-red);
}

.quick-filter-alert:hover {
    background: var(--dam-red);
    color: var(--white);
    border-color: var(--dam-red);
    box-shadow: 0 4px 12px rgba(195, 27, 27, 0.3);
}

.quick-filter-alert.active {
    background: var(--dam-red);
    color: var(--white);
    border-color: var(--dam-red);
    box-shadow: 0 4px 12px rgba(195, 27, 27, 0.3);
}

/* ===== TABLE SECTION - EXPEDITIONS ===== */
.table-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dam-blue-dark);
}

.table-info {
    font-size: 0.9rem;
    color: var(--dam-gray);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

/* Expeditions Table */
.expeditions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 1200px;
}

.expeditions-table th {
    background: var(--dam-blue-dark);
    color: var(--white);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 12px 10px;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.expeditions-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.expeditions-table tbody tr {
    transition: background var(--transition-fast);
}

.expeditions-table tbody tr:hover {
    background: var(--dam-blue-transparent);
}

.expeditions-table tbody tr.row-late {
    background: rgba(195, 27, 27, 0.05);
}

.expeditions-table tbody tr.row-late:hover {
    background: rgba(195, 27, 27, 0.1);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending,
.status-en_attente {
    background: #fef3cd;
    color: #856404;
}

.status-in_transit {
    background: #cce5ff;
    color: #004085;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-delayed {
    background: #f8d7da;
    color: #721c24;
}

.badge-late {
    display: inline-block;
    padding: 2px 6px;
    background: var(--dam-red);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 5px;
}

/* BL Reference link */
.link-bl {
    color: var(--dam-blue-dark);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.link-bl:hover {
    color: var(--dam-blue-light);
    text-decoration: underline;
}

/* Carrier / Service code */
.carrier-code {
    font-weight: 600;
    color: var(--dam-blue-dark);
}

.service-code {
    color: var(--dam-gray);
    font-size: 0.8rem;
}

/* City name */
.city-name {
    color: var(--dam-gray);
    font-size: 0.8rem;
}

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--dam-gray); }

/* Package info */
.package-info {
    font-weight: 500;
    color: var(--text-primary);
}

/* Event preview and tooltip */
.last-event {
    position: relative;
}

.event-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.event-preview:hover {
    background: var(--dam-blue-transparent);
}

.event-preview .event-icon {
    display: inline;
}

.event-preview .event-date {
    display: inline;
}

.event-icon {
    font-size: 1rem;
}

.event-date {
    font-size: 0.8rem;
    color: var(--dam-gray);
}

.event-label-short {
    display: block;
    font-size: 0.75rem;
    color: var(--text-primary);
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-tooltip {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 280px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease;
}

.event-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-content {
    font-size: 0.85rem;
}

.tooltip-event-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.tooltip-event-item:last-child {
    border-bottom: none;
}

.tooltip-event-date {
    font-weight: 600;
    color: var(--dam-blue-dark);
    font-size: 0.8rem;
    margin-bottom: 3px;
}

.tooltip-event-label {
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.tooltip-event-location {
    color: var(--dam-gray);
    font-size: 0.75rem;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-track {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--dam-red);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-track:hover {
    background: var(--dam-red-hover);
    color: white;
    transform: translateY(-1px);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.btn-icon-external {
    background: var(--dam-gray-light);
}

.btn-icon-external:hover {
    background: var(--dam-blue-transparent);
}

.btn-icon-document {
    background: var(--dam-blue-transparent);
}

.btn-icon-document:hover {
    background: var(--dam-blue-dark);
    color: white;
}

/* No data state */
.no-data {
    padding: 40px !important;
    text-align: center;
}

.no-data-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.no-data-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.no-data-text {
    color: var(--dam-gray);
    font-size: 1rem;
}

/* Separators */
.date-separator td,
.carrier-separator td {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.separator-content {
    padding: 12px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-sep {
    background: linear-gradient(135deg, var(--dam-blue-dark) 0%, var(--dam-blue-light) 100%);
    color: white;
    margin-top: 5px;
}

.carrier-sep {
    background: var(--dam-gray-light);
    color: var(--dam-blue-dark);
    font-size: 0.85rem;
    padding: 8px 20px 8px 35px;
    border-left: 4px solid var(--dam-blue-light);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: var(--dam-gray);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-page {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--white);
    color: var(--dam-blue-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.btn-page:hover {
    background: var(--dam-blue-dark);
    color: var(--white);
    border-color: var(--dam-blue-dark);
}

.page-current {
    padding: 8px 14px;
    color: var(--dam-gray);
    font-size: 0.9rem;
}

.page-current strong {
    color: var(--dam-blue-dark);
}

/* ===== FOOTER ===== */
.dashboard-footer {
    text-align: center;
    padding: 20px;
    color: var(--dam-gray);
    font-size: 0.85rem;
}

.footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.footer-links a {
    color: var(--dam-blue-light);
}

.footer-links a:hover {
    color: var(--dam-blue-dark);
}

/* ===== ORDER DETAIL MODAL ===== */
.order-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.order-detail-modal.visible {
    opacity: 1;
    visibility: visible;
}

.order-detail-modal-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.order-detail-modal.visible .order-detail-modal-container {
    transform: translateY(0);
}

.order-detail-modal-header {
    background: linear-gradient(135deg, var(--dam-blue-dark) 0%, var(--dam-blue-light) 100%);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-detail-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--white);
}

.order-detail-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.order-detail-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.order-detail-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.order-detail-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--dam-gray);
}

.order-detail-modal-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dam-gray-light);
    border-top-color: var(--dam-blue-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

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

/* Modal content styles */
.order-modal-content {
    padding: 0;
}

.order-modal-header {
    background: var(--bg-light);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.order-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.order-modal-title h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--dam-blue-dark);
}

.order-modal-meta {
    display: flex;
    gap: 20px;
    color: var(--dam-gray);
    font-size: 0.9rem;
}

.badge-late-modal {
    background: var(--dam-red);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.order-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

@media (max-width: 600px) {
    .order-modal-grid {
        grid-template-columns: 1fr;
    }
}

.order-modal-card {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.order-modal-card:nth-child(odd) {
    border-right: 1px solid var(--border-color);
}

@media (max-width: 600px) {
    .order-modal-card:nth-child(odd) {
        border-right: none;
    }
}

.order-modal-card h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--dam-blue-dark);
}

.order-modal-card-content {
    font-size: 0.9rem;
}

.order-modal-card-content p {
    margin: 4px 0;
}

.order-modal-card-content .company-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--dam-blue-dark);
}

.order-modal-card-content .address {
    color: var(--dam-gray);
}

.order-modal-card-content .city {
    margin-top: 8px;
}

.order-modal-card-content .phone,
.order-modal-card-content .email {
    margin-top: 10px;
    color: var(--dam-blue-light);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: var(--dam-gray);
}

.info-row .value {
    font-weight: 500;
    color: var(--text-primary);
}

.info-row.delivered {
    background: rgba(39, 174, 96, 0.1);
    margin: 6px -10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border-bottom: none;
}

.info-row.delivered .value {
    color: var(--color-success);
    font-weight: 600;
}

.order-modal-annotation {
    padding: 15px 20px;
    background: #fffde7;
    border-bottom: 1px solid var(--border-color);
}

.order-modal-annotation h3 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: var(--dam-blue-dark);
}

.order-modal-annotation p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.badge-no-claim {
    display: inline-block;
    margin-top: 10px;
    background: var(--dam-red);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.order-modal-timeline {
    padding: 20px;
    background: var(--bg-light);
}

.order-modal-timeline h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--dam-blue-dark);
}

.order-modal-timeline .no-events {
    color: var(--dam-gray);
    font-style: italic;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 15px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: -30px;
    top: 0;
    width: 22px;
    height: 22px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.timeline-item.latest .timeline-icon {
    border-color: var(--dam-blue-dark);
    background: var(--dam-blue-dark);
    color: white;
}

.timeline-content {
    background: var(--white);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.timeline-item.latest .timeline-content {
    border-color: var(--dam-blue-dark);
    box-shadow: 0 2px 8px rgba(5, 29, 96, 0.1);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--dam-gray);
    margin-bottom: 4px;
}

.timeline-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.timeline-location {
    font-size: 0.8rem;
    color: var(--dam-blue-light);
    margin-top: 4px;
}

.timeline-details {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.75rem;
    line-height: 1.2;
    font-weight: 500;
}

.order-modal-actions {
    padding: 15px 20px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-modal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-modal-track {
    background: var(--dam-blue-dark);
    color: white;
}

.btn-modal-track:hover {
    background: var(--dam-blue-hover);
    color: white;
}

.btn-modal-detail {
    background: var(--dam-gray-light);
    color: var(--dam-blue-dark);
}

.btn-modal-detail:hover {
    background: var(--border-color);
}

.btn-modal-invoice {
    background: rgba(39, 174, 96, 0.15);
    color: var(--color-success);
}

.btn-modal-invoice:hover {
    background: rgba(39, 174, 96, 0.25);
}

.btn-modal-email {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-modal-email:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f89);
}

.btn-modal-cancel {
    background: var(--dam-gray-light);
    color: var(--dam-gray);
}

.btn-modal-cancel:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

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

.btn-modal-send:hover {
    background: #219a52;
}

/* Email Form */
.order-modal-email-form {
    padding: 20px;
    background: #f0f7ff;
    border-top: 2px solid #3498db;
}

.order-modal-email-form h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--dam-blue-dark);
}

.email-form-row {
    margin-bottom: 15px;
}

.email-form-row label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dam-blue-dark);
}

.email-form-row input,
.email-form-row select,
.email-form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.email-form-row input:focus,
.email-form-row select:focus,
.email-form-row textarea:focus {
    outline: none;
    border-color: var(--dam-blue-dark);
    box-shadow: 0 0 0 3px rgba(5, 29, 96, 0.1);
}

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

.email-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

#emailFormStatus {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: none;
}

#emailFormStatus.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#emailFormStatus.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Email History in Modal */
.order-modal-emails {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid var(--border-color);
}

.order-modal-emails h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: var(--dam-blue-dark);
}

.email-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-history-item {
    background: white;
    border-radius: 8px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid #27ae60;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.email-history-item:hover {
    background: #f0f7ff;
    transform: translateX(3px);
}

.email-history-item.unread {
    background: #fff8e1;
    border-left-color: #ff9800;
    font-weight: 500;
}

.email-history-item.unread::after {
    content: "NOUVEAU";
    font-size: 0.65rem;
    background: #ff9800;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    float: right;
    margin-top: -20px;
}

.email-history-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.email-history-subject {
    font-size: 0.9rem;
    color: var(--dam-blue-dark);
    margin-bottom: 2px;
}

.email-history-to {
    font-size: 0.8rem;
    color: #888;
}

.btn-modal-history {
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-modal-history:hover {
    background: #5a6fd6;
}

/* ===== TABLES ===== */
.orders-table, .claims-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.orders-table th,
.orders-table td,
.claims-table th,
.claims-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.orders-table th,
.claims-table th {
    background: var(--dam-blue-dark);
    color: var(--white);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.orders-table tbody tr,
.claims-table tbody tr {
    transition: background var(--transition-fast);
}

.orders-table tbody tr:hover,
.claims-table tbody tr:hover {
    background: var(--dam-blue-transparent);
}

.orders-table tbody tr:nth-child(even),
.claims-table tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.orders-table tbody tr:nth-child(even):hover,
.claims-table tbody tr:nth-child(even):hover {
    background: var(--dam-blue-transparent);
}

/* Row separators */
.date-separator td,
.carrier-separator td,
.service-separator td {
    padding: 10px 16px;
    font-weight: 600;
}

.date-separator td {
    background: linear-gradient(135deg, var(--dam-blue-dark) 0%, var(--dam-blue-light) 100%);
    color: var(--white);
    font-size: 0.95rem;
}

.carrier-separator td {
    background: var(--dam-gray-light);
    color: var(--dam-blue-dark);
    font-size: 0.9rem;
    padding-left: 30px;
}

.service-separator td {
    background: #e8ecef;
    color: var(--dam-gray);
    font-size: 0.85rem;
    padding-left: 45px;
    font-weight: 500;
}

/* ===== BADGES ===== */
.status-badge, .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-delivered, .badge-success {
    background: rgba(39, 174, 96, 0.12);
    color: var(--color-success);
}

.status-transit, .badge-info {
    background: rgba(52, 152, 219, 0.12);
    color: var(--color-info);
}

.status-pending, .badge-warning {
    background: rgba(243, 156, 18, 0.12);
    color: #b37400;
}

.status-late, .badge-danger {
    background: var(--dam-red-transparent);
    color: var(--dam-red);
}

.status-exception {
    background: rgba(155, 89, 182, 0.12);
    color: #8e44ad;
}

.badge-primary {
    background: var(--dam-blue-transparent);
    color: var(--dam-blue-dark);
}

.badge-gray {
    background: var(--dam-gray-light);
    color: var(--dam-gray);
}

/* Late indicator */
.late-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--dam-red);
    color: var(--white);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.late-indicator.severe {
    background: #8b0000;
    animation: pulse-late 1.5s infinite;
}

@keyframes pulse-late {
    0%, 100% { box-shadow: 0 0 0 0 rgba(195, 27, 27, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(195, 27, 27, 0); }
}

/* ===== MODALS ===== */
.modal-overlay, .sync-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 29, 96, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal, .sync-modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header, .sync-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--dam-blue-dark);
    color: var(--white);
}

.modal-title, .sync-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
}

.modal-close, .sync-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
    opacity: 0.75;
    transition: opacity var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover, .sync-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.modal-body, .sync-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 55vh;
}

.modal-footer, .sync-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-light);
}

/* Sync Log */
.sync-log {
    background: #0d1117;
    border-radius: var(--radius-md);
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
}

.sync-log div {
    padding: 2px 0;
}

.sync-log .log { color: #8b949e; }
.sync-log .success { color: #3fb950; }
.sync-log .error { color: #f85149; }
.sync-log .warning { color: #d29922; }

.sync-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.sync-stat {
    text-align: center;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.sync-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dam-blue-dark);
}

.sync-stat .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 4px;
}

/* ===== ALERTS ===== */
.alert, .message {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success, .message.success {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.alert-danger, .alert-error, .message.error {
    background: var(--dam-red-transparent);
    border: 1px solid var(--dam-red);
    color: var(--dam-red);
}

.alert-warning, .message.warning {
    background: rgba(243, 156, 18, 0.1);
    border: 1px solid var(--color-warning);
    color: #9a7b0a;
}

.alert-info, .message.info {
    background: var(--dam-blue-transparent);
    border: 1px solid var(--dam-blue-dark);
    color: var(--dam-blue-dark);
}

/* ===== TRACKING LINK ===== */
.tracking-link, .btn-tracking {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--dam-blue-dark);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.tracking-link:hover, .btn-tracking:hover {
    background: var(--dam-blue-hover);
    color: var(--white);
    transform: scale(1.1);
}

/* ===== ACTION BUTTONS (small) ===== */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn.edit {
    background: var(--dam-blue-dark);
    color: var(--white);
}

.action-btn.edit:hover {
    background: var(--dam-blue-hover);
}

.action-btn.view {
    background: var(--dam-gray);
    color: var(--white);
}

.action-btn.archive {
    background: var(--dam-gray);
    color: var(--white);
}

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

.action-btn.chrono-export {
    background: linear-gradient(135deg, #0066cc, #004499);
    color: var(--white);
}

.action-btn.chrono-export:hover {
    background: linear-gradient(135deg, #004499, #003366);
}

/* ===== BULK ACTIONS ===== */
.bulk-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px 20px;
    background: rgba(243, 156, 18, 0.1);
    border-bottom: 1px solid var(--color-warning);
    flex-wrap: wrap;
}

.bulk-actions.hidden {
    display: none;
}

.bulk-actions span {
    font-weight: 600;
    color: var(--dam-blue-dark);
}

/* ===== CHRONOPOST EXPORT BUTTON ===== */
.btn-chrono-export {
    background: linear-gradient(135deg, #0066cc, #004499);
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-chrono-export:hover {
    background: linear-gradient(135deg, #004499, #003366);
    transform: translateY(-1px);
}

/* ===== SYNC RANGE BUTTONS ===== */
.sync-range-bar {
    display: flex;
    gap: 6px;
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.sync-range-btn {
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.sync-range-btn:hover {
    background: rgba(255,255,255,0.2);
    color: var(--white);
}

.sync-range-btn.active {
    background: var(--white);
    color: var(--dam-blue-dark);
    border-color: var(--white);
    font-weight: 600;
}

/* ===== CHECKBOX ===== */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--dam-blue-dark);
}

.checkbox-cell {
    width: 40px;
    text-align: center;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dam-blue-dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--dam-blue-dark);
    box-shadow: 0 0 0 3px var(--dam-blue-transparent);
}

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

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--dam-blue-dark);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--dam-blue-transparent);
    border-color: var(--dam-blue-dark);
}

.pagination .active {
    background: var(--dam-blue-dark);
    color: var(--white);
    border-color: var(--dam-blue-dark);
}

/* ===== ORDER DETAIL ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.detail-section h3 {
    font-size: 1rem;
    color: var(--dam-blue-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--dam-blue-transparent);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    color: var(--dam-blue-dark);
    font-weight: 600;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--dam-blue-transparent);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--dam-blue-dark);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.timeline-item.delivered::before {
    background: var(--color-success);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.timeline-content {
    font-weight: 500;
    color: var(--dam-blue-dark);
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--dam-blue-dark); }
.text-danger { color: var(--dam-red); }
.text-success { color: var(--color-success); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.hidden { display: none !important; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    html { font-size: 13px; }

    .dashboard-container {
        padding: 15px;
    }

    .main-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .header-brand {
        flex-direction: column;
    }

    .header-actions {
        justify-content: center;
    }

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

    .filters-grid {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .sync-range-bar {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }

    .btn-action {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--dam-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dam-blue-dark);
}

/* ===== PRINT ===== */
@media print {
    body {
        background: white;
    }

    .main-header,
    .btn-action,
    .filters-card,
    .bulk-actions,
    .pagination {
        display: none !important;
    }

    .card, .orders-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
