/* ============================================
   SmartDuck Dashboard Marketing - Styles
   Mobile-first, SmartDuck branding
   v2 - UI/UX improvements
   ============================================ */

/* Reset minimal pour page standalone */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f1f5f9;
    color: #1f2937;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================
   LOGIN
   ============================ */

.sd-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1rem;
    background: linear-gradient(135deg, #fff7ed 0%, #fdf2f8 50%, #eff6ff 100%);
}

.sd-login[hidden] {
    display: none;
}

.sd-login-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    text-align: center;
}

.sd-login-logo {
    margin-bottom: 1.5rem;
}

.sd-login-logo img {
    max-width: 180px;
    height: auto;
}

.sd-login-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sd-login-card p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

#sd-login-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
}

#sd-login-form input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255, 126, 4, 0.1);
}

#sd-login-form button {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

#sd-login-form button:hover {
    opacity: 0.92;
}

#sd-login-form button:active {
    transform: scale(0.98);
}

.sd-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ============================
   DASHBOARD LAYOUT
   ============================ */

.sd-dashboard {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 0.75rem 3rem;
}

/* Header */
.sd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    background: #f1f5f9;
}

.sd-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sd-header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sd-badge {
    background: linear-gradient(135deg, #ff7e04 0%, #da1984 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.sd-btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.sd-btn-primary:hover {
    opacity: 0.9;
}

.sd-btn-primary:active {
    transform: scale(0.97);
}

.sd-btn-ghost {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sd-btn-ghost:hover {
    background: #f9fafb;
    color: #1f2937;
    border-color: #d1d5db;
}

/* ============================
   FILTERS
   ============================ */

.sd-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 100px; /* header 52px + mode switcher ~48px */
    z-index: 40;
    transition: box-shadow 0.2s, border-radius 0.2s;
}

.sd-filters.sd-filters--stuck {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
    border-radius: 0 0 14px 14px;
}

/* Sentinel element for IntersectionObserver */
.sd-filters-sentinel {
    height: 1px;
    margin-bottom: 1rem;
}

/* Filter chips */
.sd-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0;
    min-height: 0;
}

.sd-filter-chips:empty {
    display: none;
}

.sd-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9a3412;
    cursor: pointer;
    transition: all 0.15s;
}

.sd-filter-chip:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

.sd-filter-chip-x {
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0.6;
}

.sd-filter-chip:hover .sd-filter-chip-x {
    opacity: 1;
}

.sd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 130px;
}

.sd-filter-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sd-filter-group select {
    padding: 0.45rem 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.82rem;
    background: #f9fafb;
    color: #374151;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.sd-filter-group select:focus {
    border-color: var(--orange);
    background: white;
}

/* sd-filter-actions removed — filters auto-apply */

/* ============================
   MODE SWITCHER
   ============================ */

.sd-mode-switcher {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    background: white;
    border-radius: 14px;
    padding: 0.35rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 52px;
    z-index: 45;
}

.sd-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    font-size: 0.92rem;
    font-weight: 700;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.25s ease;
    text-align: center;
    min-height: 48px;
}

.sd-mode-btn:hover {
    color: #4b5563;
    background: #f9fafb;
}

.sd-mode-btn.active {
    color: white;
    background: var(--primary-gradient);
    box-shadow: 0 4px 14px rgba(255, 126, 4, 0.35);
}

.sd-mode-btn svg {
    flex-shrink: 0;
}

.sd-mode-content {
    display: none;
}

.sd-mode-content.active {
    display: block;
    animation: sd-fadeIn 0.3s ease;
}

/* ============================
   SECTION NAV (floating)
   ============================ */

.sd-section-nav {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 12px;
    padding: 0.3rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 148px; /* header + mode switcher + filters */
    z-index: 35;
}

.sd-section-nav-link {
    flex: 1;
    padding: 0.5rem 0.5rem;
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.sd-section-nav-link:hover {
    color: #4b5563;
    background: #f9fafb;
}

.sd-section-nav-link.active {
    color: white;
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(255, 126, 4, 0.3);
}

/* Mobile: filters non-sticky, section nav sits below mode switcher */
@media (max-width: 767px) {
    .sd-filters {
        position: static;
    }
    .sd-section-nav {
        top: 113px; /* header 76px stacked, mode switcher ends at ~113px */
        z-index: 40;
    }
}

/* ============================
   SECTIONS (scrollable)
   ============================ */

.sd-section {
    margin-bottom: 1.5rem;
    scroll-margin-top: 200px;
}

@media (max-width: 767px) {
    .sd-section {
        scroll-margin-top: 185px;
    }
}

.sd-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e5e7eb;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.sd-section-header:hover {
    background: #fafbfc;
}

.sd-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.sd-section-subtitle {
    font-size: 0.78rem;
    color: #9ca3af;
    flex: 1;
}

.sd-section-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    color: #9ca3af;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
}

.sd-section.sd-section--collapsed .sd-section-toggle {
    transform: rotate(-90deg);
}

.sd-section.sd-section--collapsed .sd-section-body {
    display: none;
}

@keyframes sd-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================
   KPI CARDS
   ============================ */

.sd-kpi-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.sd-kpi-card {
    background: white;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
    overflow: hidden;
}

.sd-kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 14px 0 0 14px;
}

