/* ===== VARIABLES ===== */
:root {
    --primary: #1b2a46;
    --primary-light: rgba(27, 42, 70, 0.08);
    --primary-hover: #243757;
    --accent: #c0392b;
    --bg: #f6f7f8;
    --white: #ffffff;
    --border: #e8eaed;
    --border-light: #f0f1f3;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-label: #9ca3af;
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-text: #92400e;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-text: #991b1b;
    --info: #2563eb;
    --info-bg: #eff6ff;
    --info-text: #1e40af;
    --sidebar-w: 256px;
    --topbar-h: 80px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --transition: 0.15s ease;
}

/* ===== BASE ===== */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-size: 14px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    background: #111111;
    border-right: none;
    height: 100vh;
    overflow: hidden;
    transition: width var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
}

.sidebar-logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    border-radius: 6px;
}

/* Nav */
.sidebar-nav {
    overflow-y: auto;
    padding: 4px 12px;
}

.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

.nav-group { margin-bottom: 4px; }

.nav-group-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.35);
    padding: 14px 10px 6px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    border-left: 3px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-nav .nav-link .material-symbols-outlined {
    font-size: 20px;
}

/* User card in topbar */
.user-card-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

.user-card-topbar:hover { background: var(--bg); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
}

.user-expand {
    font-size: 16px;
    color: var(--text-muted);
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition);
}

.user-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--transition);
}

.user-dropdown-menu .dropdown-item:hover {
    background: var(--bg);
    color: var(--text);
}

.user-dropdown-menu .dropdown-item .material-symbols-outlined {
    font-size: 18px;
}

.user-dropdown-menu .dropdown-item-danger {
    color: var(--danger);
}

.user-dropdown-menu .dropdown-item-danger:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.user-dropdown-menu .dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-h);
    min-height: var(--topbar-h);
    max-height: var(--topbar-h);
    flex: 0 0 var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    z-index: 50;
    overflow: hidden;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    transition: background var(--transition);
    padding: 0;
}

.btn-icon:hover { background: var(--bg); }

.topbar-search {
    flex: 1;
    max-width: 520px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.topbar-search .form-control {
    background: var(--bg);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 8px 80px 8px 40px;
    font-size: 13px;
    color: var(--text);
    height: 38px;
    transition: all var(--transition);
}

.topbar-search .form-control::placeholder { color: var(--text-muted); }
.topbar-search .form-control:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27,42,70,0.08);
}

.search-kbd {
    position: absolute;
    right: 12px;
    display: flex;
    gap: 3px;
    pointer-events: none;
}

.search-kbd kbd {
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--white);
    font-family: inherit;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.notif-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border: 2px solid var(--white);
    border-radius: 50%;
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 6px;
}

.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition);
}