.sd-kpi-card:nth-child(1)::before { background: #2563eb; }
.sd-kpi-card:nth-child(2)::before { background: #16a34a; }
.sd-kpi-card:nth-child(3)::before { background: #ff7e04; }
.sd-kpi-card:nth-child(4)::before { background: #dc2626; }

.sd-kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
}

.sd-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sd-kpi-icon svg {
    width: 20px;
    height: 20px;
}

.sd-kpi-blue {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

.sd-kpi-green {
    background: rgba(22, 163, 74, 0.08);
    color: #16a34a;
}

.sd-kpi-orange {
    background: rgba(255, 126, 4, 0.08);
    color: #ff7e04;
}

.sd-kpi-red {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

.sd-kpi-pink {
    background: rgba(218, 25, 132, 0.08);
    color: #da1984;
}

.sd-kpi-data {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sd-kpi-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.sd-kpi-label {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sd-kpi-change {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.sd-change-up {
    background: #dcfce7;
    color: #166534;
}

.sd-change-down {
    background: #fecaca;
    color: #991b1b;
}

.sd-kpi-sublabel {
    position: absolute;
    top: 0.85rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: #d1d5db;
    font-weight: 600;
}

/* ============================
   CHART CARDS
   ============================ */

.sd-chart-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.sd-chart-card {
    background: white;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.15s;
}

.sd-chart-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
}

.sd-chart-card h3 {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sd-chart-card h3::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--primary-gradient);
    flex-shrink: 0;
}

.sd-chart-card canvas {
    width: 100% !important;
    height: 220px !important;
}

.sd-chart-wide canvas {
    height: 200px !important;
}

/* ============================
   TABLES
   ============================ */

.sd-table-section {
    background: white;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    margin-bottom: 0.6rem;
}

.sd-table-section > h3 {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sd-table-section > h3::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--primary-gradient);
    flex-shrink: 0;
}

.sd-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sd-table-header h3 {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sd-table-header h3::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--primary-gradient);
    flex-shrink: 0;
}

.sd-table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sd-search-input {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.8rem;
    outline: none;
    width: 180px;
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s;
}

.sd-search-input:focus {
    border-color: var(--orange);
    background: white;
}

.sd-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
}

.sd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.sd-table thead th {
    background: #f8fafc;
    padding: 0.55rem 0.7rem;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sd-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    text-align: right;
}

.sd-sortable:hover {
    color: #374151;
}

.sd-sortable::after {
    content: ' \2195';
    opacity: 0.3;
}

.sd-sortable.active::after {
    content: ' \2193';
    opacity: 1;
    color: var(--orange);
}

.sd-sortable.active.asc::after {
    content: ' \2191';
}

.sd-table tbody td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.sd-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.sd-table tbody tr:hover {
    background: #fff7ed;
}

.sd-table tbody tr {
    transition: background 0.1s;
}

.sd-cell-date {
    white-space: nowrap;
    font-size: 0.72rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.sd-cell-name {
    font-weight: 600;
    color: #111827;
}

.sd-cell-centre {
    white-space: nowrap;
    font-size: 0.75rem;
}

.sd-cell-phone a {
    color: #2563eb;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.sd-cell-phone a:hover {
    text-decoration: underline;
}

.sd-cell-email {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    color: #6b7280;
}

.sd-cell-source {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    color: #6b7280;
}

.sd-cell-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.sd-conv-high {
    color: #16a34a;
    font-weight: 600;
}

.sd-conv-low {
    color: #ff7e04;
}

.sd-cell-url {
    max-width: 280px;
}

.sd-page-title {
    display: block;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
}

.sd-page-url {
    display: block;
    font-size: 0.68rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-empty {
    text-align: center;
    color: #9ca3af;
    padding: 2.5rem 1rem !important;
    font-size: 0.85rem;
}

/* Badges */
.sd-badge-method {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.sd-method-telephone {
    background: #dbeafe;
    color: #1e40af;
}

.sd-method-email {
    background: #ffedd5;
    color: #9a3412;
}

.sd-method-sms {
    background: #dcfce7;
    color: #166534;
}

.sd-quality-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
}

.sd-quality-0 { background: var(--color-danger-bg); color: var(--color-danger-text); }
.sd-quality-1 { background: #fed7aa; color: #9a3412; }
.sd-quality-2 { background: var(--color-warning-bg); color: var(--color-warning-text); }
.sd-quality-3 { background: var(--color-success-bg); color: var(--color-success-text); }
.sd-quality-4 { background: #86efac; color: var(--color-success-text); }

/* Pagination */
.sd-pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    padding-top: 0.75rem;
}

.sd-page-btn {
    padding: 0.3rem 0.6rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
    font-variant-numeric: tabular-nums;
}

.sd-page-btn:hover:not(:disabled):not(.active) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.sd-page-btn.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
    box-shadow: 0 2px 6px rgba(255, 126, 4, 0.3);
}

.sd-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ============================
   JOURNEYS
   ============================ */

.sd-journeys {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sd-journey-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.78rem;
    border: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.sd-journey-item:hover {
    background: #f1f5f9;
}

.sd-journey-rank {
    font-weight: 700;
    color: var(--orange);
    font-size: 0.82rem;
    min-width: 24px;
}

.sd-journey-path {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.sd-journey-step {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
    font-size: 0.7rem;
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #374151;
}

.sd-journey-arrow {
    color: #d1d5db;
    font-size: 0.65rem;
}

.sd-journey-count {
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

/* ============================
   LOADING
   ============================ */

.sd-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(241, 245, 249, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.sd-loading[hidden] {
    display: none;
}

.sd-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 126, 4, 0.15);
    border-top: 3px solid var(--orange);
    border-radius: 50%;
    animation: sd-spin 0.7s linear infinite;
}

@keyframes sd-spin {
    to { transform: rotate(360deg); }
}

/* ============================
   MOBILE CARDS (leads + campaigns)
   ============================ */

.sd-lead-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sd-lead-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.sd-lead-card-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
}

.sd-lead-card-info {
    flex: 1;
    min-width: 0;
}

.sd-lead-card-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-lead-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 0.1rem;
}

.sd-lead-card-phone a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}

.sd-lead-card-details {
    border-top: 1px solid #f3f4f6;
    padding: 0.6rem 0.85rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.sd-lead-card-details summary {
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sd-lead-card-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.sd-lead-card-detail-grid dt {
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.sd-lead-card-detail-grid dd {
    color: #374151;
    margin: 0;
}

/* Mobile: show cards, hide tables */
.sd-mobile-only { display: block; }
.sd-table-desktop-only { display: none; }

/* Section error */
.sd-section-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
}

.sd-section-error-icon {
    font-size: 1.5rem;
}

.sd-section-error .sd-btn-ghost {
    font-size: 0.78rem;
}

/* Skeleton loading */
.sd-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: sd-shimmer 1.5s infinite;
    border-radius: 8px;
}

.sd-skeleton-kpi {
    height: 80px;
}

.sd-skeleton-chart {
    height: 220px;
}

@keyframes sd-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================
   RESPONSIVE: MOBILE+ (480+)
   ============================ */

@media (min-width: 480px) {
    .sd-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================
   RESPONSIVE: TABLET (768+)
   ============================ */

@media (min-width: 768px) {
    .sd-dashboard {
        padding: 0 1.5rem 3rem;
    }

    .sd-kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .sd-chart-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .sd-chart-wide {
        grid-column: 1 / -1;
    }

    .sd-chart-card canvas {
        height: 260px !important;
    }

    .sd-chart-wide canvas {
        height: 230px !important;
    }

    /* Tablet+: show tables, hide mobile cards */
    .sd-mobile-only { display: none !important; }
    .sd-table-desktop-only { display: block; }
}

/* ============================
   RESPONSIVE: DESKTOP (1024+)
   ============================ */

@media (min-width: 1024px) {
    .sd-dashboard {
        padding: 0 2rem 3rem;
    }

    .sd-kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .sd-header h1 {
        font-size: 1.6rem;
    }

    .sd-filters {
        flex-wrap: nowrap;
    }

    .sd-chart-card canvas {
        height: 280px !important;
    }

    .sd-chart-wide canvas {
        height: 240px !important;
    }
}

/* ============================
   CONTENT TAB — Centres list
   ============================ */

.sd-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.sd-content-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.sd-content-toolbar {
    margin-bottom: 0.75rem;
}

.sd-content-toolbar .sd-search-input {
    width: 100%;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
}

/* Status badges */
.sd-status {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.sd-status-published {
    background: #dcfce7;
    color: #166534;
}

.sd-status-draft {
    background: #fef9c3;
    color: #854d0e;
}

/* Progress bar */
.sd-progress-bar {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
}

.sd-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.sd-progress-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    margin-left: 0.35rem;
    font-variant-numeric: tabular-nums;
}

/* Action buttons */
.sd-action-btns {
    display: flex;
    gap: 0.3rem;
}

.sd-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.sd-btn-icon:hover {
    background: #f9fafb;
    color: #1f2937;
    border-color: #d1d5db;
}

.sd-btn-icon svg {
    width: 15px;
    height: 15px;
}

.sd-action-publish:hover {
    color: #166534;
    border-color: #86efac;
    background: #f0fdf4;
}

.sd-action-unpublish:hover {
    color: #854d0e;
    border-color: #fde68a;
    background: #fefce8;
}

.sd-action-edit:hover {
    color: #1e40af;
    border-color: #93c5fd;
    background: #eff6ff;
}

.sd-action-duplicate:hover {
    color: #7c3aed;
    border-color: #c4b5fd;
    background: #f5f3ff;
}

/* Centre link in table */
.sd-centre-link {
    color: #1f2937;
    text-decoration: none;
    font-weight: 600;
}

.sd-centre-link:hover {
    color: var(--orange);
}

/* Table cell for actions */
.sd-cell-actions {
    white-space: nowrap;
}

/* Centres loading */
.sd-centres-loading {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.sd-centres-loading[hidden] {
    display: none;
}

/* ---- Mobile: cards visible, table hidden ---- */
.sd-centres-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sd-centres-table-section {
    display: none;
}

.sd-centre-card {
    background: white;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.sd-centre-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sd-centre-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sd-centre-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-centre-card-city {
    font-size: 0.78rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.sd-centre-card-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sd-centre-card-progress .sd-progress-bar {
    flex: 1;
    width: auto;
}

.sd-centre-card-date {
    font-size: 0.68rem;
    color: #9ca3af;
    white-space: nowrap;
}

.sd-centre-card-actions {
    display: flex;
    gap: 0.35rem;
}

.sd-centre-card-actions .sd-btn-icon {
    width: 40px;
    height: 40px;
    flex: 1;
}

/* New centre button sticky on mobile */
#sd-new-centre {
    white-space: nowrap;
}

@media (max-width: 767px) {
    .sd-content-header {
        position: sticky;
        top: 52px; /* below the sticky header */
        z-index: 40;
        background: #f1f5f9;
        padding: 0.5rem 0;
    }
}

/* ---- Tablet+ : table visible, cards hidden ---- */
@media (min-width: 768px) {
    .sd-centres-table-section {
        display: block;
    }

    .sd-centres-cards {
        display: none !important;
    }

    .sd-content-toolbar .sd-search-input {
        width: 280px;
    }
}

/* ============================
   CONTENT: VIEW SYSTEM
   ============================ */

.sd-view {
    display: none;
}

.sd-view.active {
    display: block;
    animation: sd-fadeIn 0.3s ease;
}

/* Top bar (back + action buttons) */
.sd-view-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.sd-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.sd-btn-back:hover {
    background: #f9fafb;
    color: #1f2937;
    border-color: #d1d5db;
}

.sd-btn-back svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.sd-btn-lg {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
}

/* ============================
   CONTENT: CREATE CENTRE
   ============================ */

.sd-create-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.sd-create-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.sd-create-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

.sd-create-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.sd-create-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.sd-create-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.sd-create-option-active,
.sd-create-option:has(input:checked) {
    border-color: var(--orange);
    background: #fff7ed;
}

.sd-create-option input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--orange);
    flex-shrink: 0;
}

.sd-create-option-content {
    display: flex;
    flex-direction: column;
}

.sd-create-option-content strong {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
}

.sd-create-option-content span {
    font-size: 0.78rem;
    color: #6b7280;
}

.sd-create-duplicate-select {
    margin-bottom: 1rem;
}

.sd-create-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Form elements (shared) */
.sd-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sd-form-group[hidden] {
    display: none !important;
}

.sd-form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
}

.sd-required {
    color: #dc2626;
}

.sd-form-input,
.sd-form-select {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1f2937;
    background: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.sd-form-input:focus,
.sd-form-select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 126, 4, 0.1);
}

.sd-form-input.sd-input-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.sd-form-input.sd-input-valid {
    border-color: #16a34a;
}

.sd-form-error {
    color: #dc2626;
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

.sd-form-hint {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

.sd-form-field-error {
    font-size: 0.72rem;
    color: #dc2626;
    margin-top: 0.15rem;
}

/* ============================
   CONTENT: FICHE CENTRE
   ============================ */

.sd-fiche-header {
    background: white;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    margin-bottom: 1rem;
}

.sd-fiche-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.sd-fiche-title-row h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
}

.sd-fiche-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-bottom: 0.65rem;
}

.sd-fiche-completion {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sd-fiche-progress-bar {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.sd-fiche-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease, background 0.3s;
    background: #ea580c;
}

.sd-fiche-progress-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    min-width: 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Sections grid */
.sd-sections-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.sd-section-card {
    background: white;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-left: 4px solid #e5e7eb;
    min-height: 72px;
}

.sd-section-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
}

.sd-section-card:active {
    transform: scale(0.99);
}

/* Section states */
.sd-section-card.sd-section-empty {
    border-left-color: #d1d5db;
}

.sd-section-card.sd-section-complete {
    border-left-color: #16a34a;
}

.sd-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f3f4f6;
    color: #9ca3af;
}

.sd-section-complete .sd-section-icon {
    background: #dcfce7;
    color: #16a34a;
}

.sd-section-icon svg {
    width: 20px;
    height: 20px;
}

.sd-section-info {
    flex: 1;
    min-width: 0;
}

.sd-section-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2937;
}

.sd-section-hint {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}

.sd-section-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sd-section-empty .sd-section-badge {
    background: #f3f4f6;
    color: #9ca3af;
}

.sd-section-complete .sd-section-badge {
    background: #dcfce7;
    color: #166534;
}

.sd-section-unavailable {
    opacity: 0.55;
    cursor: default;
}

.sd-section-unavailable:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
}

/* ============================
   CONTENT: SECTION FORM (Identite)
   ============================ */

.sd-section-form-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    max-width: 560px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.sd-section-form-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.sd-section-form-subtitle {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

.sd-section-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.sd-section-form-actions {
    display: flex;
    gap: 0.6rem;
}

.sd-section-form-actions .sd-btn-primary {
    flex: 1;
}

/* Breadcrumb */
.sd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #9ca3af;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
}

.sd-breadcrumb-item {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-breadcrumb-sep {
    color: #d1d5db;
    flex-shrink: 0;
}

.sd-breadcrumb-link {
    color: #6b7280;
    cursor: pointer;
    transition: color 0.15s;
}

.sd-breadcrumb-link:hover {
    color: var(--orange);
}

.sd-breadcrumb-current {
    color: #1f2937;
    font-weight: 600;
}

@media (max-width: 480px) {
    .sd-breadcrumb {
        font-size: 0.7rem;
    }
}

/* Toast notification */
.sd-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #111827;
    color: white;
    padding: 0.65rem 1.2rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.sd-toast.sd-toast-visible {
    transform: translateX(-50%) translateY(0);
}

.sd-toast-success {
    background: #166534;
}

.sd-toast-error {
    background: #991b1b;
}

/* ============================
   CONTENT: RESPONSIVE
   ============================ */

@media (min-width: 480px) {
    .sd-sections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .sd-view-topbar {
        position: sticky;
        top: 52px;
        z-index: 40;
        background: #f1f5f9;
        padding: 0.5rem 0;
    }

    .sd-section-card {
        min-height: 64px;
    }

    .sd-btn-back,
    .sd-view-topbar .sd-btn-primary {
        min-height: 44px;
    }

    .sd-section-form-actions .sd-btn-primary {
        min-height: 48px;
        font-size: 0.92rem;
    }
}

@media (min-width: 768px) {
    .sd-sections-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .sd-create-card {
        padding: 2rem 2rem;
    }

    .sd-section-form-card {
        padding: 2rem 2rem;
    }
}

@media (min-width: 1024px) {
    .sd-sections-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================
   CONTENT: TARIFS FORM (Story 9.4)
   ============================ */

.sd-tarifs-card {
    max-width: 640px;
}

/* Mode selector */
.sd-tarifs-modes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.sd-tarifs-mode {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.sd-tarifs-mode:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.sd-tarifs-mode-active,
.sd-tarifs-mode:has(input:checked) {
    border-color: var(--orange);
    background: #fff7ed;
}

.sd-tarifs-mode input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--orange);
    flex-shrink: 0;
}

.sd-tarifs-mode-content {
    display: flex;
    flex-direction: column;
}

.sd-tarifs-mode-content strong {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
}

.sd-tarifs-mode-content span {
    font-size: 0.78rem;
    color: #6b7280;
}

/* Standard preview */
.sd-tarifs-preview {
    text-align: center;
    padding: 1.5rem 1rem;
    border: 2px dashed #d1fae5;
    border-radius: 12px;
    background: #f0fdf4;
    margin-bottom: 1rem;
}

.sd-tarifs-preview-icon {
    margin-bottom: 0.5rem;
}

.sd-tarifs-preview-text {
    font-size: 0.88rem;
    color: #166534;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.sd-tarifs-preview-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.78rem;
    color: #6b7280;
}

/* Tabs */
.sd-tarifs-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0.2rem;
}

.sd-tarifs-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.sd-tarifs-tab.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Zone accordion */
.sd-tarifs-zone {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.sd-tarifs-zone-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: #f9fafb;
    cursor: pointer;
    user-select: none;
    min-height: 44px;
}

.sd-tarifs-zone-header:hover {
    background: #f3f4f6;
}

.sd-tarifs-zone-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

.sd-tarifs-zone-tag {
    font-size: 0.68rem;
    color: #6b7280;
    background: #e5e7eb;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
}

.sd-tarifs-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
    color: #9ca3af;
}