.btn-primary-custom:hover { background: var(--primary-hover); color: #fff; }

/* ===== PAGE CONTENT ===== */
.page-content {
    padding: 28px;
    background: var(--bg);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    position: relative;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

/* Time filters */
.time-filters {
    display: flex;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    box-shadow: var(--shadow-sm);
}

.time-filters .tf-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
}

.time-filters .tf-btn:hover { background: var(--bg); }

.time-filters .tf-btn.active {
    background: var(--primary);
    color: #fff;
}

/* ===== KPI GRID ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.kpi-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
}

.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.warn { color: var(--warning); }

.kpi-trend .material-symbols-outlined { font-size: 14px; }

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

/* ===== CARD / PANEL ===== */
.card-custom {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-header-custom h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.card-header-custom h3 .material-symbols-outlined {
    font-size: 20px;
}

.card-header-custom .card-action {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

.card-header-custom .card-action:hover { text-decoration: underline; }

.card-body-custom { padding: 0; flex: 1; }
.card-footer-custom {
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
}

/* ===== TABLES ===== */
.table-custom {
    width: 100%;
    font-size: 13px;
    margin: 0;
}

.table-custom thead {
    background: var(--bg);
}

.table-custom thead th {
    padding: 10px 18px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border: none;
    border-bottom: 1px solid var(--border-light);
}

.table-custom tbody td {
    padding: 12px 18px;
    border: none;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

.table-custom tbody tr:last-child td { border-bottom: none; }

.table-custom tbody tr:hover td { background: rgba(0,0,0,0.015); }

.td-primary {
    font-weight: 600;
    color: var(--primary);
}

/* ===== BADGES ===== */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text); }
.badge-neutral { background: var(--bg); color: var(--text-secondary); }

/* Status dot */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.status-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.dot-warning::before { background: var(--warning); }
.status-dot.dot-info::before    { background: var(--info); }
.status-dot.dot-success::before { background: var(--success); }
.status-dot.dot-muted::before   { background: var(--text-muted); }

/* ===== STOCK ALERT ROWS ===== */
.stock-alert-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.stock-alert-row:last-child { border-bottom: none; }
.stock-alert-row:hover { background: var(--bg); }

.stock-alert-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-icon {
    width: 38px;
    height: 38px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stock-icon .material-symbols-outlined {
    font-size: 18px;
    color: var(--text-muted);
}

.stock-product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.stock-product-ref {
    font-size: 11px;
    color: var(--text-muted);
}

.stock-alert-data {
    display: flex;
    align-items: center;
    gap: 0;
}

.stock-alert-data > div {
    width: 100px;
    flex-shrink: 0;
}

.stock-alert-data > div:last-of-type {
    width: 150px;
    flex-shrink: 0;
}

.stock-metric-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-label);
}

.stock-metric-value {
    font-size: 13px;
    font-weight: 700;
}

.stock-metric-value.critical { color: var(--danger); }

.btn-reorder {
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-reorder:hover { background: rgba(27,42,70,0.15); }

/* ===== ACTIVITY LIST ===== */
.activity-list {}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-dot.dot-success { background: var(--success); }
.activity-dot.dot-danger  { background: var(--danger); }
.activity-dot.dot-warning { background: var(--warning); }
.activity-dot.dot-info    { background: var(--info); }

.activity-content { flex: 1; min-width: 0; }

.activity-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== WIDGET: INVOICE CARD ===== */
.invoice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.invoice-item:last-child { margin-bottom: 0; }

.invoice-vendor {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.invoice-ref {
    font-size: 10px;
    color: var(--text-muted);
}

.invoice-amount {
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.invoice-status {
    font-size: 10px;
    font-weight: 700;
}

/* ===== WIDGET: TICKETS ===== */
.ticket-item {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.ticket-item:last-child { margin-bottom: 0; }

.ticket-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ticket-avatar .material-symbols-outlined { font-size: 16px; color: var(--text-muted); }

.ticket-content { flex: 1; min-width: 0; }

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.ticket-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.ticket-time {
    font-size: 10px;
    color: var(--text-muted);
}

.ticket-message {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 1px;
}

.ticket-tags {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.ticket-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
}

/* ===== CAMPAIGN WIDGET ===== */
.campaign-card {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.campaign-card::after {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    filter: blur(20px);
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.campaign-title {
    font-size: 13px;
    font-weight: 700;
}

.campaign-icon { opacity: 0.3; }
.campaign-icon .material-symbols-outlined { font-size: 22px; }

.campaign-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.campaign-metric-label {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.5;
}

.campaign-metric-value {
    font-size: 17px;
    font-weight: 700;
}

.campaign-metric-value.large {
    font-size: 20px;
}

.campaign-full {
    grid-column: 1 / -1;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===== ALERT BANNER ===== */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--warning-bg);
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    margin-top: 24px;
}

.alert-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fef3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-banner-icon .material-symbols-outlined {
    font-size: 20px;
    color: var(--warning);
}

.alert-banner-content { flex: 1; }

.alert-banner-title {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
}

.alert-banner-text {
    font-size: 12px;
    color: #a16207;
    margin-top: 1px;
}

.btn-fix {
    padding: 8px 18px;
    background: #d97706;
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition);
}

.btn-fix:hover { background: #b45309; }

/* ===== WIDGET PADDING ===== */
.widget-body {
    padding: 14px 18px;
}

.btn-widget-full {
    display: block;
    width: 100%;
    padding: 9px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    margin-top: 10px;
}

.btn-widget-full:hover { background: var(--border); }

/* ===== FLOATING ACTIONS ===== */
.floating-actions {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.fab {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.fab:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.fab-secondary {
    background: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.fab-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(27,42,70,0.35);
}

.fab-tooltip {
    position: absolute;
    right: 56px;
    background: var(--text);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.fab:hover .fab-tooltip { opacity: 1; }

/* ===== KPI GRID VARIANTS ===== */
.kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ===== FILTERS BAR ===== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.filter-search .material-symbols-outlined {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-search .form-control {
    background: var(--bg);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 8px 12px 8px 36px;
    font-size: 13px;
    color: var(--text);
    height: 36px;
    transition: all var(--transition);
}

.filter-search .form-control:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27,42,70,0.08);
}

.filter-select {
    background: var(--bg);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 7px 28px 7px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    height: 36px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all var(--transition);
}

.filter-select:hover {
    background: var(--border-light);
}

.filter-select:focus {
    border-color: var(--primary);
    background: var(--white);
    outline: none;
}

.results-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: auto;
    white-space: nowrap;
}

/* ===== PRODUCT TABLE ===== */
.table-products {
    table-layout: fixed;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-cat {
    font-size: 11px;
    color: var(--text-muted);
}

.vehicle-tag {
    display: inline-block;
    padding: 2px 7px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 2px;
}

/* ===== QUALITY BAR ===== */
.quality-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quality-bar-container {
    width: 48px;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.quality-bar {
    height: 100%;
    border-radius: 3px;
}

.quality-bar.quality-high { background: var(--success); }
.quality-bar.quality-medium { background: var(--warning); }
.quality-bar.quality-low { background: var(--danger); }

.quality-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== ENRICH LIST ===== */
.enrich-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.enrich-item:last-child { border-bottom: none; }

.enrich-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.enrich-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.enrich-ref {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.enrich-missing {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.missing-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

/* ===== STAT ROWS ===== */
.stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 90px;
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-bar-container {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    border-radius: 3px;
}

.stat-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    min-width: 32px;
    text-align: right;
}

/* ===== TABLE PAGINATION ===== */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 6px;
    transition: all var(--transition);
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--bg);
    border-color: var(--text-muted);
}

.pagination-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn .material-symbols-outlined {
    font-size: 18px;
}

.pagination-dots {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 4px;
}

/* ===== FILTER TABS (inside filters-bar) ===== */
.filters-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-tab:hover { color: var(--text-secondary); background: var(--bg); }

.filter-tab.active {
    background: var(--primary-light);
    color: var(--primary);
}

.filter-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    background: var(--border-light);
    color: var(--text-muted);
}

.filter-tab.active .filter-tab-count {
    background: var(--primary);
    color: #fff;
}

.filter-tab-count.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

/* ===== ORDERS TABLE ===== */
.table-orders { table-layout: fixed; }

.order-row, .product-row, .stock-row { cursor: pointer; }
.order-row:hover td, .product-row:hover td, .stock-row:hover td { background: var(--primary-light); }

.order-client {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.order-client-type {
    font-size: 11px;
    color: var(--text-muted);
}

.order-time {
    font-size: 11px;
    color: var(--text-muted);
}

.order-articles {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-articles-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== TRANSPORTER TAGS ===== */
.transporter-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.transporter-dpd {
    background: #fef3c7;
    color: #92400e;
}

.transporter-poste {
    background: #dbeafe;
    color: #1e40af;
}

.transporter-schenker {
    background: #fce7f3;
    color: #9d174d;
}

.ramasse-deadline {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.ramasse-deadline.urgent {
    color: var(--warning-text);
    font-weight: 600;
}

/* ===== ORDER DETAIL PANEL ===== */
.order-detail-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.order-detail-section:last-child { border-bottom: none; }

.order-detail-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.order-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.order-detail-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.order-detail-article {
    padding: 8px 10px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-top: 4px;
}

.order-detail-article-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.order-detail-article-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.order-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.order-detail-total {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px !important;
    margin-top: 8px;
    border-bottom: none;
}

.order-total-line {
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
}

.order-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
}

.btn-order-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 16px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-order-secondary:hover {
    background: var(--border-light);
    color: var(--text);
}

/* ===== BULKY ITEMS ===== */
.bulky-item {
    padding: 8px 0;
}

.bulky-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.bulky-order {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.bulky-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== PICKUP SCHEDULE ===== */
.pickup-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.pickup-item:last-child { border-bottom: none; }

.pickup-carrier { flex-shrink: 0; }

.pickup-info { flex: 1; }

.pickup-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.pickup-remaining {
    font-size: 11px;
    color: var(--text-muted);
}

.pickup-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== MODAL CUSTOM ===== */
.modal-custom {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header-custom {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: none;
}
.modal-title-custom {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.modal-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 0;
}
.btn-modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    transition: var(--transition);
}
.btn-modal-close:hover { background: var(--bg); color: var(--text); }

/* Stepper */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px 20px;
    gap: 0;
}
.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 90px;
}
.stepper-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
}
.stepper-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
}
.stepper-step.active .stepper-number {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.stepper-step.active .stepper-label { color: var(--primary); font-weight: 600; }
.stepper-step.completed .stepper-number {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.stepper-step.completed .stepper-label { color: var(--success); }
.stepper-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 20px;
}

/* Modal body */
.modal-body-custom {
    padding: 0 28px 24px;
    max-height: 55vh;
    overflow-y: auto;
}
.step-content { display: none; }
.step-content.active { display: block; }
.step-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--bg);
    border-radius: var(--radius);
}
.step-header .material-symbols-outlined { font-size: 24px; margin-top: 2px; }
.step-title { font-size: 14px; font-weight: 700; margin: 0 0 2px; color: var(--text); }
.step-desc { font-size: 12px; color: var(--text-secondary); margin: 0; line-height: 1.5; }

/* Form grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group.full-width { grid-column: 1 / -1; }
.form-label-custom {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,42,70,0.08); }
.form-textarea { resize: vertical; min-height: 70px; }
.input-with-suffix { position: relative; }
.input-with-suffix .form-input { padding-right: 50px; }
.input-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.voice-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--info-bg);
    border-radius: 6px;
}
.voice-hint-text { font-size: 11px; color: var(--info-text); }

/* Enrichment cards (Step 2) */
.enrichment-grid { display: flex; flex-direction: column; gap: 12px; }
.enrichment-card {
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.enrichment-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; }
.enrichment-value { font-size: 13px; color: var(--text); line-height: 1.5; }
.enrichment-text { font-size: 12px; }
.enrichment-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.enrichment-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.enrichment-seo { display: flex; flex-direction: column; gap: 6px; }
.seo-item { display: flex; gap: 8px; font-size: 12px; }
.seo-label { font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.seo-value { color: var(--text); }

/* Validation (Step 3) */
.validation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.validation-section-title { font-size: 12px; font-weight: 700; color: var(--text); margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}
.check-item .check-icon { font-size: 18px; color: var(--border); }
.check-item.checked { color: var(--text); }
.check-item.checked .check-icon { color: var(--success); }
.photo-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    background: var(--bg);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 14px;
}
.photo-upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.photo-upload-text { font-size: 12px; color: var(--text-secondary); margin: 8px 0 4px; }
.photo-upload-hint { font-size: 10px; color: var(--text-muted); }
.validation-assigner { display: flex; align-items: center; gap: 10px; }
.assigner-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--success-bg);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--success-text);
}
.assigner-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

/* Publish (Step 4) */
.publish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.publish-target {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
}
.publish-target-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
}
.publish-items { display: flex; flex-direction: column; gap: 8px; }
.publish-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.done-icon { font-size: 16px; color: var(--success); }

/* Quality (Step 5) */
.quality-overview { display: flex; gap: 28px; align-items: flex-start; margin-bottom: 16px; }
.quality-score-big { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.quality-circle { position: relative; width: 100px; height: 100px; }
.quality-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.quality-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 700;
    color: var(--warning);
}
.quality-label-big { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.quality-details { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.quality-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 4px 0;
}
.quality-detail-item.complete { color: var(--success-text); }
.quality-detail-item.complete .material-symbols-outlined { font-size: 16px; color: var(--success); }
.quality-detail-item.missing { color: var(--danger); }
.quality-detail-item.missing .material-symbols-outlined { font-size: 16px; color: var(--danger); }
.quality-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--warning-bg);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--warning-text);
}