.sd-tarifs-zone-open .sd-tarifs-chevron {
    transform: rotate(180deg);
}

.sd-tarifs-zone-body {
    display: none;
    padding: 0.5rem 0.85rem 0.75rem;
}

.sd-tarifs-zone-open .sd-tarifs-zone-body {
    display: block;
}

/* Offre */
.sd-tarifs-offre {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.sd-tarifs-offre:last-child {
    border-bottom: none;
}

.sd-tarifs-offre-header {
    margin-bottom: 0.25rem;
}

.sd-tarifs-offre-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #374151;
}

.sd-tarifs-price-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sd-tarifs-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: #111827;
}

.sd-tarifs-precision {
    font-size: 0.72rem;
    color: #9ca3af;
}

.sd-tarifs-price-modified {
    color: var(--orange);
}

.sd-tarifs-edit-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    color: #9ca3af;
    transition: all 0.15s;
}

.sd-tarifs-edit-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: #fff7ed;
}

.sd-tarifs-reset-btn {
    font-size: 0.68rem;
    color: #6b7280;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    transition: all 0.15s;
}

.sd-tarifs-reset-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
}

/* Inline edit */
.sd-tarifs-edit-inline {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.sd-tarifs-inline-input {
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
    width: auto;
    min-width: 80px;
    max-width: 120px;
}

.sd-tarifs-edit-forfait .sd-tarifs-inline-input {
    max-width: 100px;
}

.sd-tarifs-inline-ok,
.sd-tarifs-inline-cancel {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
}

.sd-tarifs-inline-ok:hover {
    background: #f0fdf4;
    border-color: #16a34a;
}

.sd-tarifs-inline-cancel:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* Forfaits */
.sd-tarifs-forfaits {
    margin-top: 0.35rem;
    padding-left: 0.5rem;
    border-left: 2px solid #f3f4f6;
}

.sd-tarifs-forfait {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.78rem;
}

.sd-tarifs-forfait-seance {
    color: #6b7280;
    min-width: 60px;
}

.sd-tarifs-forfait-prix {
    color: #374151;
    font-weight: 500;
}

.sd-tarifs-forfait-total {
    color: #111827;
    font-weight: 600;
}

/* Add/Remove buttons */
.sd-tarifs-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.75rem;
    background: white;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 0.5rem;
}