/* Modal footer */
.modal-footer-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-top: 1px solid var(--border-light);
}
.modal-footer-right { display: flex; gap: 8px; }
.btn-secondary-custom {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.btn-secondary-custom:hover { background: var(--bg); color: var(--text); }
.btn-outline-custom {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}
.btn-outline-custom:hover { background: var(--bg); }

/* ===== NEW ORDER MODAL ===== */
.client-found-card {
    padding: 16px;
    border: 1px solid var(--success);
    border-radius: var(--radius);
    background: var(--success-bg);
}
.client-found-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.client-found-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.client-found-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.client-found-info strong { font-size: 14px; color: var(--text); }
.client-found-type { font-size: 11px; color: var(--text-muted); }
.client-found-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin-bottom: 10px;
}
.client-found-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.client-found-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.channel-options {
    display: flex;
    gap: 10px;
}
.channel-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.channel-option input[type="radio"] { display: none; }
.channel-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.channel-option:hover { border-color: var(--primary); }

/* Order articles list */
.order-articles-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}
.order-article-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
}
.order-article-item:last-child { border-bottom: none; }
.order-article-main { flex: 1; min-width: 0; }
.order-article-name { font-size: 13px; font-weight: 600; color: var(--text); }
.order-article-ref { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.order-article-location {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--info-text);
    background: var(--info-bg);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    width: fit-content;
}
.order-article-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.qty-btn:hover { background: var(--bg); border-color: var(--primary); }
.qty-value { font-size: 13px; font-weight: 700; color: var(--text); min-width: 18px; text-align: center; }
.order-article-price { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.order-article-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}
.order-article-remove:hover { color: var(--danger); background: var(--danger-bg); }