.sd-tarifs-add-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: #fff7ed;
}

.sd-tarifs-remove-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.2rem;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    transition: all 0.15s;
}

.sd-tarifs-remove-btn:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

/* Custom mode zones */
.sd-tarifs-zone-custom {
    overflow: visible;
}

.sd-tarifs-custom-zone-header {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    background: #f9fafb;
    align-items: flex-start;
}

.sd-tarifs-custom-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sd-tarifs-custom-offres {
    padding: 0.75rem 0.85rem;
}

.sd-tarifs-custom-offre {
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 0.65rem;
    margin-bottom: 0.5rem;
    background: white;
}

.sd-tarifs-custom-offre-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sd-tarifs-custom-offre-num {
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sd-tarifs-custom-offre-fields {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sd-tarifs-custom-row {
    display: flex;
    gap: 0.4rem;
}

.sd-tarifs-custom-row .sd-form-input {
    flex: 1;
}

.sd-tarifs-custom-forfaits {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.sd-tarifs-custom-forfaits-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.35rem;
}

.sd-tarifs-custom-forfait {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.sd-tarifs-custom-forfait .sd-tarifs-custom-row {
    flex: 1;
}

.sd-tarifs-custom-forfait .sd-form-input {
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
}

.sd-tarifs-add-forfait {
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
}

/* Promotions */
.sd-tarifs-promos {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

.sd-tarifs-promos-toggle {
    margin-bottom: 0.75rem;
}

.sd-tarifs-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.sd-tarifs-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--orange);
}

.sd-tarifs-promos-content {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sd-tarifs-promo-item {
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sd-tarifs-promo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
}

.sd-tarifs-empty {
    text-align: center;
    padding: 1rem;
    color: #9ca3af;
    font-size: 0.82rem;
}

/* Tarifs mobile responsive */
@media (max-width: 767px) {
    .sd-tarifs-custom-row {
        flex-direction: column;
    }

    .sd-tarifs-forfait {
        flex-wrap: wrap;
    }

    .sd-tarifs-inline-input {
        min-width: 60px;
    }

    #sd-tarifs-save {
        min-height: 48px;
        font-size: 0.92rem;
    }

    .sd-tarifs-edit-btn,
    .sd-tarifs-inline-ok,
    .sd-tarifs-inline-cancel,
    .sd-tarifs-remove-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .sd-tarifs-add-btn {
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }
}

/* ============================
   HORAIRES FORM
   ============================ */

.sd-horaires-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sd-horaires-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #f9fafb;
    transition: opacity 0.15s;
}

.sd-horaires-row.sd-horaires-closed {
    opacity: 0.5;
}

.sd-horaires-day {
    min-width: 80px;
    font-weight: 600;
    font-size: 0.875rem;
}

.sd-horaires-sep {
    color: #9ca3af;
}

.sd-form-select {
    padding: 0.375rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    min-width: 80px;
}

.sd-form-select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
}