.btn-add-article {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    margin-bottom: 16px;
}
.btn-add-article:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.order-subtotal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
}

/* Transport options */
.transport-suggestion {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
}
.transport-suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text);
}
.transport-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.transport-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}
.transport-option input[type="radio"] { margin-top: 3px; accent-color: var(--primary); }
.transport-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.transport-option:hover { border-color: var(--primary); }
.transport-option-content { flex: 1; }
.transport-option-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.transport-option-reason { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.transport-option-price { font-size: 12px; font-weight: 600; color: var(--text); }

/* Order summary */
.order-summary-final {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}
.order-summary-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1400px) {
    .kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Stock page ===== */
.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(5,150,105,.08);
    color: var(--success);
    border: 1px solid rgba(5,150,105,.15);
}

.stock-channel {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: 13px;
}
.stock-channel-diff {
    color: var(--danger);
    font-weight: 700;
}

.stock-ecart {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
}
.stock-ok { color: var(--success); }
.stock-danger { color: var(--danger); }
.stock-warning { color: var(--warning); }

.stock-row-alert td { background: rgba(220,38,38,.03); }
.stock-row-warn td { background: rgba(217,119,6,.03); }

.stock-movement {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}
.stock-movement-time {
    font-size: 11px;
    color: var(--text-muted);
}

.anomaly-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.anomaly-item:last-child { border-bottom: none; }
.anomaly-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.anomaly-ref {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}
.anomaly-detail {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

@media (max-width: 1024px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar { position: fixed; z-index: 1000; transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
}

@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
    .page-header { flex-direction: column; gap: 12px; }
    .expense-workflow-inline { position: static; transform: none; }
}

/* ========================================
   PIPELINE BAR (Devis page)
   ======================================== */
.pipeline-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
    min-width: 80px;
}
.pipeline-stage:hover { background: var(--bg); }

.pipeline-stage-count {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}
.pipeline-stage-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    white-space: nowrap;
}

.pipeline-stage.pipeline-info .pipeline-stage-count { color: var(--info); }
.pipeline-stage.pipeline-warning .pipeline-stage-count { color: var(--warning); }
.pipeline-stage.pipeline-danger .pipeline-stage-count { color: var(--danger); }
.pipeline-stage.pipeline-success .pipeline-stage-count { color: var(--success); }
.pipeline-stage.pipeline-neutral .pipeline-stage-count { color: var(--text-muted); }

.pipeline-bar .pipeline-connector {
    width: 32px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

/* ========================================
   QUOTE-SPECIFIC STYLES
   ======================================== */
.quote-row { cursor: pointer; }
.quote-row:hover td { background: rgba(0,0,0,0.015); }
.table-quotes td:nth-child(n+4) { text-align: right; }

.quote-discount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.email-preview-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.email-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.email-preview-content {
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .pipeline-bar { flex-wrap: wrap; gap: 4px; }
    .pipeline-bar .pipeline-connector { width: 16px; }
    .pipeline-stage { padding: 6px 10px; min-width: 60px; }
    .pipeline-stage-count { font-size: 16px; }
}

/* ===== CUSTOMERS PAGE ===== */
.table-customers { table-layout: fixed; }
.table-customers th:nth-child(1) { width: 18%; }
.table-customers th:nth-child(2) { width: 20%; }
.table-customers th:nth-child(3) { width: 14%; }
.table-customers th:nth-child(4) { width: 13%; }
.table-customers th:nth-child(5) { width: 12%; }
.table-customers th:nth-child(6) { width: 8%; }
.table-customers th:nth-child(7) { width: 15%; }

.customer-row { cursor: pointer; }
.customer-row:hover { background: var(--primary-light); }
.customer-name { font-weight: 600; font-size: 13px; color: var(--primary); }
.customer-type { font-size: 11px; color: var(--text-muted); }

.vehicule-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    white-space: nowrap;
}

.segment-item { margin-bottom: 12px; }
.segment-item:last-child { margin-bottom: 0; }
.segment-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.segment-count { font-size: 11px; color: var(--text-muted); }

.table-compact { font-size: 12px; }
.table-compact th { padding: 6px 10px; }
.table-compact td { padding: 6px 10px; }

.vehicule-ranking { display: flex; flex-direction: column; gap: 10px; }
.vehicule-rank-item { display: flex; align-items: center; gap: 10px; }
.vehicule-rank-pos {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vehicule-rank-info { flex: 1; min-width: 0; }
.vehicule-rank-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.vehicule-rank-count { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 30px; text-align: right; }

.recent-clients-list { display: flex; flex-direction: column; gap: 12px; }
.recent-client-item { display: flex; align-items: center; gap: 10px; }
.recent-client-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary); color: #fff;
    font-size: 11px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    letter-spacing: 0.5px;
}
.recent-client-info { flex: 1; min-width: 0; }
.recent-client-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.recent-client-detail { display: flex; align-items: center; gap: 6px; }
.recent-client-date { font-size: 11px; color: var(--text-muted); }

/* ===== INVOICES PAGE ===== */
.table-invoices td:nth-child(n+4) { text-align: right; }
.table-invoices td:nth-child(7) { text-align: left; }
.table-invoices td:nth-child(8) { text-align: center; }
.table-invoices td:nth-child(9) { text-align: center; }

.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: rgba(0,0,0,0.015); }

.comparison-mismatch {
    background: rgba(220,38,38,0.04) !important;
}
.comparison-mismatch td {
    color: var(--danger);
}

.comparison-mismatch-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(220,38,38,0.06);
    border: 1px solid rgba(220,38,38,0.15);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--danger);
}

.timeline-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.timeline-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    min-width: 120px;
}
.timeline-text { color: var(--text-secondary); }

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    background: var(--bg);
    cursor: pointer;
    transition: var(--transition);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }

.filter-tab-count.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ===== PAYMENTS PAGE ===== */
.table-payments { table-layout: fixed; }
.table-payments th:nth-child(1) { width: 10%; }
.table-payments th:nth-child(2) { width: 10%; }
.table-payments th:nth-child(3) { width: 12%; }
.table-payments th:nth-child(4) { width: 17%; }
.table-payments th:nth-child(5) { width: 15%; }
.table-payments th:nth-child(6) { width: 10%; }
.table-payments th:nth-child(7) { width: 8%; }
.table-payments th:nth-child(8) { width: 13%; }

.payment-client { font-weight: 500; font-size: 13px; }

.source-tag {
    display: inline-block; padding: 2px 10px; border-radius: 4px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.source-cb { background: #e8f0fe; color: #1a56db; }
.source-paypal { background: #fef3cd; color: #92600a; }
.source-virement { background: #d1fae5; color: #065f46; }
.source-cheque { background: #f3f4f6; color: #4b5563; }

.tva-alert-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tva-alert-item:last-child { border-bottom: none; }
.tva-alert-flag {
    width: 30px; height: 22px; border-radius: 3px;
    background: var(--danger-bg); color: var(--danger);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tva-alert-info { flex: 1; min-width: 0; }
.tva-alert-client { font-size: 12px; font-weight: 600; color: var(--text); }
.tva-alert-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; margin-top: 1px; }

/* ===== EXPENSES PAGE ===== */
.table-expenses td:nth-child(4) { text-align: right; }

.expense-workflow-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--white);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.wf-step {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.wf-arrow {
    font-size: 14px;
    color: var(--border);
}

.expense-ticket-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
    overflow: hidden;
}
.expense-ticket-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--bg);
    min-height: 280px;
}

/* ===== TVA & DECLARATIONS ===== */
.echeance-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.15s;
}
.echeance-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.echeance-urgent {
    border-left: 3px solid var(--danger);
}
.echeance-warning {
    border-left: 3px solid var(--warning);
}
.echeance-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.echeance-icon .material-symbols-outlined {
    font-size: 20px;
    color: var(--primary);
}
.echeance-urgent .echeance-icon {
    background: var(--danger-bg);
}
.echeance-urgent .echeance-icon .material-symbols-outlined {
    color: var(--danger);
}
.echeance-warning .echeance-icon {
    background: var(--warning-bg);
}
.echeance-warning .echeance-icon .material-symbols-outlined {
    color: var(--warning);
}
.echeance-info {
    flex: 1;
    min-width: 0;
}
.echeance-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.echeance-date {
    font-size: 11px;
    color: var(--text-muted);
}
.echeance-countdown {
    text-align: center;
    flex-shrink: 0;
}
.echeance-days {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.echeance-urgent .echeance-days {
    color: var(--danger);
}
.echeance-warning .echeance-days {
    color: var(--warning);
}
.echeance-days-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Alertes coherence */
.alert-coherence-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.alert-coherence-item:last-child {
    border-bottom: none;
}
.alert-coherence-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.alert-coherence-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Tax table */
.table-tax { table-layout: auto; }
.table-tax tfoot tr {
    font-weight: 700;
    border-top: 2px solid var(--primary);
}
.table-tax tfoot td {
    padding-top: 14px !important;
}

/* TVA France synthesis grid */
.tva-france-grid {
    display: flex;
    flex-direction: column;
}
.tva-grid-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.tva-grid-header .tva-grid-cell {
    padding: 10px 18px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.tva-grid-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s;
}
.tva-grid-row:hover {
    background: rgba(27, 42, 70, 0.02);
}
.tva-grid-row:last-child {
    border-bottom: none;
}
.tva-grid-row .tva-grid-cell {
    padding: 14px 18px;
}
.tva-grid-row .tva-grid-cell:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tva-taux-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}
.tva-taux-20 {
    background: linear-gradient(135deg, #1b2a46 0%, #2d4a7a 100%);
    color: #fff;
}
.tva-taux-10 {
    background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
    color: #fff;
}
.tva-taux-55 {
    background: linear-gradient(135deg, #059669 0%, #34d399 100%);
    color: #fff;
}
.tva-taux-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.tva-taux-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.tva-taux-detail {
    font-size: 11px;
    color: var(--text-muted);
}
.tva-amount {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}
.tva-deductible {
    color: var(--text-muted);
}
.tva-nette {
    font-weight: 700 !important;
    color: var(--text) !important;
}
.tva-grid-footer {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    align-items: center;
    background: var(--primary);
    color: #fff;
    border-radius: 0 0 10px 10px;
}
.tva-grid-footer .tva-grid-cell {
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 700;
}
.tva-grid-footer .tva-grid-cell:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tva-footer-total {
    font-size: 16px !important;
    font-weight: 800 !important;
}
.p-0 { padding: 0 !important; }

/* TVA Repartition */
.tva-repartition-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tva-repart-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tva-repart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tva-repart-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
}
.tva-repart-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tva-repart-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}
.tva-repart-amount {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

/* TVA Comparaison mensuelle */
.tva-compare-list {
    display: flex;
    flex-direction: column;
}
.tva-compare-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-light);
}
.tva-compare-item:last-child {
    border-bottom: none;
}
.tva-compare-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    min-width: 90px;
}
.tva-compare-values {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.tva-compare-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}
.tva-compare-month {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}
.tva-compare-val {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.tva-compare-current {
    font-weight: 700;
    color: var(--primary);
}
.tva-compare-arrow {
    display: flex;
    align-items: center;
}
.tva-compare-delta {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}
.tva-compare-delta.up {
    color: var(--success-text);
    background: var(--success-bg);
}
.tva-compare-delta.down {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Country cell with flag */
.country-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.country-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border-radius: 3px;
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* Tax summary list (Resume mensuel) */
.tax-summary-list {
    display: flex;
    flex-direction: column;
}
.tax-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-light);
}
.tax-summary-item:last-child {
    border-bottom: none;
}
.tax-summary-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.tax-summary-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.tax-summary-divider {
    height: 0;
    border-top: 1px dashed var(--border);
    margin: 0;
}
.tax-summary-total {
    background: linear-gradient(135deg, rgba(27,42,70,0.04) 0%, rgba(27,42,70,0.08) 100%);
    border-bottom: none !important;
}
.tax-summary-total .tax-summary-label {
    font-weight: 700;
    color: var(--text);
    font-size: 12px;
}
.tax-summary-total .tax-summary-value {
    font-size: 15px;
    font-weight: 800;
}
.h-100 { height: 100%; }