.sd-horaires-ferme-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}

.sd-form-textarea {
    resize: vertical;
    min-height: 3rem;
}

/* ============================
   FORM SECTION LABEL (shared)
   ============================ */

.sd-form-section-label {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* ============================
   TRANSPORTS FORM
   ============================ */

.sd-transport-block {
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.sd-transport-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sd-transport-header .sd-form-select {
    flex: 0 0 auto;
}

.sd-transport-header .sd-form-input {
    flex: 1;
}

.sd-transport-locs {
    font-size: 0.875rem;
}

/* ============================
   SERVICES DISPONIBLES
   ============================ */

.sd-serv-dispo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.sd-serv-dispo-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.15s;
}

.sd-serv-dispo-item:hover {
    background: #f3f4f6;
}

.sd-serv-dispo-item input[type="checkbox"] {
    flex-shrink: 0;
}

/* ============================
   SERVICES FORM
   ============================ */

.sd-service-block {
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.sd-service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sd-service-num {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #4b5563;
}

.sd-service-block .sd-form-input {
    margin-bottom: 0.5rem;
}

/* ============================
   EQUIPE FORM
   ============================ */

.sd-membre-block {
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.sd-membre-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sd-membre-num {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #4b5563;
}

.sd-membre-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ============================
   RESPONSIVE: NEW FORMS
   ============================ */

@media (max-width: 600px) {
    .sd-horaires-row {
        flex-wrap: wrap;
    }

    .sd-horaires-day {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .sd-horaires-ferme-label {
        margin-left: 0;
    }

    .sd-serv-dispo-grid {
        grid-template-columns: 1fr;
    }

    .sd-transport-header {
        flex-wrap: wrap;
    }

    .sd-transport-header .sd-form-input {
        flex: 1 1 100%;
    }
}

/* ============================
   PRINT
   ============================ */

@media print {
    .sd-header-right,
    .sd-filters,
    .sd-tabs,
    .sd-btn-ghost,
    .sd-btn-primary,
    .sd-pagination,
    .sd-search-input {
        display: none !important;
    }

    .sd-tab-content {
        display: block !important;
    }

    body {
        background: white;
    }

    .sd-kpi-card,
    .sd-chart-card,
    .sd-table-section {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        break-inside: avoid;
    }
}

/* ============================
   MODAL (Story 9.7)
   ============================ */
.sd-modal-overlay[hidden] {
    display: none !important;
}

.sd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.sd-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.sd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sd-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.sd-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.sd-modal-close:hover {
    color: #111827;
}

.sd-modal-body {
    padding: 1.5rem;
}

.sd-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Duplication banner (Story 9.7) */
.sd-dup-banner {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #92400e;
}

.sd-dup-banner svg {
    flex-shrink: 0;
}

/* Section card "a completer" state (yellow) */
.sd-section-card.sd-section-warning {
    border-color: #fbbf24;
    background: #fffbeb;
}

.sd-section-card.sd-section-warning .sd-section-badge {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 768px) {
    .sd-modal {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 85vh;
        align-self: flex-end;
    }

    .sd-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
}

/* ============================
   GALLERY (Story 9.8)
   ============================ */
.sd-gallery-container {
    margin-bottom: 1rem;
}

.sd-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.sd-gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    cursor: grab;
    transition: border-color 0.15s, opacity 0.15s;
}

.sd-gallery-item:hover {
    border-color: var(--primary, #6366f1);
}

.sd-gallery-item.sd-gallery-dragging {
    opacity: 0.4;
}

.sd-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sd-gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    font-size: 0.75rem;
    color: #6b7280;
}

.sd-gallery-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.sd-gallery-item:hover .sd-gallery-remove {
    opacity: 1;
}

.sd-gallery-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
}

.sd-gallery-dropzone:hover,
.sd-gallery-dropzone.sd-gallery-dragover {
    border-color: var(--primary, #6366f1);
    background: #f5f3ff;
    color: var(--primary, #6366f1);
}

.sd-gallery-hint {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Photo upload member */
.sd-member-photo-zone {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px dashed #d1d5db;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.sd-member-photo-zone:hover {
    border-color: var(--primary, #6366f1);
}

.sd-member-photo-zone img,
.sd-member-photo-zone svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.sd-member-photo-zone svg {
    width: auto;
    height: auto;
    color: #9ca3af;
}

.sd-membre-body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.sd-membre-body .sd-membre-fields {
    flex: 1;
    min-width: 0;
}

@media (max-width: 480px) {
    .sd-membre-body {
        flex-direction: column;
        align-items: center;
    }
}

/* Autosave indicator */
.sd-autosave-indicator {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    transition: opacity 0.3s;
}

.sd-autosave-saving {
    color: #6b7280;
}

.sd-autosave-saved {
    color: #16a34a;
}

.sd-autosave-error {
    color: #dc2626;
}

/* Recovery banner */
.sd-recovery-banner {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #1e40af;
}

.sd-recovery-banner .sd-recovery-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sd-recovery-banner button {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    border: 1px solid #3b82f6;
    cursor: pointer;
}

.sd-recovery-restore {
    background: #3b82f6;
    color: #fff;
}

.sd-recovery-ignore {
    background: transparent;
    color: #3b82f6;
}

/* ============================
   POLISH MOBILE (Story 9.8)
   ============================ */
@media (max-width: 768px) {
    /* Content header sticky */
    .sd-content-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: #fff;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e5e7eb;
    }

    /* Full-width form inputs */
    .sd-section-form-card .sd-form-input,
    .sd-section-form-card .sd-form-select,
    .sd-section-form-card .sd-form-textarea {
        width: 100%;
    }

    /* Minimum touch targets */
    .sd-btn-primary,
    .sd-btn-ghost,
    .sd-section-form-actions button {
        min-height: 44px;
        font-size: 0.9375rem;
    }

    .sd-btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    /* Cards full width */
    .sd-sections-grid {
        grid-template-columns: 1fr !important;
    }

    .sd-section-card {
        min-height: 64px;
    }

    /* Horaires scroll */
    .sd-horaires-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sd-horaires-row {
        min-width: 320px;
    }

    /* Gallery grid smaller */
    .sd-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    /* Gallery remove always visible on touch */
    .sd-gallery-remove {
        opacity: 1;
    }

    /* Recovery banner responsive */
    .sd-recovery-banner {
        flex-direction: column;
        text-align: center;
    }

    /* Duplication banner responsive */
    .sd-dup-banner {
        font-size: 0.8125rem;
    }

    /* View topbar sticky */
    .sd-view-topbar {
        position: sticky;
        top: 0;
        z-index: 10;
        background: #fff;
        padding: 0.5rem 0;
    }
}

@media (max-width: 375px) {
    .sd-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .sd-horaires-day {
        min-width: 60px;
        font-size: 0.8125rem;
    }

    .sd-form-select {
        min-width: 60px;
        font-size: 0.8125rem;
    }

    .sd-create-card {
        padding: 1rem;
    }

    .sd-section-form-card {
        padding: 1rem;
    }
}

/* ============================
   CENTRE PHOTO UPLOAD (Bug 4)
   ============================ */

.sd-centre-photo-zone {
    width: 160px;
    height: 100px;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
    background: #f9fafb;
}

.sd-centre-photo-zone:hover {
    border-color: var(--orange);
}

.sd-centre-photo-zone img,
.sd-centre-photo-zone svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.sd-centre-photo-zone svg {
    width: auto;
    height: auto;
    color: #9ca3af;
}

/* ============================
   HORAIRES PAUSE MIDI (Bug 5)
   ============================ */

.sd-horaires-slots {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.sd-horaires-slot {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sd-horaires-slot[hidden] {
    display: none;
}

.sd-horaires-toggles {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.sd-horaires-pause-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
    white-space: nowrap;
}

/* ============================
   SPECIALITES TAGS (Bug 3)
   ============================ */

.sd-spec-section {
    margin-top: 0.25rem;
}

.sd-spec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    min-height: 1.5rem;
}

.sd-spec-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9a3412;
}

.sd-spec-remove {
    background: none;
    border: none;
    color: #9a3412;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.sd-spec-remove:hover {
    opacity: 1;
}

.sd-spec-add-row {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.sd-spec-add-row .sd-spec-input {
    flex: 1;
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
}

.sd-spec-add-row .sd-spec-add-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    white-space: nowrap;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    transition: all 0.15s;
}

.sd-spec-add-row .sd-spec-add-btn:not(:disabled) {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    cursor: pointer;
}

.sd-spec-add-row .sd-spec-add-btn:not(:disabled):hover {
    background: #15803d;
}

/* ============================
   HORAIRES RESPONSIVE (updated)
   ============================ */

@media (max-width: 600px) {
    .sd-horaires-slots {
        flex-direction: column;
        align-items: flex-start;
    }

    .sd-horaires-toggles {
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .sd-spec-add-row {
        flex-direction: column;
    }

    .sd-spec-add-row .sd-spec-add-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
}

/* ============================
   MODE: SUIVI (Bug Tracking)
   ============================ */

.sd-suivi-header {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.sd-suivi-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.sd-suivi-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.sd-suivi-table td {
    vertical-align: top;
    padding: 0.75rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.sd-suivi-table .sd-suivi-subject {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}

.sd-suivi-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.sd-suivi-done {
    background: #dcfce7;
    color: #166534;
}

.sd-suivi-wip {
    background: #fff7ed;
    color: #9a3412;
}

.sd-suivi-todo {
    background: #e2e8f0;
    color: #475569;
}

.sd-suivi-person {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #eff6ff;
    color: #1e40af;
    margin-right: 0.25rem;
}

@media (max-width: 768px) {
    .sd-suivi-table .sd-suivi-subject {
        white-space: normal;
    }

    .sd-suivi-table td {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* ============================
   SUIVI SUB-TABS
   ============================ */

.sd-suivi-tabs {
    display: flex;
    gap: 0.25rem;
    background: white;
    border-radius: 12px;
    padding: 0.3rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e5e7eb;
}

.sd-suivi-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    background: none;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s;
}

.sd-suivi-tab:hover {
    color: #6b7280;
    background: #f9fafb;
}

.sd-suivi-tab.active {
    color: white;
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(255, 126, 4, 0.3);
}

.sd-suivi-tab.active svg {
    stroke: white;
}

.sd-suivi-tab-content {
    display: none;
}

.sd-suivi-tab-content.active {
    display: block;
}

/* ============================
   CHANGELOG
   ============================ */

.sd-changelog {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sd-changelog-version {
    background: white;
    border-radius: 14px;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
}

.sd-changelog-version--new {
    border-color: #f97316;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.12);
}

.sd-changelog-version-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.sd-changelog-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 0.3px;
}

.sd-changelog-badge--major {
    background: linear-gradient(135deg, #ff7e04, #e91e8c);
    color: white;
}

.sd-changelog-badge--minor {
    background: #dbeafe;
    color: #1e40af;
}

.sd-changelog-badge--patch {
    background: #dcfce7;
    color: #166534;
}

.sd-changelog-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

.sd-changelog-new-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fff7ed;
    color: #f97316;
    border: 1px solid #fed7aa;
}

.sd-changelog-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.sd-changelog-section {
    margin-bottom: 0.75rem;
}

.sd-changelog-section:last-child {
    margin-bottom: 0;
}

.sd-changelog-section h5 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.35rem;
}

.sd-changelog-version ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sd-changelog-version li {
    position: relative;
    padding-left: 1.1rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.45;
}

.sd-changelog-version li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d1d5db;
}

.sd-changelog-version--new li::before {
    background: #f97316;
}

/* ============================
   CEO OVERVIEW
   ============================ */

.sd-ceo-overview {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

/* Hide scrollbar but allow scrolling */
.sd-ceo-overview::-webkit-scrollbar {
    height: 4px;
}
.sd-ceo-overview::-webkit-scrollbar-track {
    background: transparent;
}
.sd-ceo-overview::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.sd-ceo-kpi {
    flex: 0 0 auto;
    min-width: 180px;
    background: white;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    border-top: 3px solid #e5e7eb;
    scroll-snap-align: start;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}

.sd-ceo-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
}

/* Color variants for border-top */
.sd-ceo-kpi--leads { border-top-color: #2563eb; }
.sd-ceo-kpi--conversion { border-top-color: #16a34a; }
.sd-ceo-kpi--top { border-top-color: #ff7e04; }
.sd-ceo-kpi--bottom { border-top-color: #dc2626; }
.sd-ceo-kpi--revenue {
    border-top: 3px solid transparent;
    border-image: linear-gradient(135deg, #ff7e04, #da1984) 1;
    border-image-slice: 1;
}

.sd-ceo-kpi__label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.sd-ceo-kpi__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.sd-ceo-kpi__change {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.sd-ceo-kpi__change--up {
    background: #dcfce7;
    color: #166534;
}

.sd-ceo-kpi__change--down {
    background: #fecaca;
    color: #991b1b;
}

.sd-ceo-kpi__detail {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.3rem;
    line-height: 1.4;
}

.sd-ceo-kpi__sparkline {
    height: 40px;
    margin-top: 0.5rem;
}

.sd-ceo-kpi__sparkline canvas {
    width: 100% !important;
    height: 40px !important;
}

.sd-ceo-kpi__settings {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.sd-ceo-kpi__settings:hover {
    color: #4b5563;
    background: #f3f4f6;
}

/* ============================
   CAMPAIGNS TAB
   ============================ */

.sd-badge-channel {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
}

.sd-channel-sms { background: #dcfce7; color: #166534; }
.sd-channel-email { background: #dbeafe; color: #1e40af; }
.sd-channel-instagram { background: #f3e8ff; color: #6b21a8; }
.sd-channel-google { background: #fecaca; color: #991b1b; }
.sd-channel-facebook { background: #dbeafe; color: #1e3a8a; }
.sd-channel-direct { background: #e2e8f0; color: #475569; }
.sd-channel-autre { background: #f3f4f6; color: #6b7280; }

.sd-cost-input {
    width: 80px;
    padding: 0.3rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: right;
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s;
    font-variant-numeric: tabular-nums;
}

.sd-cost-input:focus {
    border-color: var(--orange, #ff7e04);
    background: white;
    outline: none;
}

.sd-cost-input::placeholder {
    color: #d1d5db;
}

.sd-cpl-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sd-cpl-value--good { color: #166534; }
.sd-cpl-value--medium { color: #92400e; }
.sd-cpl-value--bad { color: #991b1b; }

/* Revenue modal - smaller variant */
.sd-modal-sm {
    max-width: 360px;
}

/* CEO Overview responsive */
@media (min-width: 768px) {
    .sd-ceo-overview {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        overflow-x: visible;
        scroll-snap-type: none;
    }

    .sd-ceo-kpi {
        min-width: 0;
    }
}

@media (min-width: 1024px) {
    .sd-ceo-overview {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================
   TICKETS
   ============================ */

.sd-tickets-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.sd-tickets-section--top {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.sd-tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sd-tickets-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.sd-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sd-ticket-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.sd-ticket-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sd-ticket-card-status {
    flex-shrink: 0;
}

.sd-ticket-card-content {
    flex: 1;
    min-width: 0;
}

.sd-ticket-card-subject {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-ticket-card-meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.sd-ticket-card-arrow {
    flex-shrink: 0;
    color: #9ca3af;
}

/* Ticket status badges */
.sd-ticket-nouveau {
    background: #dbeafe;
    color: #1e40af;
}

.sd-ticket-en-cours {
    background: #fff7ed;
    color: #9a3412;
}

.sd-ticket-resolu {
    background: #dcfce7;
    color: #166534;
}

/* Ticket detail */
.sd-ticket-detail {
    padding: 0.5rem 0;
}

.sd-ticket-detail[hidden] {
    display: none;
}

.sd-ticket-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.sd-ticket-detail-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.sd-ticket-status-actions {
    margin-left: auto;
}

.sd-form-select-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

/* Chat bubbles */
.sd-ticket-messages {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sd-ticket-bubble {
    max-width: 80%;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.sd-ticket-bubble--client {
    align-self: flex-end;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.sd-ticket-bubble--antoine {
    align-self: flex-start;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.sd-ticket-bubble-author {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.2rem;
}

.sd-ticket-bubble-text {
    color: #1f2937;
    white-space: pre-wrap;
}

.sd-ticket-bubble-time {
    font-size: 0.65rem;
    color: #9ca3af;
    margin-top: 0.3rem;
    text-align: right;
}

/* Reply area */
.sd-ticket-reply {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.sd-ticket-reply textarea {
    flex: 1;
    resize: vertical;
    min-height: 60px;
}

.sd-ticket-reply .sd-btn-primary {
    flex-shrink: 0;
    align-self: flex-end;
}

@media (min-width: 768px) {
    .sd-ticket-card {
        padding: 1rem 1.25rem;
    }

    .sd-ticket-card-subject {
        font-size: 0.95rem;
    }
}

/* ============================
   HEALTH SCANNER BANNER
   ============================ */

.sd-health-banner {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.sd-health-banner-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sd-health-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sd-health-green { background: #16a34a; }
.sd-health-orange { background: #f59e0b; }
.sd-health-red { background: #dc2626; }

.sd-health-banner-summary > span:nth-child(2) {
    flex: 1;
    font-size: 0.875rem;
    color: #4b5563;
}

.sd-health-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sd-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.sd-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}

.sd-btn-secondary:hover {
    background: #e5e7eb;
}

.sd-health-details {
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
}

.sd-health-ok {
    color: #16a34a;
    font-size: 0.875rem;
    font-weight: 500;
}

.sd-health-centre {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.sd-health-centre--critical {
    background: #fef2f2;
    border-color: #fecaca;
}

.sd-health-centre h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.sd-health-centre ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.sd-health-issue {
    font-size: 0.825rem;
    color: #4b5563;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.sd-health-severity-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    flex-shrink: 0;
}

.sd-health-severity-badge--critical {
    background: #fecaca;
    color: #991b1b;
}

.sd-health-severity-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.sd-health-severity-badge--info {
    background: #dbeafe;
    color: #1e40af;
}

/* ============================
   DATE RANGE PICKER
   ============================ */

.sd-daterange-wrapper {
    position: relative;
}

.sd-daterange-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.82rem;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.sd-daterange-trigger:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.sd-daterange-trigger--open {
    border-color: var(--orange);
    box-shadow: 0 0 0 2px rgba(255, 126, 4, 0.15);
    background: white;
}

.sd-daterange-trigger svg:first-child {
    color: #9ca3af;
    flex-shrink: 0;
}

.sd-daterange-trigger--open svg:first-child {
    color: var(--orange);
}

.sd-daterange-chevron {
    color: #9ca3af;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.sd-daterange-trigger--open .sd-daterange-chevron {
    transform: rotate(180deg);
}

.sd-daterange-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    padding: 0;
    overflow: visible;
    min-width: 520px;
    animation: sd-dropdown-in 0.15s ease-out;
}

.sd-daterange-backdrop {
    display: none;
}

.sd-daterange-dropdown[hidden],
.sd-daterange-backdrop[hidden] {
    display: none !important;
}

@keyframes sd-dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Presets row */
.sd-daterange-presets {
    display: flex;
    gap: 0;
    padding: 0.15rem;
    background: #f9fafb;
}

.sd-daterange-preset {
    flex: 1;
    padding: 0.5rem 0.5rem;
    border: none;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.15s;
    font-family: inherit;
}

.sd-daterange-preset:hover {
    color: #1f2937;
    background: #f3f4f6;
}

.sd-daterange-preset.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
}

.sd-daterange-divider {
    height: 1px;
    background: #e5e7eb;
}

/* Calendars side by side */
.sd-daterange-calendars {
    display: flex;
    gap: 0;
    padding: 0.75rem;
}

.sd-daterange-cal {
    flex: 1;
    padding: 0 0.5rem;
}

.sd-daterange-cal + .sd-daterange-cal {
    border-left: 1px solid #f1f5f9;
}

/* Calendar header */
.sd-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0 0.15rem;
}

.sd-cal-month {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1f2937;
    flex: 1;
    text-align: center;
}

.sd-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s;
}

.sd-cal-nav:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Calendar grid */
.sd-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.sd-cal-dow {
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    text-align: center;
    padding: 0.25rem 0;
    text-transform: uppercase;
}

.sd-cal-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    font-size: 0.78rem;
    color: #374151;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.1s;
    position: relative;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    outline: none;
}

.sd-cal-day--empty {
    cursor: default;
}

.sd-cal-day:not(.sd-cal-day--empty):not(.sd-cal-day--disabled):hover {
    background: #fff7ed;
}

.sd-cal-day--disabled {
    color: #d1d5db;
    cursor: default;
}

.sd-cal-day--today {
    font-weight: 700;
    color: var(--orange);
}

.sd-cal-day--today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--orange);
}

/* Range selection */
.sd-cal-day--in-range {
    background: rgba(255, 126, 4, 0.1);
}

.sd-cal-day--hover {
    background: rgba(218, 25, 132, 0.15);
    border-radius: 8px;
}

.sd-cal-day--start,
.sd-cal-day--end {
    position: relative;
    z-index: 1;
}

/* Start date while selecting (before end is picked) */
.sd-cal-day--start:not(.sd-cal-day--selected) {
    background: var(--orange);
    color: white;
    font-weight: 600;
    border-radius: 8px;
}

.sd-cal-day--selected {
    color: white;
    font-weight: 600;
}

.sd-cal-day--start.sd-cal-day--selected {
    background: var(--orange);
    border-radius: 8px 0 0 8px;
}

.sd-cal-day--end.sd-cal-day--selected {
    background: var(--pink);
    border-radius: 0 8px 8px 0;
}

/* When start == end (single day) */
.sd-cal-day--start.sd-cal-day--end.sd-cal-day--selected {
    background: var(--primary-gradient);
    border-radius: 8px;
}

/* Footer */
.sd-daterange-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    border-radius: 0 0 14px 14px;
}

.sd-daterange-summary {
    font-size: 0.78rem;
    color: #6b7280;
}

.sd-btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
}

.sd-daterange-footer .sd-btn-primary:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ============================
   TRAFFIC BY CHANNEL
   ============================ */

.sd-traffic-channels {
    background: white;
    border-radius: 14px;
    padding: 1.25rem;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.sd-traffic-channels h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1f2937;
}

.sd-traffic-channels__content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.sd-traffic-channels__list {
    flex: 1;
    min-width: 0;
}

.sd-traffic-channels__chart {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.sd-traffic-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.sd-traffic-row:last-child {
    border-bottom: none;
}

.sd-traffic-row--total {
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
    margin-top: 0.25rem;
    padding-top: 0.6rem;
}

.sd-traffic-row__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sd-traffic-row--total .sd-traffic-row__dot {
    background: transparent !important;
}

.sd-traffic-row__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sd-traffic-row__count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 50px;
    text-align: right;
}

.sd-traffic-row__pct {
    color: #6b7280;
    font-size: 0.75rem;
    min-width: 36px;
    text-align: right;
}

@media (max-width: 640px) {
    .sd-traffic-channels__content {
        flex-direction: column-reverse;
        align-items: center;
    }

    .sd-traffic-channels__chart {
        width: 140px;
        height: 140px;
    }

    /* Date range picker mobile — bottom sheet */
    .sd-daterange-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
        animation: sd-backdrop-in 0.2s ease-out;
    }

    @keyframes sd-backdrop-in {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .sd-daterange-dropdown {
        min-width: unset;
        width: 100%;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 20px 20px 0 0;
        max-height: 80vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        animation: sd-dropdown-in-mobile 0.25s ease-out;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    @keyframes sd-dropdown-in-mobile {
        from { opacity: 0; transform: translateY(100%); }
        to { opacity: 1; transform: translateY(0); }
    }

    .sd-daterange-calendars {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .sd-daterange-cal {
        padding: 0 0.25rem;
    }

    .sd-daterange-cal + .sd-daterange-cal {
        border-left: none;
        border-top: 1px solid #f1f5f9;
        padding-top: 0.5rem;
    }

    .sd-cal-day {
        height: 40px;
        font-size: 0.85rem;
        -webkit-tap-highlight-color: transparent;
    }

    .sd-cal-dow {
        font-size: 0.7rem;
        padding: 0.3rem 0;
    }

    .sd-cal-month {
        font-size: 0.9rem;
    }

    .sd-daterange-presets {
        flex-wrap: wrap;
        padding: 0.25rem;
    }

    .sd-daterange-preset {
        flex: 1 1 45%;
        padding: 0.6rem 0.5rem;
        font-size: 0.82rem;
    }

    .sd-daterange-footer {
        position: sticky;
        bottom: 0;
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
        background: white;
        border-top: 1px solid #e5e7eb;
    }

    .sd-daterange-summary {
        font-size: 0.82rem;
    }
}

/* ============================
   DATA RELIABILITY PANEL
   ============================ */

.sd-data-reliability {
    margin-top: 1.5rem;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 14px;
    overflow: hidden;
}

.sd-data-reliability__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #92400e;
    text-align: left;
}

.sd-data-reliability__toggle svg:first-child {
    flex-shrink: 0;
    color: #d97706;
}

.sd-data-reliability__chevron {
    margin-left: auto;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.sd-data-reliability--open .sd-data-reliability__chevron {
    transform: rotate(180deg);
}

.sd-data-reliability__content {
    display: none;
    padding: 0 1rem 1rem;
}

.sd-data-reliability--open .sd-data-reliability__content {
    display: block;
}

.sd-data-reliability__intro {
    font-size: 0.8rem;
    color: #78350f;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.sd-data-reliability__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    line-height: 1.5;
}

.sd-data-reliability__table th {
    text-align: left;
    padding: 0.5rem;
    background: #fef3c7;
    color: #78350f;
    font-weight: 600;
    border-bottom: 1px solid #fde68a;
    white-space: nowrap;
}

.sd-data-reliability__table td {
    padding: 0.5rem;
    border-bottom: 1px solid #fef3c7;
    color: #44403c;
    vertical-align: top;
}

.sd-data-reliability__table tr:last-child td {
    border-bottom: none;
}

.sd-reliability-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.sd-reliability--high {
    background: #dcfce7;
    color: #166534;
}

.sd-reliability--medium {
    background: #fef9c3;
    color: #854d0e;
}

.sd-reliability--low {
    background: #fee2e2;
    color: #991b1b;
}

.sd-data-reliability__footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #fde68a;
    font-size: 0.78rem;
    color: #78350f;
    line-height: 1.5;
}

/* Mobile: stack table as cards */
@media (max-width: 640px) {
    .sd-data-reliability__table thead {
        display: none;
    }

    .sd-data-reliability__table,
    .sd-data-reliability__table tbody,
    .sd-data-reliability__table tr,
    .sd-data-reliability__table td {
        display: block;
    }

    .sd-data-reliability__table tr {
        padding: 0.6rem 0;
        border-bottom: 1px solid #fef3c7;
    }

    .sd-data-reliability__table tr:last-child {
        border-bottom: none;
    }

    .sd-data-reliability__table td {
        padding: 0.15rem 0;
        border-bottom: none;
    }

    .sd-data-reliability__table td:nth-child(2) {
        margin-bottom: 0.25rem;
    }

    .sd-data-reliability__table td:nth-child(3)::before {
        content: '';
        display: block;
        font-weight: 600;
        color: #78350f;
        font-size: 0.7rem;
    }

    .sd-data-reliability__table td:nth-child(4) {
        font-style: italic;
        color: #92400e;
        font-size: 0.72rem;
    }

    .sd-data-reliability__table td:nth-child(4):empty,
    .sd-data-reliability__table td:nth-child(4):has(> :only-child:empty) {
        display: none;
    }
}