/* Recap modal */
.recap-section {
    background: var(--bg);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-light);
}
.recap-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.recap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}
.recap-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.recap-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.recap-total {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 2px solid var(--primary);
}
.recap-total .recap-label {
    font-weight: 700;
    color: var(--text);
}
.recap-total .recap-value {
    font-size: 15px;
    font-weight: 700;
}
.recap-alert-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.recap-alert-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text);
    padding: 8px 10px;
    background: var(--white);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

/* ===== PURCHASING / REAPPROVISIONNEMENT ===== */
.supplier-group {
    border-bottom: 2px solid var(--border);
}
.supplier-group:last-child {
    border-bottom: none;
}
.supplier-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg);
}
.supplier-group-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.supplier-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}
.supplier-mini-avatar {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    flex-shrink: 0;
}
.supplier-group-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.supplier-group-detail {
    font-size: 11px;
    color: var(--text-muted);
}
.supplier-group-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.supplier-group-total {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
}
.btn-sm {
    padding: 5px 12px !important;
    font-size: 11px !important;
}
.supplier-group .table-custom {
    margin: 0;
}
.supplier-group .table-custom thead {
    display: none;
}
.supplier-group:first-child .table-custom thead {
    display: table-header-group;
}
.table-purchasing { table-layout: fixed; }
.table-purchasing th:nth-child(1) { width: 28%; }
.table-purchasing th:nth-child(2) { width: 14%; }
.table-purchasing th:nth-child(3) { width: 9%; }
.table-purchasing th:nth-child(4) { width: 9%; }
.table-purchasing th:nth-child(5) { width: 10%; }
.table-purchasing th:nth-child(6) { width: 14%; }
.table-purchasing th:nth-child(7) { width: 16%; }

/* Stock level badges */
.stock-rupture {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    background: var(--danger-bg);
    color: var(--danger);
}
.stock-critical {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    background: var(--warning-bg);
    color: var(--warning);
}
.stock-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(27,42,70,0.08);
    color: var(--text);
}

/* Order tracking items */
.order-track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.order-track-item:last-child { border-bottom: none; }
.order-track-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.order-track-icon.transit { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.order-track-icon.partial { background: linear-gradient(135deg, #d97706, #fbbf24); }
.order-track-icon.confirmed { background: linear-gradient(135deg, #64748b, #94a3b8); }
.order-track-icon.delivered { background: linear-gradient(135deg, #059669, #34d399); }
.order-track-info { flex: 1; min-width: 0; }
.order-track-ref {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.order-track-supplier {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}
.order-track-right { text-align: right; flex-shrink: 0; }
.order-track-date {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Tarif alerts */
.tarif-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition);
}
.tarif-alert-item:hover { box-shadow: var(--shadow); }
.tarif-alert-item.tarif-up { background: var(--danger-bg); border-color: rgba(220,38,38,0.12); }
.tarif-alert-item.tarif-down { background: var(--success-bg); border-color: rgba(5,150,105,0.12); }
.tarif-alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tarif-up .tarif-alert-icon { background: rgba(220,38,38,0.12); }
.tarif-down .tarif-alert-icon { background: rgba(5,150,105,0.12); }
.tarif-alert-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.tarif-alert-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Radio card group */
.radio-card-group {
    display: flex;
    gap: 12px;
}
.radio-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: border-color 0.15s;
}
.radio-card.active {
    border-color: var(--primary);
}

/* ===== SERVICE CLIENT ===== */
.table-support td:nth-child(7),
.table-support td:nth-child(8) { text-align: center; }
.table-support th:nth-child(7),
.table-support th:nth-child(8) { text-align: center; }

.badge-type-tech {
    background: var(--primary-light);
    color: var(--primary);
}

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.thread-message {
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
}
.thread-message-client {
    background: var(--bg);
    border: 1px solid var(--border-light);
    margin-right: 32px;
}
.thread-message-operator {
    background: var(--info-bg);
    border: 1px solid rgba(37, 99, 235, 0.12);
    margin-left: 32px;
}
.thread-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.thread-meta strong {
    color: var(--text);
    font-size: 12px;
}
.thread-content {
    color: var(--text-secondary);
}

.suggested-response-card {
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 8px;
}
.suggested-response-card:last-child { margin-bottom: 0; }
.suggested-response-card:hover {
    border-color: var(--info);
    background: var(--info-bg);
}

/* ===== MARKETING / CAMPAGNES ===== */
.canal-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}
.canal-instagram { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.canal-facebook { background: rgba(24, 119, 242, 0.1); color: #1877F2; }
.canal-newsletter { background: var(--success-bg); color: var(--success-text); }

.table-calendar td:first-child { font-weight: 600; white-space: nowrap; }
.table-calendar td:nth-child(3) { min-width: 260px; }

.table-marketing td:nth-child(n+4) { text-align: right; }
.table-marketing th:nth-child(n+4) { text-align: right; }

.segment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text);
}
.segment-item:last-child { border-bottom: none; }
.segment-item span.text-muted { font-size: 12px; color: var(--text-muted); }

.relance-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.relance-item:last-child { border-bottom: none; }
.relance-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 6px;
}
.relance-progress {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}
.relance-progress-bar {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
}

.campaign-step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--border);
    color: var(--text-muted);
    flex-shrink: 0;
}
.campaign-step-dot.active {
    background: var(--primary);
    color: var(--white);
}
.campaign-step-dot.done {
    background: var(--success);
    color: var(--white);
}

.cursor-pointer { cursor: pointer; }
.cursor-pointer:hover { background: var(--primary-light); }

/* ===== BASE DE CONNAISSANCES ===== */
.kb-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}
.kb-search-input::placeholder { color: rgba(255,255,255,0.5); }

.kb-article-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.kb-article-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(27,42,70,0.06);
}
.kb-article-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.kb-article-body { flex: 1; min-width: 0; }
.kb-article-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}
.kb-article-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-muted);
}
.kb-article-sep {
    width: 1px;
    height: 12px;
    background: var(--border);
    flex-shrink: 0;
}
.kb-article-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 6px;
}

.kb-cat-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.kb-cat-freins { background: var(--danger-bg); color: var(--danger-text); }
.kb-cat-moteur { background: var(--warning-bg); color: var(--warning-text); }
.kb-cat-electricite { background: #ede9fe; color: #5b21b6; }
.kb-cat-trains { background: var(--info-bg); color: var(--info-text); }
.kb-cat-carrosserie { background: var(--bg); color: var(--text-secondary); }
.kb-cat-processus { background: var(--success-bg); color: var(--success-text); }

.kb-vehicle-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.kb-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}
.kb-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.kb-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(27,42,70,0.06);
    color: var(--text-secondary);
}

.kb-cat-list { display: flex; flex-direction: column; }
.kb-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s;
}
.kb-cat-link:hover { background: var(--bg); color: var(--text); }
.kb-cat-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.kb-cat-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    padding: 1px 7px;
    border-radius: 4px;
}
.kb-type-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.kb-popular-list { display: flex; flex-direction: column; gap: 10px; }
.kb-popular-item { display: flex; align-items: center; gap: 10px; }
.kb-popular-rank {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    flex-shrink: 0;
}
.kb-popular-info { flex: 1; min-width: 0; }
.kb-popular-title { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
.kb-popular-views { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.kb-contrib-list { display: flex; flex-direction: column; gap: 14px; }
.kb-contrib-item { display: flex; align-items: center; gap: 10px; }
.kb-contrib-info { flex: 1; min-width: 0; }
.kb-contrib-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }

.kb-detail-section { margin-bottom: 20px; }
.kb-detail-section:last-child { margin-bottom: 0; }
.kb-detail-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.kb-detail-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.kb-detail-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.kb-related-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--info);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--info-bg);
    transition: background 0.12s;
}
.kb-related-link:hover { background: rgba(37,99,235,0.12); }

.kb-checkbox-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.kb-checkbox-chip:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.kb-checkbox-chip input { display: none; }

/* Form sections */
.kb-form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px dashed var(--border-light);
}
.kb-form-section:last-child { border-bottom: none; }
.kb-form-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

/* Pieces search */
.kb-pieces-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}
.kb-pieces-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 12px;
    color: var(--text);
}
.kb-pieces-search-input::placeholder { color: var(--text-muted); }

/* Pieces grid */
.kb-pieces-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.kb-piece-card {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
    background: var(--white);
}
.kb-piece-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.kb-piece-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.kb-piece-card input { display: none; }
.kb-piece-ref {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}
.kb-piece-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}
.kb-piece-vehicle {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ===== ARCHIVAGE / DOCUMENTS ===== */
.doc-folder-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.doc-folder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    text-align: center;
}
.doc-folder-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(27,42,70,0.08);
    transform: translateY(-2px);
}
.doc-folder-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 10px;
}
.doc-folder-name { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.doc-folder-count { font-size: 11px; color: var(--text-muted); }

.doc-folder-grid-small { grid-template-columns: repeat(4, 1fr); }
.doc-folder-grid-small .doc-folder-card { padding: 14px 12px; }
.doc-folder-grid-small .doc-folder-icon { width: 36px; height: 36px; border-radius: 8px; margin-bottom: 8px; }
.doc-folder-grid-small .doc-folder-icon .material-symbols-outlined { font-size: 18px !important; }
.doc-folder-grid-small .doc-folder-name { font-size: 11px; }
.doc-folder-grid-small .doc-folder-count { font-size: 10px; }

.doc-folder-new { position: relative; }
.doc-folder-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--danger-bg);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}
.doc-folder-new:hover .doc-folder-delete { opacity: 1; }

.doc-folder-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.doc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}
.doc-breadcrumb-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.15s;
}
.doc-breadcrumb-link:hover { opacity: 0.7; }
.doc-breadcrumb-current { color: var(--text); }

.btn-sm {
    padding: 5px 12px !important;
    font-size: 11px !important;
}

.doc-row-clickable { cursor: pointer; }
.doc-row-clickable:hover td { background: var(--bg); }

.doc-retention-list { display: flex; flex-direction: column; gap: 12px; }
.doc-retention-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.doc-retention-item:last-child { border-bottom: none; padding-bottom: 0; }
.doc-retention-info { flex: 1; }
.doc-retention-name { font-size: 12px; font-weight: 600; color: var(--text); }
.doc-retention-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.doc-storage-list { display: flex; flex-direction: column; gap: 8px; }
.doc-storage-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.doc-storage-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.doc-storage-label { flex: 1; color: var(--text-secondary); }
.doc-storage-size { font-weight: 600; color: var(--text); }

.doc-activity-list { display: flex; flex-direction: column; gap: 12px; }
.doc-activity-item { display: flex; align-items: center; gap: 10px; }
.doc-activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.doc-activity-text { font-size: 12px; font-weight: 500; color: var(--text); }
.doc-activity-time { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.doc-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.doc-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.doc-info-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.doc-info-value { font-size: 13px; font-weight: 500; color: var(--text); }

.doc-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}
.doc-dropzone:hover { border-color: var(--primary); background: var(--primary-light); }

/* ===== VOICE DICTATION (IA Magic) ===== */
.ia-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.voice-textarea-wrapper {
    position: relative;
}

.voice-overlay {
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.07);
    border: 2px solid #6366f1;
    border-radius: var(--radius);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    backdrop-filter: blur(2px);
}
.voice-overlay.active {
    display: flex;
}

.voice-wave-container {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 32px;
}

.voice-wave-bar {
    width: 4px;
    height: 8px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    animation: voiceWave 0.8s ease-in-out infinite alternate;
}
.voice-overlay:not(.active) .voice-wave-bar {
    animation: none;
}
.voice-wave-bar:nth-child(1) { animation-delay: 0s; height: 10px; }
.voice-wave-bar:nth-child(2) { animation-delay: 0.1s; height: 18px; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.2s; height: 26px; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.3s; height: 32px; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.2s; height: 26px; }
.voice-wave-bar:nth-child(6) { animation-delay: 0.1s; height: 18px; }
.voice-wave-bar:nth-child(7) { animation-delay: 0s; height: 10px; }

@keyframes voiceWave {
    0% { transform: scaleY(0.4); }
    100% { transform: scaleY(1); }
}

.voice-overlay-text {
    font-size: 11px;
    color: #6366f1;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-voice-dictation {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.06));
    border: 1.5px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-voice-dictation:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.btn-voice-dictation.recording {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    border-style: solid;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.voice-btn-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
}
.voice-btn-icon .material-symbols-outlined {
    font-size: 20px;
    z-index: 1;
}

.voice-pulse-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #6366f1;
    opacity: 0;
}
.btn-voice-dictation.recording .voice-pulse-ring {
    animation: voicePulse 1.5s ease-out infinite;
}

@keyframes voicePulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

.voice-btn-label {
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
}

.voice-btn-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: left;
    flex: 1;
}

/* IA Extraction bar */
.ia-extraction-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius);
    animation: iaBarPulse 2s ease-in-out infinite;
}
@keyframes iaBarPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.1); }
    50% { box-shadow: 0 0 12px 2px rgba(99, 102, 241, 0.15); }
}
.ia-extraction-icon {
    font-size: 18px;
    color: #6366f1;
    animation: iaSpin 1.5s linear infinite;
}
@keyframes iaSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.ia-extraction-text {
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    white-space: nowrap;
}
.ia-extraction-progress {
    flex: 1;
    height: 4px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 2px;
    overflow: hidden;
}
.ia-extraction-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* IA field filled animation */
.ia-field.ia-filling {
    animation: iaFieldFlash 0.5s ease;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}
.ia-field.ia-filled {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.1) !important;
    transition: border-color 0.8s, box-shadow 0.8s;
}
@keyframes iaFieldFlash {
    0% { background: #fff; }
    40% { background: rgba(99, 102, 241, 0.1); }
    100% { background: #fff; }
}

/* ======================================
   Campaign Preview (Email + Instagram)
   ====================================== */
.preview-tab-btn {
    font-size: 11px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.preview-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.preview-tab-btn:hover:not(.active) {
    background: var(--bg);
}

.preview-container {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

/* Email Preview */
.email-preview-frame {
    width: 380px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    background: var(--white);
}
.email-preview-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f1f1f1;
    border-bottom: 1px solid var(--border);
}
.email-toolbar-dots {
    display: flex;
    gap: 5px;
}
.email-toolbar-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: block;
}
.email-toolbar-bar {
    flex: 1;
    background: white;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 9px;
    color: #999;
    text-align: center;
}
.email-preview-content {
    padding: 16px 20px;
}
.email-product-card {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

/* Instagram Preview */
.insta-phone-frame {
    width: 320px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    border: 3px solid #1a1a1a;
    background: white;
    position: relative;
}
.insta-notch {
    width: 100px;
    height: 18px;
    background: #1a1a1a;
    border-radius: 0 0 14px 14px;
    margin: 0 auto;
}
.insta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #efefef;
}
.insta-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
}
.insta-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #2c3e50, #3498db, #2c3e50);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.insta-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.5));
}
.insta-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}
.insta-likes {
    padding: 0 12px 4px;
    font-size: 11px;
    color: #262626;
}
.insta-caption {
    padding: 0 12px 6px;
    font-size: 11px;
    color: #262626;
    line-height: 1.5;
}
.insta-caption strong {
    margin-right: 4px;
}
.insta-hashtags {
    padding: 0 12px 8px;
    font-size: 10px;
    color: #00376b;
    line-height: 1.4;
}

/* ======================================
   Live Toast Notifications
   ====================================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
    max-height: 80vh;
    overflow: hidden;
}
.toast-notif {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
    min-width: 320px;
    max-width: 380px;
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}
.toast-notif.toast-hiding {
    animation: toastSlideOut 0.3s ease forwards;
}
.toast-notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.toast-notif-icon.toast-order { background: var(--success-bg); color: var(--success); }
.toast-notif-icon.toast-stock { background: var(--warning-bg); color: var(--warning); }
.toast-notif-icon.toast-sync { background: var(--info-bg); color: var(--info); }
.toast-notif-icon.toast-client { background: #ede9fe; color: #7c3aed; }
.toast-notif-icon.toast-payment { background: var(--success-bg); color: var(--success); }
.toast-notif-icon.toast-alert { background: var(--danger-bg); color: var(--danger); }

.toast-notif-body {
    flex: 1;
    min-width: 0;
}
.toast-notif-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.toast-notif-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.3;
}
.toast-notif-time {
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-top: 2px;
    flex-shrink: 0;
}
.toast-notif-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}
.toast-notif:hover .toast-notif-close {
    opacity: 1;
}
.toast-notif-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 0 10px;
    animation: toastProgress 6s linear forwards;
}
@keyframes toastSlideIn {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

