/* ==================== CSS VARIABLES (Dark/Light) ==================== */
:root {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #1e293b;
  --bg-hover: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: rgba(0,0,0,0.3);
}

body.light-mode {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --shadow: rgba(0,0,0,0.08);
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--bg-body); color: var(--text-primary); line-height: 1.6; min-height: 100vh;
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
transition: background 0.3s ease, color 0.3s ease;
}
input, button, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary-light); text-decoration: none; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

/* ==================== THEME TOGGLE ==================== */
.theme-toggle {
width: 40px; height: 40px; border-radius: 10px; background: var(--bg-card);
display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
cursor: pointer; transition: all 0.2s; border: 1px solid var(--border-color); margin-right: 8px;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ==================== SCREEN ==================== */
.screen { min-height: 100vh; }

/* ==================== AUTH SCREEN ==================== */
.auth-container {
max-width: 420px; margin: 0 auto; padding: 40px 20px;
min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-icon {
width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, #2563eb, #7c3aed);
display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800;
color: white; margin: 0 auto 16px; box-shadow: 0 8px 32px rgba(37, 99, 235, 0.3);
}
.auth-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.auth-logo p { color: var(--text-secondary); font-size: 0.9rem; }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 24px; background: var(--bg-card); padding: 4px; border-radius: 12px; }
.auth-tab {
flex: 1; padding: 12px; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
color: var(--text-muted); transition: all 0.2s; text-align: center;
}
.auth-tab.active { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-color);
background: var(--bg-input); color: var(--text-primary); font-size: 0.95rem;
transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.phone-input-row {
position: relative; display: flex; align-items: stretch; min-height: 48px;
border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-input);
transition: border-color 0.2s, box-shadow 0.2s;
}
.phone-input-row:focus-within {
border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-group .phone-input-row input, .phone-input-row input {
flex: 1; min-width: 0; padding: 12px 14px; border: 0; border-radius: 0 10px 10px 0;
background: transparent; color: var(--text-primary); outline: none;
}
.form-group .phone-input-row input:focus { border: 0; box-shadow: none; }
.phone-country-native {
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.phone-country-picker { position: relative; flex: 0 0 auto; }
.phone-country-trigger {
display: flex; align-items: center; justify-content: center; gap: 7px; height: 100%; min-width: 116px;
padding: 0 12px; border-right: 1px solid var(--border-color); border-radius: 9px 0 0 9px;
background: var(--bg-card); color: var(--text-primary); font-size: 0.88rem; font-weight: 600;
font-variant-numeric: tabular-nums; transition: background 0.2s, color 0.2s;
}
.phone-country-trigger:hover, .phone-country-trigger[aria-expanded="true"] { background: var(--bg-hover); }
.phone-country-trigger:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.phone-country-trigger-flag, .phone-country-option-flag { font-size: 1.12rem; line-height: 1; }
.phone-country-chevron { color: var(--text-muted); font-size: 0.65rem; transition: transform 0.2s; }
.phone-country-trigger[aria-expanded="true"] .phone-country-chevron { transform: rotate(180deg); color: var(--primary-light); }
.phone-country-menu {
position: absolute; z-index: 1200; top: calc(100% + 8px); left: 0; width: 310px;
max-width: calc(100vw - 40px); overflow: hidden; border: 1px solid var(--border-color);
border-radius: 12px; background: var(--bg-card); box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}
.phone-country-search-wrap { padding: 10px; border-bottom: 1px solid var(--border-color); }
.form-group .phone-country-search, .phone-country-search {
width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px;
background: var(--bg-input); color: var(--text-primary); font-size: 0.86rem; outline: none;
}
.form-group .phone-country-search:focus, .phone-country-search:focus {
border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.phone-country-search::placeholder { color: var(--text-muted); }
.phone-country-list { max-height: 270px; overflow-y: auto; padding: 6px; scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }
.phone-country-option {
display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px;
width: 100%; padding: 10px; border-radius: 8px; color: var(--text-primary); text-align: left;
font-size: 0.86rem; transition: background 0.15s, color 0.15s;
}
.phone-country-option:hover, .phone-country-option:focus-visible { background: var(--bg-hover); outline: none; }
.phone-country-option[aria-selected="true"] { background: rgba(37, 99, 235, 0.14); color: var(--primary-light); }
.phone-country-option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-country-option-dial { color: var(--text-secondary); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.phone-country-option[aria-selected="true"] .phone-country-option-dial { color: var(--primary-light); }
.phone-country-empty { padding: 20px 12px; color: var(--text-secondary); text-align: center; font-size: 0.85rem; }
@media(max-width:480px) {
.phone-country-trigger { min-width: 103px; padding: 0 9px; gap: 6px; font-size: 0.82rem; }
.form-group .phone-input-row input, .phone-input-row input { padding: 12px 10px; font-size: 0.88rem; }
.phone-country-menu { width: min(300px, calc(100vw - 40px)); }
.phone-country-list { max-height: 245px; }
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.consent-box { background: var(--bg-card); padding: 16px; border-radius: 12px; border: 1px solid var(--border-color); }
.checkbox-label {
display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; color: var(--text-secondary);
margin-bottom: 10px; cursor: pointer;
}
.checkbox-label:last-child { margin-bottom: 0; }
.checkbox-label input { margin-top: 2px; accent-color: var(--primary); }
.checkbox-label span { flex: 1; line-height: 1.5; }

.auth-form-error {
padding: 12px 14px; border: 1px solid rgba(248, 113, 113, 0.55); border-radius: 10px;
background: rgba(127, 29, 29, 0.18); color: #fca5a5; font-size: 0.86rem; line-height: 1.5;
outline: none;
}
.auth-field-error { margin: 0; color: #fca5a5; font-size: 0.78rem; line-height: 1.45; }
.form-group input[aria-invalid="true"] {
border-color: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}
.consent-box.auth-consent-invalid { border-color: rgba(248, 113, 113, 0.65); }
.consent-box .auth-field-error { margin: 4px 0 10px 28px; }
.consent-box .auth-field-error:last-child { margin-bottom: 0; }

.btn-primary {
background: linear-gradient(135deg, #2563eb, #1d4ed8); color: white; padding: 14px 24px;
border-radius: 10px; font-weight: 600; font-size: 0.95rem; transition: all 0.2s;
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
background: var(--bg-hover); color: var(--text-primary); padding: 12px 20px; border-radius: 10px;
font-weight: 500; font-size: 0.9rem; transition: all 0.2s;
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-secondary:hover { background: var(--border-color); }

.btn-danger { background: #dc2626; color: white; padding: 12px 20px; border-radius: 10px; font-weight: 600; }
.btn-danger:hover { background: #b91c1c; }

.btn-text { color: var(--primary-light); font-size: 0.85rem; font-weight: 500; background: none; padding: 8px; }
.btn-text:hover { text-decoration: underline; }

.btn-full { width: 100%; }
.btn-large { padding: 16px 24px; font-size: 1rem; }
.btn-small { padding: 8px 14px; font-size: 0.8rem; }

.auth-footer { text-align: center; margin-top: 24px; font-size: 0.8rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary-light); }
.dpo-link { margin-top: 8px; }

/* ==================== MAIN APP ==================== */
#main-screen { padding-bottom: 80px; }

.top-bar {
display: flex; justify-content: space-between; align-items: center;
padding: 12px 16px; background: var(--bg-body); border-bottom: 1px solid var(--border-color);
position: sticky; top: 0; z-index: 100; transition: all 0.3s ease;
}
.top-bar-left { display: flex; align-items: center; gap: 10px; }
.logo-small {
width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #2563eb, #7c3aed);
display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 0.9rem;
}
.app-name { font-weight: 700; font-size: 1.1rem; color: var(--text-primary); letter-spacing: -0.5px; }
.top-bar-right { display: flex; align-items: center; gap: 12px; }
@media (max-width: 340px) {
    .top-bar { padding: 10px; }
    .top-bar-left { min-width: 0; gap: 6px; }
    .top-bar-right { flex-shrink: 0; gap: 8px; }
    .app-name { font-size: .95rem; white-space: nowrap; }
}

.notif-bell {
position: relative; width: 40px; height: 40px; border-radius: 10px; background: var(--bg-card);
display: flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer;
transition: all 0.2s; border: 1px solid var(--border-color);
}
.notif-bell:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-badge {
position: absolute; top: -2px; right: -2px; width: 18px; height: 18px;
background: #ef4444; color: white; border-radius: 50%; font-size: 0.65rem;
font-weight: 700; display: flex; align-items: center; justify-content: center;
border: 2px solid var(--bg-body);
}

.user-avatar {
width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #2563eb, #7c3aed);
display: flex; align-items: center; justify-content: center; font-weight: 700; color: white;
cursor: pointer; font-size: 0.9rem;
}

/* Navigation */
.nav-tabs {
display: flex; justify-content: space-around; padding: 8px 4px;
background: var(--bg-card); border-bottom: 1px solid var(--border-color); position: sticky; top: 61px; z-index: 99;
overflow-x: auto; scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
display: flex; flex-direction: column; align-items: center; gap: 4px;
padding: 8px 12px; border-radius: 10px; color: var(--text-muted); font-size: 0.7rem;
font-weight: 500; transition: all 0.2s; white-space: nowrap; min-width: 60px;
}
.nav-tab i { font-size: 1.1rem; }
.nav-tab.active { color: var(--primary-light); background: rgba(37, 99, 235, 0.08); }
.nav-tab:hover:not(.active) { color: var(--text-secondary); background: var(--bg-hover); }

/* Drawer / Menu Plus */
.drawer-overlay {
position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card);
border-radius: 20px 20px 0 0; padding: 20px; z-index: 201;
transform: translateY(100%); transition: transform 0.3s ease;
max-height: 70vh; overflow-y: auto; border-top: 1px solid var(--border-color);
}
.drawer.open { transform: translateY(0); }
.drawer-header {
display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.drawer-header h3 { font-size: 1.1rem; color: var(--text-primary); }
.drawer-close {
width: 32px; height: 32px; border-radius: 8px; background: var(--bg-hover);
color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
font-size: 1.2rem;
}
.drawer-item {
display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px;
color: var(--text-primary); font-weight: 500; transition: background 0.15s; cursor: pointer;
}
.drawer-item:hover { background: var(--bg-hover); }
.drawer-item i { font-size: 1.2rem; color: var(--primary-light); width: 24px; text-align: center; }

/* Tab Content */
.tab-content { display: none; padding: 16px; max-width: 800px; margin: 0 auto; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.tab-header { margin-bottom: 20px; }
.tab-header h2 { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.tab-header h2 i { color: var(--primary-light); }
.tab-subtitle { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* Dashboard */
.dashboard-header {
display: flex; justify-content: space-between; align-items: center;
margin-bottom: 20px;
}
.welcome-text h2 { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.welcome-text p { color: var(--text-secondary); font-size: 0.85rem; }
.plan-badge {
padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
background: rgba(37, 99, 235, 0.12); color: var(--primary-light); border: 1px solid rgba(37, 99, 235, 0.25);
}

.stats-grid {
display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px;
}
.stat-card {
background: var(--bg-card); border-radius: 12px; padding: 16px; border: 1px solid var(--border-color);
text-align: center; transition: all 0.3s ease;
}
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

.score-card {
background: linear-gradient(135deg, var(--bg-card), var(--bg-body)); border-radius: 12px;
padding: 20px; margin-bottom: 20px; border: 1px solid var(--border-color); transition: all 0.3s ease;
}
.score-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.score-title { font-weight: 600; color: var(--text-primary); }
.score-level { font-size: 0.8rem; font-weight: 600; color: #fbbf24; }
.score-bar { height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.score-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #7c3aed); border-radius: 4px; transition: width 0.5s ease; }
.score-desc { font-size: 0.8rem; color: var(--text-secondary); }

.quick-actions { margin-bottom: 20px; }
.quick-actions h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.action-btn {
background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px;
display: flex; flex-direction: column; align-items: center; gap: 8px;
color: var(--text-primary); font-size: 0.85rem; font-weight: 500; transition: all 0.2s;
}
.action-btn i { font-size: 1.4rem; color: var(--primary-light); }
.action-btn:hover { background: var(--bg-hover); border-color: var(--border-color); transform: translateY(-2px); }

.recent-section { margin-bottom: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-header h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

/* Receipt List */
.receipt-list { display: flex; flex-direction: column; gap: 10px; }
.receipt-item {
background: var(--bg-card); border-radius: 12px; padding: 14px; border: 1px solid var(--border-color);
display: flex; justify-content: space-between; align-items: center; transition: all 0.2s;
min-width: 0; max-width: 100%;
}
.receipt-item:hover { border-color: var(--bg-hover); }
.receipt-info { flex: 1; min-width: 0; }
.receipt-name { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.receipt-amount { flex: 0 1 auto; min-width: 0; max-width: 65%; font-weight: 700; color: var(--text-primary); font-size: 1rem; text-align: right; overflow-wrap: anywhere; word-break: break-word; }
.receipt-status {
font-size: 0.7rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; margin-top: 4px; display: inline-block;
}
.status-pending { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.status-confirmed { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.status-disputed { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.status-cancelled { background: rgba(107, 114, 128, 0.12); color: #6b7280; }

.empty-state {
text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.9rem;
}
.empty-state i { font-size: 2rem; margin-bottom: 12px; display: block; color: var(--border-color); }

/* Create Form */
.form-card {
background: var(--bg-card); border-radius: 12px; padding: 20px; margin-bottom: 16px; border: 1px solid var(--border-color); transition: all 0.3s ease;
}
.form-card h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.form-card h3 i { color: var(--primary-light); }

.preview-card { background: var(--bg-body); }
.receipt-preview {
background: var(--bg-card); border-radius: 10px; overflow: hidden; border: 1px solid var(--border-color);
}
.preview-header {
padding: 16px; text-align: center; color: white; font-weight: 700; font-size: 1.1rem;
}
.preview-body { padding: 16px; }
.preview-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
.preview-row:last-child { border-bottom: none; }
.preview-row span:first-child { color: var(--text-secondary); }
.preview-row span:last-child { color: var(--text-primary); font-weight: 500; }

.result-section { margin-top: 20px; }
.result-card {
background: var(--bg-card); border-radius: 16px; padding: 24px; text-align: center; border: 1px solid var(--border-color); transition: all 0.3s ease;
}
.result-icon { font-size: 3rem; color: var(--success); margin-bottom: 12px; }
.result-card h3 { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.result-card > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }

.share-options { margin: 20px 0; }
.share-options h4 { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.share-btn {
padding: 12px; border-radius: 10px; font-size: 0.85rem; font-weight: 500;
display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s;
}
.share-btn.whatsapp { background: rgba(16, 185, 129, 0.12); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }
.share-btn.whatsapp:hover { background: rgba(16, 185, 129, 0.2); }
.share-btn.email { background: rgba(59, 130, 246, 0.12); color: var(--primary-light); border: 1px solid rgba(59, 130, 246, 0.25); }
.share-btn.email:hover { background: rgba(59, 130, 246, 0.2); }
.share-btn.native { background: rgba(124, 58, 237, 0.12); color: #a78bfa; border: 1px solid rgba(124, 58, 237, 0.25); }
.share-btn.native:hover { background: rgba(124, 58, 237, 0.2); }
.share-btn.copy { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.share-btn.copy:hover { background: rgba(245, 158, 11, 0.2); }
.share-btn.print { background: rgba(20, 184, 166, 0.12); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.28); cursor: pointer; }
.share-btn.print:hover { background: rgba(20, 184, 166, 0.22); }
.share-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
body.light-mode .share-btn.print { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
body.light-mode .share-btn.print:hover { background: #ccfbf1; }

.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* History */
.filter-bar { margin-bottom: 16px; }
.search-box {
position: relative; margin-bottom: 12px;
}
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input {
width: 100%; padding: 12px 14px 12px 40px; border-radius: 10px; border: 1px solid var(--border-color);
background: var(--bg-input); color: var(--text-primary); font-size: 0.9rem; outline: none;
}
.search-box input:focus { border-color: var(--primary-light); }
.filter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.filter-row select {
padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-input);
color: var(--text-primary); font-size: 0.8rem; outline: none;
}

/* Menus de tri coherents sur paiements, remboursements et exports */
.sort-select-native { display: none !important; }
.sort-select-picker { position: relative; width: 100%; min-width: 0; }
.sort-control-enhanced > i { display: none; }
.sort-select-trigger {
display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 12px 14px;
border: 1px solid rgba(96, 165, 250, 0.38); border-radius: 12px;
background: linear-gradient(135deg, rgba(30, 64, 175, 0.3), rgba(15, 23, 42, 0.96));
color: var(--text-primary); font-size: 0.84rem; font-weight: 650; text-align: left;
outline: none; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.sort-select-trigger:hover { border-color: var(--primary-light); transform: translateY(-1px); }
.sort-select-trigger:focus-visible, .sort-select-trigger[aria-expanded="true"] {
border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}
.sort-select-trigger-icon { flex: 0 0 auto; color: #60a5fa; font-size: 0.9rem; }
.sort-select-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-select-chevron { flex: 0 0 auto; color: var(--text-muted); font-size: 0.68rem; transition: transform 0.2s; }
.sort-select-trigger[aria-expanded="true"] .sort-select-chevron { transform: rotate(180deg); color: var(--primary-light); }
.sort-select-menu {
position: absolute; z-index: 1300; top: calc(100% + 8px); left: 0; width: 100%; min-width: 245px;
max-width: calc(100vw - 32px); padding: 8px; overflow: hidden; border: 1px solid var(--border-color);
border-radius: 12px; background: var(--bg-card); box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}
.sort-select-search-box { margin-bottom: 7px; }
.sort-select-search-box input { min-height: 42px; padding-top: 10px!important; padding-bottom: 10px!important; background: var(--bg-input); color: var(--text-primary); font-size: .82rem; }
.sort-select-options { max-height: min(285px, 42dvh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sort-select-search-status { margin: 7px 5px 1px; }
.sort-select-option.hidden { display: none; }
.sort-select-option {
display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; padding: 10px 11px;
border-radius: 8px; background: transparent; color: var(--text-primary); font-size: 0.83rem;
font-weight: 550; text-align: left; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.sort-select-option:hover, .sort-select-option:focus-visible { background: var(--bg-hover); outline: none; }
.sort-select-option[aria-selected="true"] { background: rgba(37, 99, 235, 0.16); color: var(--primary-light); }
.sort-select-option-icon { width: 17px; color: var(--text-secondary); text-align: center; }
.sort-select-option[aria-selected="true"] .sort-select-option-icon { color: var(--primary-light); }
.sort-select-option-label { flex: 1; min-width: 0; }
.sort-select-check { color: var(--primary-light); font-size: 0.75rem; }
.export-field .sort-select-trigger { min-height: 43px; padding: 10px 12px; font-size: 0.82rem; }
.export-field .sort-select-menu { min-width: 100%; }

.export-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.btn-export {
flex: 1; padding: 10px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border-color);
color: var(--text-primary); font-size: 0.85rem; font-weight: 500; display: flex; align-items: center;
justify-content: center; gap: 6px; transition: all 0.2s;
}
.btn-export:hover { background: var(--bg-hover); }

/* Actions documentaires : meme langage visuel dans toute l'application */
.btn-export.btn-export-pdf, #receipt-detail-pdf, #export-submit.export-submit-pdf {
background: linear-gradient(135deg, #ef4444, #dc2626); border-color: transparent; color: #fff;
box-shadow: 0 8px 18px rgba(220, 38, 38, 0.18);
}
.btn-export.btn-export-excel, #receipt-detail-excel, #export-submit.export-submit-excel {
background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #fff;
box-shadow: 0 8px 18px rgba(5, 150, 105, 0.18);
}
#receipt-detail-public, #result-public-link {
background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: transparent; color: #fff;
box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}
.btn-export.btn-export-pdf, .btn-export.btn-export-excel,
#receipt-detail-pdf, #receipt-detail-excel, #receipt-detail-public, #result-public-link {
font-weight: 700; transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
}
.btn-export.btn-export-pdf:hover, .btn-export.btn-export-excel:hover,
#receipt-detail-pdf:hover, #receipt-detail-excel:hover, #receipt-detail-public:hover, #result-public-link:hover,
#export-submit.export-submit-pdf:hover, #export-submit.export-submit-excel:hover {
filter: brightness(1.08); transform: translateY(-1px); color: #fff;
}
.receipt-downloads .btn-text.receipt-download-pdf,
.receipt-downloads .btn-text.receipt-download-excel,
.receipt-downloads .btn-text.receipt-pay-btn {
display: inline-flex; align-items: center; justify-content: center; gap: 5px;
min-height: 32px; box-sizing: border-box; padding: 6px 9px; border-radius: 8px;
text-decoration: none; font-weight: 650; line-height: 1.2; white-space: nowrap;
}
.receipt-downloads .btn-text.receipt-download-pdf { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.receipt-downloads .btn-text.receipt-download-excel { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.receipt-downloads .btn-text.receipt-download-pdf:hover { background: rgba(239, 68, 68, 0.18); }
.receipt-downloads .btn-text.receipt-download-excel:hover { background: rgba(16, 185, 129, 0.18); }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.pagination button {
padding: 8px 14px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border-color);
color: var(--text-primary); font-size: 0.85rem; transition: all 0.2s;
}
.pagination button:hover { background: var(--bg-hover); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: white; }

/* Clients */
.client-list { display: flex; flex-direction: column; gap: 10px; }
.client-item {
background: var(--bg-card); border-radius: 12px; padding: 16px; border: 1px solid var(--border-color);
display: flex; align-items: center; gap: 14px; transition: all 0.2s;
}
.client-item:hover { border-color: var(--bg-hover); }
.client-avatar {
width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #7c3aed);
display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 1.1rem;
}
.client-info { flex: 1; }
.client-name { font-weight: 600; color: var(--text-primary); }
.client-phone { font-size: 0.8rem; color: var(--text-muted); }
.client-stats { text-align: right; }
.client-stat-value { font-weight: 700; color: var(--text-primary); }
.client-stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* Profile */
.profile-card { max-width: 600px; margin: 0 auto; }
.avatar-section { text-align: center; margin-bottom: 24px; }
.avatar-large {
width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #7c3aed);
display: flex; align-items: center; justify-content: center; font-weight: 700; color: white;
font-size: 1.8rem; margin: 0 auto 12px;
}
.avatar-actions { display: flex; justify-content: center; gap: 10px; }

.logo-preview {
width: 120px; height: 80px; border-radius: 10px; background: var(--bg-body); border: 2px dashed var(--border-color);
display: flex; align-items: center; justify-content: center; color: var(--text-muted); margin-bottom: 10px;
}
.logo-preview img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }

.form-section-intro { margin: -5px 0 17px; color: var(--text-secondary); font-size: 0.8rem; line-height: 1.55; }
.form-section-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 13px; color: var(--text-muted); font-size: 0.72rem; line-height: 1.5; }
.form-section-note i { margin-top: 4px; color: var(--primary-light); }
.social-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.social-profile-field label { display: flex; align-items: center; gap: 7px; color: var(--text-primary); }
.social-profile-field label i { width: 17px; text-align: center; font-size: 0.9rem; }
.social-profile-field.instagram label i { color: #e879f9; }
.social-profile-field.facebook label i { color: #60a5fa; }
.social-profile-field.linkedin label i { color: #38bdf8; }
.social-profile-field.store label i { color: #34d399; }
.social-profile-field input { width: 100%; font-size: 0.82rem; }
@media(max-width:560px) { .social-profile-grid { grid-template-columns: 1fr; } }

.danger-zone { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border-color); }
.danger-zone h3 { color: var(--danger); font-size: 0.95rem; margin-bottom: 12px; }

/* Plans */
.plans-grid { display: flex; flex-direction: column; gap: 16px; max-width: 500px; margin: 0 auto; }
.plan-card {
background: var(--bg-card); border-radius: 16px; padding: 24px; border: 1px solid var(--border-color);
position: relative; transition: all 0.3s ease;
}
.plan-card.featured { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25); }
.plan-badge {
position: absolute; top: -10px; right: 16px; background: var(--primary); color: white;
padding: 4px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: 700;
}
.plan-name { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.plan-price { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.plan-price span { font-size: 0.9rem; color: var(--text-secondary); font-weight: 400; }
.plan-period { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.plan-features { list-style: none; margin-bottom: 20px; }
.plan-features li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.9rem; color: var(--text-secondary); }
.plan-features li i { color: var(--success); font-size: 0.8rem; }

/* Ranking */
.ranking-list { display: flex; flex-direction: column; gap: 8px; }
.ranking-item {
background: var(--bg-card); border-radius: 12px; padding: 14px; border: 1px solid var(--border-color);
display: flex; align-items: center; gap: 12px; transition: all 0.3s ease;
}
.ranking-rank {
width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.rank-1 { background: #fbbf24; color: #0f172a; }
.rank-2 { background: #94a3b8; color: #0f172a; }
.rank-3 { background: #b45309; color: white; }
.rank-other { background: var(--border-color); color: var(--text-secondary); }

/* Modal */
.modal {
position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7);
display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
backdrop-filter: blur(4px);
}
.modal-content {
background: var(--bg-card); border-radius: 16px; width: 100%; max-width: 500px; max-height: 80vh;
overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border-color); transition: all 0.3s ease;
}
.legal-modal { max-width: 700px; max-height: 90vh; }
.modal-header {
display: flex; justify-content: space-between; align-items: center; padding: 16px 20px;
border-bottom: 1px solid var(--border-color);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
.modal-close {
width: 32px; height: 32px; border-radius: 8px; background: var(--bg-hover); color: var(--text-primary);
display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.legal-body { padding: 20px; overflow-y: auto; font-size: 0.9rem; line-height: 1.7; color: var(--text-secondary); }
.legal-body h3 { color: var(--text-primary); margin: 16px 0 8px; font-size: 1rem; }
.legal-body p { margin-bottom: 10px; }

.notif-list { padding: 8px; max-height: 400px; overflow-y: auto; }
.notif-item {
padding: 12px; border-radius: 10px; margin-bottom: 8px; background: var(--bg-body);
display: flex; align-items: flex-start; gap: 10px; cursor: pointer; transition: all 0.2s;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { border-left: 3px solid var(--primary-light); }
.notif-item.read { border-left: 3px solid transparent; opacity: 0.7; }
.notif-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(37, 99, 235, 0.12); display: flex; align-items: center; justify-content: center; color: var(--primary-light); flex-shrink: 0; }
.notif-content { flex: 1; }
.notif-title { font-weight: 600; color: var(--text-primary); font-size: 0.85rem; }
.notif-message { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.notif-content { min-width: 0; }
.notif-client-request { border: 1px solid rgba(37,99,235,.24); background: rgba(37,99,235,.055); }
.notif-client-request.unread { border-left: 3px solid var(--primary-light); }
.notif-client-request .notif-message { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; }
.notif-request-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.notif-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 7px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); color: var(--text-primary); font: 650 .7rem/1.2 Inter,sans-serif; text-decoration: none; cursor: pointer; }
.notif-action:hover { border-color: var(--primary-light); color: var(--primary-light); }
.notif-action:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.notif-whatsapp { color: #34d399; }
.notif-email { color: #93c5fd; }
.notif-open { color: #fbbf24; }
.notif-request-note { display: block; margin-top: 8px; color: var(--text-muted); font-size: .64rem; line-height: 1.5; }
body.light-mode .notif-whatsapp { color: #047857; }
body.light-mode .notif-email { color: #1d4ed8; }
body.light-mode .notif-open { color: #92400e; }
@media(max-width:480px){.notif-request-actions{align-items:stretch;flex-direction:column}.notif-action{width:100%;box-sizing:border-box}}

.push-settings {
display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
padding: 14px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-body);
}
.push-settings-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--primary-light); background: rgba(37,99,235,.12); }
.push-settings-copy { min-width: 0; }
.push-settings-copy strong { display: block; color: var(--text-primary); font-size: .82rem; }
.push-settings-copy p { margin: 3px 0; color: var(--text-secondary); font-size: .76rem; line-height: 1.45; }
.push-settings-copy small { display: block; color: var(--text-muted); font-size: .66rem; line-height: 1.45; }
.push-settings-actions { display: flex; flex-direction: column; gap: 8px; }
#push-toggle, #push-test { min-height: 44px; padding: 10px 13px; white-space: nowrap; cursor: pointer; }
#push-toggle:focus-visible, #push-test:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
#push-toggle.is-active { color: var(--success); }
@media(max-width:480px){
.push-settings { grid-template-columns: auto minmax(0,1fr); padding: 13px; }
.push-settings-actions { grid-column: 1 / -1; flex-direction: row; }
.push-settings-actions .btn-secondary { flex: 1; width: 100%; }
.notif-list { max-height: 45vh; }
}

/* Toast */
.toast {
position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(100px);
background: var(--bg-card); color: var(--text-primary); padding: 12px 24px; border-radius: 10px;
font-size: 0.9rem; font-weight: 500; z-index: 1001; border: 1px solid var(--border-color);
box-shadow: 0 8px 32px var(--shadow); opacity: 0; transition: all 0.3s ease;
white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.warning { border-color: var(--warning); color: var(--warning); }
.toast.info { border-color: var(--primary-light); color: var(--primary-light); }

/* Bottom Actions */
.bottom-actions {
position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px;
background: var(--bg-body); border-top: 1px solid var(--border-color); z-index: 90;
}
.btn-logout {
width: 100%; padding: 12px; border-radius: 10px; background: var(--bg-card);
border: 1px solid var(--border-color); color: var(--danger); font-weight: 600;
display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-logout:hover { background: rgba(239, 68, 68, 0.12); }

/* App Footer */
.app-footer {
text-align: center; padding: 24px 16px; color: var(--text-muted); font-size: 0.75rem;
border-top: 1px solid var(--border-color); margin-top: 40px; transition: all 0.3s ease;
}

/* Responsive */
@media (min-width: 768px) {
.nav-tabs { justify-content: center; gap: 8px; padding: 8px 20px; }
.nav-tab { flex-direction: row; gap: 8px; font-size: 0.85rem; padding: 10px 16px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); }
.action-grid { grid-template-columns: repeat(4, 1fr); }
.share-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
.form-row { grid-template-columns: 1fr; }
.filter-row { grid-template-columns: 1fr; }
.action-grid { grid-template-columns: repeat(2, 1fr); }
.share-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==================== AUTOCOMPLETE DROPDOWN ==================== */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 32px var(--shadow);
}
.suggestion-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--bg-hover); }
.suggestion-name { font-weight: 500; color: var(--text-primary); font-size: 0.9rem; }
.suggestion-phone { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Loading spinner */
.fa-spin { animation: fa-spin 1s linear infinite; }
@keyframes fa-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* Etats de chargement, erreurs et connexion */
.view-status:empty { display: none; }
.view-status {
display: flex; align-items: center; justify-content: center; gap: 9px; margin: 10px 0 14px;
padding: 10px 13px; border: 1px solid rgba(96,165,250,.22); border-radius: 10px;
background: rgba(37,99,235,.08); color: var(--text-secondary); font-size: .78rem; line-height: 1.45;
}
.view-status.error { border-color: rgba(239,68,68,.38); background: rgba(239,68,68,.08); color: #fca5a5; }
.view-status button { margin-left: 6px; padding: 6px 10px; border: 1px solid currentColor; border-radius: 7px; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.offline-status {
display: flex; align-items: center; justify-content: center; gap: 9px; margin: 10px 16px 0; padding: 10px 13px;
border: 1px solid rgba(245,158,11,.38); border-radius: 11px; background: rgba(245,158,11,.1);
color: #fcd34d; font-size: .77rem; line-height: 1.45;
}
.offline-status.is-offline { border-color: rgba(239,68,68,.38); background: rgba(239,68,68,.09); color: #fca5a5; }
.offline-sync-button { flex-shrink: 0; padding: 6px 10px; border: 1px solid currentColor; border-radius: 7px; background: transparent; color: inherit; font: inherit; font-weight: 750; cursor: pointer; }

/* Pagination compacte et accessible */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 100%; }
.pagination button { min-width: 36px; min-height: 36px; padding: 7px 10px; }
.pagination button:disabled { opacity: .38; cursor: not-allowed; }
.pagination button:focus-visible, .view-status button:focus-visible, .offline-sync-button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.pagination-ellipsis { min-width: 18px; color: var(--text-muted); text-align: center; user-select: none; }

/* Gestion du focus et du defilement des modales */
body.modal-open { overflow: hidden; }
.modal { overflow-y: auto; overscroll-behavior: contain; }
.modal-content { max-height: min(90vh, 90dvh); }
.modal-close { flex-shrink: 0; cursor: pointer; }
.modal-close:focus-visible, .modal button:focus-visible, .modal a:focus-visible,
.modal input:focus-visible, .modal select:focus-visible, .modal textarea:focus-visible {
outline: 2px solid #93c5fd; outline-offset: 2px;
}

@media (max-width: 600px) {
.modal { padding: 10px; align-items: flex-start; }
.modal-content { max-height: calc(100dvh - 20px); margin: auto 0; }
.offline-status { align-items: flex-start; flex-wrap: wrap; margin-inline: 10px; }
.view-status { align-items: flex-start; flex-wrap: wrap; }
.pagination { gap: 5px; }
.pagination button { min-width: 34px; min-height: 34px; padding: 6px 8px; }
.receipt-downloads { flex-wrap: wrap; justify-content: flex-end; }
.receipt-side { min-width: 0; max-width: 58%; }
.receipt-info { min-width: 0; overflow-wrap: anywhere; }
.refund-overview { grid-template-columns: 1fr; }
.refund-item-head { flex-wrap: wrap; }
.refund-item-amount { overflow-wrap: anywhere; }
.toast { max-width: calc(100vw - 24px); white-space: normal; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


/* Controles principaux convertis en boutons : apparence conservee et focus clavier visible. */
.theme-toggle, .notif-bell, .user-avatar, .drawer-item {
font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer;
}
.theme-toggle:focus-visible, .notif-bell:focus-visible, .user-avatar:focus-visible,
.drawer-item:focus-visible, .receipt-item[role="button"]:focus-visible {
outline: 2px solid var(--primary-light); outline-offset: 3px;
}
.drawer-item { width: 100%; text-align: left; }
.notif-badge.is-unavailable { background: var(--warning); color: #0f172a; }

.theme-toggle, .notif-bell, .user-avatar { padding: 0; }

/* Huit actions colorees, isolees des anciens styles et du cache navigateur. */
#tab-dashboard .action-grid .action-btn {
--action-rgb: 59,130,246; --action-color: #60a5fa;
border: 1px solid rgba(var(--action-rgb),.5);
background: linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65));
box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12);
color: var(--text-primary);
}
#tab-dashboard .action-grid .action-btn > i {
width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
color: var(--action-color); background: rgba(var(--action-rgb),.17); font-size: 1.3rem;
}
#tab-dashboard .action-grid .action-btn:hover, #tab-dashboard .action-grid .action-btn:focus-visible {
border-color: rgba(var(--action-rgb),.85); background: linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7));
}
#tab-dashboard .action-grid .action-primary { --action-rgb:59,130,246; --action-color:#60a5fa; }
#tab-dashboard .action-grid .action-payment { --action-rgb:16,185,129; --action-color:#34d399; }
#tab-dashboard .action-grid .action-draft { --action-rgb:245,158,11; --action-color:#fbbf24; }
#tab-dashboard .action-grid .action-refund { --action-rgb:244,63,94; --action-color:#fb7185; }
#tab-dashboard .action-grid .action-verify { --action-rgb:6,182,212; --action-color:#22d3ee; }
#tab-dashboard .action-grid .action-clients { --action-rgb:139,92,246; --action-color:#a78bfa; }
#tab-dashboard .action-grid .action-export-pdf { --action-rgb:239,68,68; --action-color:#f87171; }
#tab-dashboard .action-grid .action-export-excel { --action-rgb:34,197,94; --action-color:#4ade80; }
.history-client-total { margin-top: 7px; color: #6ee7b7; font-size: .8rem; font-weight: 750; overflow-wrap: anywhere; }
.refund-share-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; width: 100%; margin-top: 12px; }
.refund-share-row .share-btn { min-width: 0; padding: 9px 6px; border: 1px solid rgba(148,163,184,.2); text-decoration: none; cursor: pointer; }
.refund-share-row .share-btn span { font-size: .68rem; white-space: normal; }
#tab-history .tab-header-actions, #tab-refunds .tab-header-actions { align-items: center; }
@media(max-width:600px) {
  .refund-share-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #tab-history .tab-header-actions, #tab-refunds .tab-header-actions { width: 100%; }
  #history-create-button, #tab-refunds .add-client-btn { flex: 1; }
}


/* Confirmation de paiement integree a l'interface. */
.payment-confirm-content { position: relative; max-width: 420px; padding: 30px; text-align: center; overflow: visible; }
.payment-confirm-close { position: absolute; top: 12px; right: 12px; }
.payment-confirm-icon { width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center; color: #34d399; font-size: 2rem; background: rgba(16,185,129,.13); border: 1px solid rgba(52,211,153,.32); }
.payment-confirm-content h2 { font-size: 1.3rem; color: var(--text-primary); margin-bottom: 10px; }
.payment-confirm-content p { color: var(--text-secondary); font-size: .92rem; line-height: 1.65; }
.payment-confirm-content p strong { color: #6ee7b7; }
.payment-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.payment-confirm-actions button { min-height: 46px; border-radius: 11px; font-weight: 700; }
.payment-confirm-cancel { color: var(--text-primary); background: var(--bg-hover); border: 1px solid var(--border-color); }
.payment-confirm-accept { color: #052e1f; background: linear-gradient(135deg,#34d399,#10b981); box-shadow: 0 6px 18px rgba(16,185,129,.2); }
.payment-confirm-cancel:hover { background: var(--border-color); }
.payment-confirm-accept:hover { filter: brightness(1.08); }

/* Filtre de periode en veritable modale, stable sur Android et ordinateur. */
.period-control { position: relative; }
.period-select { position: relative; flex: 1; min-width: 0; }
.history-period-native { display: none; }
.period-select-trigger { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; color: var(--text-primary); background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 10px; text-align: left; font-weight: 650; }
.period-select-trigger > i { color: var(--primary-light); font-size: .75rem; }
#tab-history .period-control .period-select-trigger { padding-left: 48px; }
#tab-history .period-control .period-select-trigger > span { min-width: 0; overflow-wrap: anywhere; }
.period-select-trigger[aria-expanded="true"] { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,.14); }
.period-filter-content { max-width: 460px; }
.period-filter-content .modal-header { align-items: flex-start; padding: 20px; }
.period-filter-content .modal-header h2 { font-size: 1.2rem; }
.period-filter-content .modal-header p { margin-top: 4px; color: var(--text-secondary); font-size: .8rem; }
.period-filter-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 16px; overflow-y: auto; }
.period-filter-options button { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border: 1px solid var(--border-color); border-radius: 11px; color: var(--text-secondary); background: var(--bg-body); text-align: left; }
.period-filter-options button > span { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.period-filter-options button > span > i { width: 20px; color: var(--primary-light); text-align: center; }
.period-filter-options button > i { opacity: 0; color: #60a5fa; }
.period-filter-options button:hover, .period-filter-options button:focus-visible { color: var(--text-primary); border-color: var(--primary-light); outline: none; }
.period-filter-options button[aria-selected="true"] { color: #dbeafe; border-color: rgba(96,165,250,.65); background: rgba(37,99,235,.22); }
.period-filter-options button[aria-selected="true"] > i { opacity: 1; }
body.light-mode .period-filter-options button[aria-selected="true"] { color: #1e40af; }
body.light-mode .payment-confirm-accept { color: #052e1f; }

/* Totaux calcules sur tous les resultats filtres. */
.history-overview { display: grid; grid-template-columns: 1.6fr 1fr; gap: 11px; margin: 16px 0; }
.history-overview-card { position: relative; min-width: 0; padding: 16px; border: 1px solid rgba(96,165,250,.25); border-radius: 14px; background: linear-gradient(145deg,rgba(37,99,235,.13),rgba(30,41,59,.88)); }
.history-overview-card.primary { border-color: rgba(16,185,129,.38); background: linear-gradient(145deg,rgba(16,185,129,.15),rgba(30,41,59,.9)); }
.history-overview-card span { display: block; padding-right: 20px; color: var(--text-secondary); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .025em; }
.history-overview-card strong { display: block; margin-top: 7px; color: var(--text-primary); font-size: 1.18rem; line-height: 1.35; overflow-wrap: anywhere; }
.history-overview-card.primary strong { color: #6ee7b7; }
.history-overview-card > i { position: absolute; top: 15px; right: 14px; color: rgba(148,163,184,.28); }
body.light-mode .history-overview-card.primary strong { color: #047857; }

@media(max-width:600px) {
  .payment-confirm-content { padding: 28px 20px 20px; }
  .period-filter-modal { padding: 10px; align-items: flex-end; }
  .period-filter-content { width: 100%; max-height: 88dvh; margin: 0; border-radius: 20px 20px 14px 14px; }
  .period-filter-options { grid-template-columns: 1fr; gap: 8px; padding: 12px 16px 18px; }
  .period-filter-options button { min-height: 50px; font-size: .95rem; }
  .history-overview { gap: 9px; }
  .history-overview-card { padding: 14px 12px; }
  .history-overview-card strong { font-size: 1rem; }
}


/* Versements, reste a payer et categorie sans menu natif Android. */
.category-native-select{display:none}
.category-select-trigger{width:100%;min-height:50px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border:1px solid rgba(96,165,250,.35);border-radius:11px;background:linear-gradient(135deg,rgba(37,99,235,.12),rgba(15,23,42,.82));color:var(--text-primary);text-align:left;font:inherit;font-weight:650;cursor:pointer}
.category-select-trigger>span{display:flex;align-items:center;gap:10px}.category-select-trigger>span>i{color:#60a5fa}.category-select-trigger>i{color:#93c5fd;font-size:.76rem}
.category-select-trigger:hover,.category-select-trigger[aria-expanded="true"]{border-color:#60a5fa;box-shadow:0 0 0 3px rgba(59,130,246,.13)}
.category-filter-content{max-width:440px}.category-filter-content .modal-header{align-items:flex-start;padding:20px}.category-filter-content .modal-header h2{font-size:1.2rem}.category-filter-content .modal-header p{margin-top:5px;color:var(--text-secondary);font-size:.8rem}
.category-filter-options{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:16px;overflow-y:auto}.category-filter-options button{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border:1px solid var(--border-color);border-radius:12px;background:var(--bg-body);color:var(--text-secondary);text-align:left;cursor:pointer}.category-filter-options button>span{display:flex;align-items:center;gap:10px;font-weight:650}.category-filter-options button>span>i{width:20px;color:#60a5fa;text-align:center}.category-filter-options button>i{opacity:0;color:#60a5fa}.category-filter-options button:hover,.category-filter-options button:focus-visible{border-color:#60a5fa;color:var(--text-primary);outline:none}.category-filter-options button[aria-selected="true"]{border-color:rgba(96,165,250,.68);background:linear-gradient(135deg,rgba(37,99,235,.28),rgba(30,64,175,.13));color:#dbeafe}.category-filter-options button[aria-selected="true"]>i{opacity:1}
.payment-breakdown{padding:15px;border:1px solid rgba(16,185,129,.27);border-radius:13px;background:linear-gradient(135deg,rgba(16,185,129,.075),rgba(15,23,42,.45))}.payment-breakdown>label{display:flex;align-items:center;gap:8px;color:#a7f3d0}.payment-breakdown>input{width:100%;box-sizing:border-box;min-height:48px;padding:12px 14px;border:1px solid rgba(52,211,153,.32);border-radius:10px;background:var(--bg-input);color:var(--text-primary);font:inherit}.payment-breakdown>input:focus{border-color:#34d399;box-shadow:0 0 0 3px rgba(16,185,129,.12);outline:none}.payment-breakdown-result{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:11px;padding:11px 12px;border-radius:9px;background:rgba(15,23,42,.58)}.payment-breakdown-result span{color:var(--text-secondary);font-size:.78rem}.payment-breakdown-result strong{color:#fbbf24;font-size:.92rem;overflow-wrap:anywhere;text-align:right}.payment-breakdown>small{display:block;margin-top:9px;color:var(--text-muted);font-size:.7rem;line-height:1.5}
.payment-confirm-total{display:flex;justify-content:space-between;gap:12px;margin-top:17px;padding:12px 14px;border:1px solid var(--border-color);border-radius:10px;background:var(--bg-body)}.payment-confirm-total span{color:var(--text-secondary);font-size:.8rem}.payment-confirm-total strong{color:var(--text-primary);overflow-wrap:anywhere}.payment-confirm-field{margin-top:13px;text-align:left}.payment-confirm-field label{display:block;margin-bottom:7px;color:#a7f3d0;font-size:.8rem;font-weight:700}.payment-confirm-field input{width:100%;box-sizing:border-box;min-height:46px;padding:11px 12px;border:1px solid rgba(52,211,153,.38);border-radius:10px;background:var(--bg-input);color:var(--text-primary);font:inherit}.payment-confirm-field small{display:block;margin-top:7px;color:#fbbf24;font-size:.76rem}
.create-result-status.partial{color:#fbbf24}.receipt-status-partial{color:#fbbf24;border-color:rgba(245,158,11,.4);background:rgba(245,158,11,.11)}.receipt-payment-breakdown{display:flex;flex-wrap:wrap;gap:6px 13px;margin-top:8px;color:var(--text-secondary);font-size:.72rem}.receipt-payment-breakdown strong{color:#6ee7b7}.receipt-payment-breakdown .remaining strong{color:#fbbf24}
.history-overview{grid-template-columns:1.4fr .8fr 1.15fr}.history-overview-card.remaining{width:100%;border-color:rgba(245,158,11,.32);background:linear-gradient(145deg,rgba(245,158,11,.1),rgba(30,41,59,.88));color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color .18s,background .18s,transform .18s}.history-overview-card.remaining strong{color:#fbbf24}.history-overview-card.remaining:hover{border-color:rgba(251,191,36,.7);background:linear-gradient(145deg,rgba(245,158,11,.17),rgba(30,41,59,.94));transform:translateY(-2px)}.history-overview-card.remaining:focus-visible{outline:3px solid rgba(251,191,36,.42);outline-offset:3px}.history-overview-card.remaining[aria-pressed="true"]{border-color:#fbbf24;box-shadow:0 0 0 2px rgba(251,191,36,.12)}.history-overview-card.remaining small{display:block;margin-top:7px;color:#fcd34d;font-size:.64rem;font-weight:650;line-height:1.4}
.refund-receipt-summary{grid-template-columns:repeat(5,minmax(0,1fr))}.refund-summary-cell{min-width:0}.refund-summary-cell strong{overflow-wrap:anywhere}
body.light-mode .category-filter-options button[aria-selected="true"]{color:#1e40af}body.light-mode .payment-breakdown>label{color:#047857}body.light-mode .payment-breakdown-result{background:rgba(226,232,240,.65)}
@media(max-width:760px){.refund-receipt-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.category-filter-modal{padding:10px;align-items:flex-end}.category-filter-content{width:100%;max-height:82dvh;margin:0;border-radius:20px 20px 14px 14px}.category-filter-options{grid-template-columns:1fr;gap:8px;padding:12px 16px 18px}.category-filter-options button{min-height:52px}.history-overview{grid-template-columns:1fr 1fr}.history-overview-card.primary{grid-column:1/-1}.history-overview-card.remaining{grid-column:auto}.payment-confirm-content{max-height:90dvh;overflow-y:auto}}


/* Consentements marketing explicites et revocables. */
.clients-marketing-filter{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:11px 13px;border:1px solid rgba(51,65,85,.9);border-radius:12px;background:rgba(15,23,42,.72)}
.clients-marketing-filter label{color:var(--text-secondary);font-size:.76rem;font-weight:650}
.clients-marketing-filter select{max-width:58%;padding:8px 10px;border:1px solid rgba(96,165,250,.3);border-radius:9px;background:var(--bg-input);color:var(--text-primary);font:inherit;font-size:.76rem}
.client-marketing-badges{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}.client-marketing-badge{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border:1px solid rgba(16,185,129,.3);border-radius:999px;background:rgba(16,185,129,.08);color:#6ee7b7;font-size:.65rem;font-weight:700}
.client-marketing-panel{margin-top:18px;padding:16px;border:1px solid rgba(59,130,246,.24);border-radius:13px;background:rgba(37,99,235,.06)}
.client-marketing-panel h3{color:var(--text-primary);font-size:.92rem}.client-marketing-panel>p{margin-top:6px;color:var(--text-secondary);font-size:.72rem;line-height:1.55}
.client-marketing-channel{margin-top:13px;padding-top:13px;border-top:1px solid var(--border-color)}
.client-marketing-channel-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.client-marketing-channel-head strong{color:var(--text-primary);font-size:.82rem}.client-marketing-status{color:var(--text-secondary);font-size:.69rem;line-height:1.5}.client-marketing-status.accepted{color:#6ee7b7}.client-marketing-status.refused{color:#fda4af}
.client-marketing-actions{display:grid;grid-template-columns:1fr;gap:7px;margin-top:10px}.client-marketing-actions button{min-height:39px;padding:8px 10px;border:1px solid rgba(96,165,250,.28);border-radius:9px;background:rgba(37,99,235,.12);color:#93c5fd;font:inherit;font-size:.7rem;font-weight:700;cursor:pointer}.client-marketing-actions button.send-offer{border-color:rgba(16,185,129,.3);background:rgba(16,185,129,.1);color:#6ee7b7}.client-marketing-actions button.revoke{border-color:rgba(244,63,94,.25);background:rgba(244,63,94,.07);color:#fda4af}.client-marketing-actions button:disabled{opacity:.6;cursor:wait}
@media(max-width:480px){.clients-marketing-filter{align-items:stretch;flex-direction:column}.clients-marketing-filter select{max-width:100%;min-height:42px}}

/* Noms clients : seul le nom ouvre la fiche, sans declencher la carte du document. */
.receipt-client-name-link {
display: block; max-width: 100%; padding: 0; border: 0; background: none;
font-family: inherit; text-align: left; cursor: pointer;
}
.receipt-client-name-link:hover, .receipt-client-name-link:focus-visible,
.receipt-detail-client-link:hover, .receipt-detail-client-link:focus-visible,
.refund-modal-client-link:hover, .refund-modal-client-link:focus-visible {
color: #60a5fa; text-decoration: underline; text-underline-offset: 3px;
}
.receipt-client-name-link:focus-visible, .receipt-detail-client-link:focus-visible,
.refund-modal-client-link:focus-visible { outline: 2px solid #60a5fa; outline-offset: 3px; }
.receipt-detail-client-link {
margin: 0; padding: 0; border: 0; background: none; color: #f8fafc;
font: inherit; font-size: 1.25rem; font-weight: 750; text-align: left;
overflow-wrap: anywhere; cursor: pointer;
}
.refund-modal-client-link {
padding: 0; border: 0; background: none; color: #f1f5f9;
font: inherit; font-weight: 750; cursor: pointer;
}

/* Les quatre actions du detail reprennent exactement les cartes de l'accueil. */
#receipt-detail-refund, #receipt-detail-public, #receipt-detail-pdf, #receipt-detail-excel {
--action-rgb: 59,130,246;
border: 1px solid rgba(var(--action-rgb),.5) !important;
background: linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65)) !important;
box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12);
color: var(--text-primary) !important;
filter: none;
transition: all .2s;
}
#receipt-detail-refund { --action-rgb: 244,63,94; }
#receipt-detail-public { --action-rgb: 59,130,246; }
#receipt-detail-pdf { --action-rgb: 239,68,68; }
#receipt-detail-excel { --action-rgb: 34,197,94; }
#receipt-detail-refund:hover, #receipt-detail-refund:focus-visible,
#receipt-detail-public:hover, #receipt-detail-public:focus-visible,
#receipt-detail-pdf:hover, #receipt-detail-pdf:focus-visible,
#receipt-detail-excel:hover, #receipt-detail-excel:focus-visible {
border-color: rgba(var(--action-rgb),.85) !important;
background: linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7)) !important;
color: var(--text-primary) !important;
filter: none;
transform: translateY(-2px);
}

/* Systeme visuel commun : toutes les actions reprennent les cartes de l'accueil. */
.btn-primary, .btn-secondary, .btn-danger, .btn-logout,
.btn-export, .location-search-btn, .location-current-btn {
--action-rgb: 59,130,246;
border: 1px solid rgba(var(--action-rgb),.5) !important;
background: linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65)) !important;
box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12);
color: var(--text-primary) !important;
filter: none;
transition: all .2s;
}
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover, .btn-logout:hover,
.btn-export:hover, .location-search-btn:hover, .location-current-btn:hover,
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-danger:focus-visible, .btn-logout:focus-visible,
.btn-export:focus-visible, .location-search-btn:focus-visible, .location-current-btn:focus-visible {
border-color: rgba(var(--action-rgb),.85) !important;
background: linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7)) !important;
box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12);
color: var(--text-primary) !important;
filter: none;
transform: translateY(-2px);
}
.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled, .btn-logout:disabled,
.btn-export:disabled, .location-search-btn:disabled, .location-current-btn:disabled {
opacity: .5; cursor: not-allowed; transform: none;
}

/* Bleu : actions principales, profil, recherche et export de donnees. */
#tab-profile .avatar-actions .btn-primary,
#tab-profile .form-group > .btn-primary,
#tab-profile > .btn-primary,
#tab-profile .form-card > .btn-secondary {
--action-rgb: 59,130,246;
}

/* Vert : Excel et confirmations de paiement. */
#main-screen .btn-export.btn-export-excel,
#export-submit.export-submit-excel, #receipt-detail-excel,
.receipt-downloads .btn-text.receipt-download-excel {
--action-rgb: 34,197,94;
}

#create-submit, #receipt-detail-pay,
.receipt-downloads .btn-text.receipt-pay-btn {
--action-rgb: 16,185,129;
}

/* Rouge : PDF. */
#main-screen .btn-export.btn-export-pdf,
#export-submit.export-submit-pdf, #receipt-detail-pdf,
.receipt-downloads .btn-text.receipt-download-pdf {
--action-rgb: 239,68,68;
}

/* Rose : remboursements et actions sensibles. */
.btn-primary.refund-submit, #receipt-detail-refund,
.client-info-actions .btn-secondary,
.btn-danger, .btn-logout, #tab-refunds .add-client-btn {
--action-rgb: 244,63,94;
}

/* Ambre : enregistrement d'un brouillon. */
#create-save-draft { --action-rgb: 245,158,11; }

/* Cyan : geolocalisation. */
.location-current-btn { --action-rgb: 6,182,212; }

/* Les variantes colorees utilisent le meme fond et le meme effet que les boutons principaux. */
#main-screen .btn-export.btn-export-excel,
#main-screen .btn-export.btn-export-pdf,
#export-submit.export-submit-excel,
#export-submit.export-submit-pdf,
#create-submit, #create-save-draft, #receipt-detail-pay,
#receipt-detail-refund, #receipt-detail-pdf, #receipt-detail-excel,
.btn-primary.refund-submit, .client-info-actions .btn-secondary,
.btn-danger, .btn-logout, .location-current-btn, #tab-refunds .add-client-btn,
.receipt-downloads .btn-text.receipt-download-excel,
.receipt-downloads .btn-text.receipt-download-pdf,
.receipt-downloads .btn-text.receipt-pay-btn {
border: 1px solid rgba(var(--action-rgb),.5) !important;
background: linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65)) !important;
box-shadow: inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12);
color: var(--text-primary) !important;
filter: none;
transition: all .2s;
}
#main-screen .btn-export.btn-export-excel:hover, #main-screen .btn-export.btn-export-pdf:hover,
#export-submit.export-submit-excel:hover, #export-submit.export-submit-pdf:hover,
#create-submit:hover, #create-save-draft:hover, #receipt-detail-pay:hover,
#receipt-detail-refund:hover, #receipt-detail-pdf:hover, #receipt-detail-excel:hover,
.btn-primary.refund-submit:hover, .client-info-actions .btn-secondary:hover,
.btn-danger:hover, .btn-logout:hover, .location-current-btn:hover, #tab-refunds .add-client-btn:hover,
.receipt-downloads .btn-text.receipt-download-excel:hover,
.receipt-downloads .btn-text.receipt-download-pdf:hover,
.receipt-downloads .btn-text.receipt-pay-btn:hover {
border-color: rgba(var(--action-rgb),.85) !important;
background: linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7)) !important;
color: var(--text-primary) !important;
filter: none;
transform: translateY(-2px);
}

/* Position actuelle : bouton et contenu parfaitement centres dans chaque formulaire. */
.location-picker .location-current-btn {
display: flex !important;
width: 100%;
margin-left: auto !important;
margin-right: auto !important;
align-items: center;
justify-content: center;
gap: 8px;
text-align: center;
}
.location-picker .location-current-btn > i {
margin: 0;
}

/* Medias du profil : persistance, visionneuse et controle du logo. */
.avatar-view-button, .logo-view-button {
padding: 0;
border: 1px solid rgba(96,165,250,.42);
cursor: zoom-in;
overflow: hidden;
box-shadow: 0 10px 26px rgba(2,6,23,.24);
transition: transform .2s, border-color .2s, box-shadow .2s;
}
.avatar-view-button:hover, .logo-view-button:hover {
transform: translateY(-2px);
border-color: rgba(147,197,253,.85);
box-shadow: 0 14px 32px rgba(2,6,23,.34), 0 0 0 4px rgba(59,130,246,.08);
}
.avatar-view-button:focus-visible, .logo-view-button:focus-visible,
.logo-option-card:focus-visible {
outline: 3px solid rgba(96,165,250,.6);
outline-offset: 3px;
}
.logo-view-button { background: rgba(15,23,42,.65); }
.media-click-hint { margin: -3px 0 10px; color: var(--text-muted); font-size: .72rem; }
body.media-viewer-open { overflow: hidden; }
.media-modal { z-index: 1200; padding: 18px; }
.media-viewer-content { width: min(920px, 100%); max-height: calc(100dvh - 36px); display: flex; flex-direction: column; }
.media-viewer-stage {
min-height: 220px;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
overflow: auto;
border-radius: 16px;
background: radial-gradient(circle at 50% 25%, rgba(59,130,246,.12), transparent 52%), rgba(2,6,23,.72);
border: 1px solid rgba(148,163,184,.16);
}
.media-viewer-stage img { display: block; max-width: 100%; max-height: calc(100dvh - 230px); object-fit: contain; border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.32); }
.media-modal-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding-top: 16px; }
.media-modal-actions .btn-secondary { --action-rgb: 59,130,246; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.logo-options-content { width: min(650px, 100%); }
.logo-options-grid { display: grid; gap: 13px; }
.logo-option-card {
--action-rgb: 59,130,246;
display: grid;
grid-template-columns: 50px minmax(0,1fr) 20px;
align-items: center;
gap: 14px;
width: 100%;
padding: 17px;
text-align: left;
color: var(--text-primary);
border: 1px solid rgba(var(--action-rgb),.42);
border-radius: 15px;
background: linear-gradient(145deg,rgba(var(--action-rgb),.18),rgba(15,23,42,.64));
cursor: pointer;
transition: all .2s;
}
.logo-option-card:hover { transform: translateY(-2px); border-color: rgba(var(--action-rgb),.82); background: linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(15,23,42,.72)); }
.logo-option-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 13px; color: #bfdbfe; background: rgba(59,130,246,.18); font-size: 1.2rem; }
.logo-option-card strong, .logo-option-card small { display: block; }
.logo-option-card strong { margin-bottom: 5px; font-size: .95rem; }
.logo-option-card small { color: var(--text-secondary); line-height: 1.45; }
.logo-option-card > i { color: var(--text-muted); }
.logo-receipt-example-content { width: min(760px, 100%); max-height: calc(100dvh - 36px); display: flex; flex-direction: column; }
.logo-example-scroll { overflow: auto; padding: 3px; }
.logo-receipt-sample { overflow: hidden; color: #1e293b; background: #f1f5f9; border: 1px solid #dbe3ed; border-radius: 18px; font-family: Arial, Helvetica, sans-serif; }
.logo-example-notice { padding: 9px 14px; text-align: center; color: #92400e; background: #fef3c7; border-bottom: 1px solid #fde68a; font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.logo-example-custom { margin: 20px 24px 16px; padding: 12px; text-align: center; color: #2563eb; background: white; border: 1px solid #dbe3ed; border-radius: 10px; font-size: .85rem; font-weight: 700; }
.logo-example-brand { display: flex; align-items: center; gap: 16px; padding: 0 24px 22px; background: white; margin: 0 24px; border-radius: 12px; }
.logo-example-image-wrap { flex: 0 0 76px; width: 76px; height: 76px; display: grid; place-items: center; padding: 8px; background: #f8fafc; border: 1px solid #dbe3ed; border-radius: 14px; }
.logo-example-image-wrap img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-example-brand h3 { margin: 0 0 6px; color: #0f172a; font-size: 1.12rem; }
.logo-example-brand p { margin: 0 0 4px; color: #475569; font-size: .76rem; }
.logo-example-brand small { color: #64748b; font-size: .65rem; }
.logo-example-reference { padding: 13px 24px 0; color: #64748b; font-family: monospace; font-size: .7rem; }
.logo-example-amount { margin: 0 0 16px; padding: 20px 24px; text-align: center; background: white; }
.logo-example-amount span, .logo-example-amount small { display: block; color: #64748b; font-size: .65rem; }
.logo-example-amount strong { display: block; margin: 12px 0; color: #0f172a; font-size: 2.2rem; }
.logo-example-details { margin: 0 24px 20px; padding: 18px; background: white; border: 1px solid #dbe3ed; border-radius: 12px; }
.logo-example-details h4 { margin: 0 0 13px; color: #2563eb; font-size: .67rem; letter-spacing: .08em; }
.logo-example-details > div { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-top: 1px solid #edf2f7; font-size: .73rem; }
.logo-example-details span { color: #64748b; }
.logo-example-details strong { text-align: right; }
.logo-receipt-sample footer { padding: 14px 24px 22px; text-align: center; color: #64748b; font-size: .72rem; }
@media (max-width: 600px) {
.media-modal { padding: 10px; }
.media-viewer-content, .logo-receipt-example-content { max-height: calc(100dvh - 20px); }
.media-viewer-stage { padding: 10px; }
.media-viewer-stage img { max-height: calc(100dvh - 210px); }
.logo-option-card { grid-template-columns: 43px minmax(0,1fr) 15px; gap: 11px; padding: 14px; }
.logo-option-icon { width: 43px; height: 43px; }
.logo-example-custom { margin: 14px 14px 12px; }
.logo-example-brand { gap: 11px; margin: 0 14px; padding: 0 0 16px; }
.logo-example-image-wrap { flex-basis: 64px; width: 64px; height: 64px; }
.logo-example-brand h3 { font-size: .96rem; }
.logo-example-details { margin: 0 14px 14px; padding: 14px; }
.logo-example-amount { padding: 18px 14px; }
.media-modal-actions .btn-secondary { flex: 1; }
}

/* Aperçu commerçant : document sobre, lisible et commun aux deux thèmes. */
#receipt-detail-modal .receipt-detail-content {
--preview-bg: #141414;
--preview-surface: #1b1d21;
--preview-text: #f5f7fa;
--preview-muted: #a0a7b3;
--preview-line: rgba(160,167,179,.2);
width: min(760px, 100%);
background: var(--bg-card);
}
#receipt-detail-modal .receipt-detail-body { padding: 22px; }
.receipt-preview-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.receipt-preview-intro > span { display: inline-flex; align-items: center; gap: 8px; color: var(--text-primary); font-size: .82rem; font-weight: 750; }
.receipt-preview-intro > span i { color: #60a5fa; }
.receipt-preview-intro > small { color: var(--text-secondary); font-size: .72rem; text-align: right; }
.receipt-preview-document {
overflow: hidden;
padding: 28px;
color: var(--preview-text);
background: var(--preview-bg);
border: 1px solid var(--preview-line);
border-radius: 18px;
box-shadow: 0 22px 50px rgba(0,0,0,.18);
font-family: 'Manrope', sans-serif;
}
.receipt-preview-brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--preview-line); }
.receipt-preview-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.receipt-detail-logo, .receipt-detail-logo-fallback { flex: 0 0 54px; width: 54px; height: 54px; border-radius: 12px; }
.receipt-detail-logo { padding: 5px; object-fit: contain; background: #fff; border: 1px solid var(--preview-line); }
.receipt-detail-logo-fallback { display: grid; place-items: center; color: #fff; background: #0064e6; font-size: 1.15rem; }
.receipt-preview-identity strong, .receipt-preview-identity small { display: block; overflow-wrap: anywhere; }
.receipt-preview-identity strong { color: var(--preview-text); font-size: .95rem; line-height: 1.35; }
.receipt-preview-identity small { margin-top: 4px; color: var(--preview-muted); font-size: .68rem; line-height: 1.45; }
.receipt-preview-type { flex-shrink: 0; color: var(--preview-muted); font-size: .64rem; font-weight: 800; letter-spacing: .13em; }
.receipt-detail-hero { padding: 24px 0 20px; border: 0; }
.receipt-preview-label { display: block; margin-bottom: 6px; color: var(--preview-muted); font-size: .72rem; font-weight: 650; }
#receipt-detail-modal .receipt-detail-client-link { color: var(--preview-text); font-family: 'Manrope', sans-serif; font-size: 1.35rem; line-height: 1.35; }
.receipt-detail-id { color: var(--preview-muted); font-family: 'SFMono-Regular', Consolas, monospace; }
.receipt-detail-status-line { flex-wrap: wrap; }
.receipt-detail-date { color: var(--preview-muted); font-size: .72rem; }
.receipt-detail-total { margin: 0 0 20px; padding: 24px 20px; text-align: center; background: var(--preview-surface); border-top: 1px solid var(--preview-line); border-bottom: 1px solid var(--preview-line); }
.receipt-detail-total > span { display: block; margin-bottom: 9px; color: var(--preview-muted); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.receipt-detail-amount { max-width: 100%; color: var(--preview-text); font-size: clamp(1.75rem, 6vw, 2.6rem); line-height: 1.2; text-align: center; letter-spacing: -.035em; }
.receipt-detail-grid { gap: 0 24px; margin: 0; }
.receipt-detail-cell { padding: 15px 0; background: transparent; border: 0; border-bottom: 1px solid var(--preview-line); border-radius: 0; }
.receipt-detail-cell span { margin-bottom: 5px; color: var(--preview-muted); font-size: .72rem; }
.receipt-detail-cell strong { color: var(--preview-text); font-size: .92rem; font-weight: 650; }
.receipt-detail-cell-wide { padding-bottom: 4px; border-bottom: 0; }
.receipt-detail-refund-summary { margin-top: 18px; margin-bottom: 0; }
.receipt-detail-refund-summary > div { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.25); }
.receipt-detail-refund-summary span { color: var(--preview-muted); }
.receipt-detail-actions { margin-top: 18px; }
#receipt-detail-modal .receipt-detail-actions .btn-secondary,
#receipt-detail-modal .receipt-detail-actions .btn-primary { min-height: 48px; font-family: 'Manrope', sans-serif; font-size: .78rem; }
body.light-mode #receipt-detail-modal .receipt-detail-content {
--preview-bg: #ffffff;
--preview-surface: #f4f7fb;
--preview-text: #111827;
--preview-muted: #5b6472;
--preview-line: #dfe5ec;
}
body.light-mode #receipt-detail-modal .receipt-preview-document { box-shadow: 0 18px 42px rgba(15,23,42,.08); }
body.light-mode #receipt-detail-modal .receipt-detail-actions .btn-primary,
body.light-mode #receipt-detail-modal .receipt-detail-actions .btn-secondary {
background: linear-gradient(145deg,rgba(var(--action-rgb),.14),rgba(var(--action-rgb),.055) 58%,rgba(255,255,255,.9)) !important;
box-shadow: none;
}
body.light-mode #receipt-detail-modal .receipt-detail-actions .btn-primary:hover,
body.light-mode #receipt-detail-modal .receipt-detail-actions .btn-secondary:hover {
background: linear-gradient(145deg,rgba(var(--action-rgb),.22),rgba(var(--action-rgb),.09) 58%,#fff) !important;
}
body.light-mode #receipt-detail-modal .receipt-detail-refund-summary span { color: #78716c; }
@media (max-width: 600px) {
#receipt-detail-modal .receipt-detail-body { padding: 14px; }
.receipt-preview-intro { align-items: flex-start; flex-direction: column; gap: 4px; }
.receipt-preview-intro > small { text-align: left; }
.receipt-preview-document { padding: 19px 16px; border-radius: 15px; }
.receipt-preview-brand { align-items: flex-start; gap: 12px; }
.receipt-preview-type { padding-top: 5px; font-size: .55rem; }
.receipt-detail-logo, .receipt-detail-logo-fallback { flex-basis: 46px; width: 46px; height: 46px; }
.receipt-detail-hero { padding: 20px 0 17px; }
.receipt-detail-total { padding: 20px 12px; }
.receipt-detail-grid { grid-template-columns: 1fr; }
.receipt-detail-cell-wide { padding-bottom: 15px; border-bottom: 1px solid var(--preview-line); }
.receipt-detail-refund-summary { grid-template-columns: 1fr; }
}

/* Priorité sur les anciens styles inline du détail : rendu identique dans les deux thèmes. */
#receipt-detail-modal .receipt-detail-hero { padding: 24px 0 20px; border: 0; }
#receipt-detail-modal .receipt-detail-amount { max-width: 100%; color: var(--preview-text); font-size: clamp(1.75rem,6vw,2.6rem); line-height: 1.2; text-align: center; letter-spacing: -.035em; }
#receipt-detail-modal .receipt-detail-grid { gap: 0 24px; margin: 0; }
#receipt-detail-modal .receipt-detail-cell { padding: 15px 0; background: transparent; border: 0; border-bottom: 1px solid var(--preview-line); border-radius: 0; }
#receipt-detail-modal .receipt-detail-cell span { margin-bottom: 5px; color: var(--preview-muted); font-size: .72rem; }
#receipt-detail-modal .receipt-detail-cell strong { color: var(--preview-text); font-size: .92rem; font-weight: 650; }
#receipt-detail-modal .receipt-detail-cell-wide { padding-bottom: 4px; border-bottom: 0; }
#receipt-detail-modal .receipt-detail-refund-summary { margin: 18px 0 0; }
#receipt-detail-modal .receipt-detail-refund-summary > div { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.25); }
#receipt-detail-modal .receipt-detail-refund-summary span { color: var(--preview-muted); }
#receipt-detail-modal .receipt-detail-actions { margin-top: 18px; }
@media (max-width:600px) {
#receipt-detail-modal .receipt-detail-hero { padding: 20px 0 17px; }
#receipt-detail-modal .receipt-detail-amount { text-align: center; }
#receipt-detail-modal .receipt-detail-grid { grid-template-columns: 1fr; }
#receipt-detail-modal .receipt-detail-cell-wide { padding-bottom: 15px; border-bottom: 1px solid var(--preview-line); }
#receipt-detail-modal .receipt-detail-refund-summary { grid-template-columns: 1fr; }
}

body.light-mode #receipt-detail-modal .receipt-detail-status-line .receipt-status-pending,
body.light-mode #receipt-detail-modal .receipt-detail-status-line .receipt-status-partial { color: #92400e; }
body.light-mode #receipt-detail-modal .receipt-detail-status-line .receipt-status-confirmed { color: #047857; }


/* Textes personnalisés : même hiérarchie que la page publique et le PDF. */
#receipt-detail-modal .receipt-preview-custom-header {
padding-bottom: 13px;
color: var(--preview-text);
font-size: .69rem;
line-height: 1.45;
font-weight: 750;
letter-spacing: .1em;
text-transform: uppercase;
overflow-wrap: anywhere;
}
#receipt-detail-modal .receipt-preview-footer {
margin-top: 18px;
padding-top: 15px;
border-top: 1px solid var(--preview-line);
color: var(--preview-muted);
font-size: .72rem;
line-height: 1.65;
font-weight: 550;
overflow-wrap: anywhere;
}

/* Aperçu commerçant simplifié : même lecture documentaire que la page publique. */
#receipt-detail-modal .receipt-detail-content {
--preview-bg: #1b1b19;
--preview-surface: #22221f;
--preview-text: #faf9f5;
--preview-muted: #aaa9a1;
--preview-line: #353530;
width: min(700px,100%);
}
#receipt-detail-modal .receipt-detail-body { padding: 18px 22px 22px; }
#receipt-detail-modal .receipt-preview-intro { margin-bottom: 12px; }
#receipt-detail-modal .receipt-preview-intro > span { color: var(--text-primary); font-size: .76rem; font-weight: 650; }
#receipt-detail-modal .receipt-preview-intro > small { color: var(--text-secondary); font-size: .68rem; }
#receipt-detail-modal .receipt-preview-document { padding: 25px 27px; border-radius: 8px; box-shadow: 0 10px 30px rgba(25,25,25,.12); }
#receipt-detail-modal .receipt-preview-brand { padding-bottom: 18px; }
#receipt-detail-modal .receipt-detail-logo,
#receipt-detail-modal .receipt-detail-logo-fallback { flex-basis: 50px; width: 50px; height: 50px; border-radius: 8px; }
#receipt-detail-modal .receipt-detail-hero { padding: 20px 0 16px; }
#receipt-detail-modal .receipt-detail-client-link { font-size: 1.2rem; }
#receipt-detail-modal .receipt-detail-total { margin-bottom: 8px; padding: 20px 0; background: transparent; text-align: left; }
#receipt-detail-modal .receipt-detail-total > span { margin-bottom: 7px; font-size: .63rem; letter-spacing: .09em; }
#receipt-detail-modal .receipt-detail-amount { font-size: clamp(1.9rem,5vw,2.45rem); font-weight: 700; text-align: left; letter-spacing: -.045em; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
#receipt-detail-modal .receipt-detail-cell { padding: 12px 0; }
#receipt-detail-modal .receipt-detail-cell span { font-size: .68rem; }
#receipt-detail-modal .receipt-detail-cell strong { font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
#receipt-detail-modal .receipt-detail-status-line { gap: 9px; }
#receipt-detail-modal .receipt-detail-status-line .receipt-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; font-size: .7rem; font-weight: 650; }
#receipt-detail-modal .receipt-detail-status-line .receipt-status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
#receipt-detail-modal .receipt-detail-date { font-size: .68rem; }
#receipt-detail-modal .receipt-detail-refund-summary { gap: 20px; margin-top: 12px; }
#receipt-detail-modal .receipt-detail-refund-summary > div { padding: 12px 0; background: transparent; border: 0; border-top: 1px solid var(--preview-line); border-radius: 0; }
#receipt-detail-modal .receipt-detail-refund-summary strong { font-variant-numeric: tabular-nums; }
#receipt-detail-modal .receipt-detail-actions { gap: 9px; margin-top: 16px; }
#receipt-detail-modal .receipt-detail-actions .btn-primary,
#receipt-detail-modal .receipt-detail-actions .btn-secondary { min-height: 44px; border-radius: 8px; font-size: .74rem; }
body.light-mode #receipt-detail-modal .receipt-detail-content {
--preview-bg: #ffffff;
--preview-surface: #f5f4f0;
--preview-text: #191919;
--preview-muted: #6f6e68;
--preview-line: #e5e4df;
}
body.light-mode #receipt-detail-modal .receipt-preview-document { box-shadow: 0 10px 30px rgba(25,25,25,.08); }
body.light-mode #receipt-detail-modal .receipt-detail-status-line .receipt-status-pending,
body.light-mode #receipt-detail-modal .receipt-detail-status-line .receipt-status-partial { color: #92400e; }
body.light-mode #receipt-detail-modal .receipt-detail-status-line .receipt-status-confirmed { color: #047857; }
@media (max-width:600px) {
#receipt-detail-modal .receipt-detail-body { padding: 13px; }
#receipt-detail-modal .receipt-preview-intro { align-items: center; flex-direction: row; gap: 10px; }
#receipt-detail-modal .receipt-preview-intro > small { text-align: right; }
#receipt-detail-modal .receipt-preview-document { padding: 20px 17px; border-radius: 8px; }
#receipt-detail-modal .receipt-detail-hero { padding: 19px 0 15px; }
#receipt-detail-modal .receipt-detail-total { padding: 18px 0; }
#receipt-detail-modal .receipt-detail-amount { text-align: left; }
#receipt-detail-modal .receipt-detail-refund-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
}
@media (max-width:390px) {
#receipt-detail-modal .receipt-preview-intro { align-items: flex-start; flex-direction: column; gap: 2px; }
#receipt-detail-modal .receipt-preview-intro > small { text-align: left; }
}
@media (max-width:340px) {
.receipt-preview-brand { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
.receipt-preview-identity { width: 100%; }
.receipt-preview-identity > div { flex: 1; min-width: 0; }
.receipt-preview-type { padding-top: 0; font-size: .55rem; letter-spacing: .1em; white-space: normal; }
.receipt-detail-cell strong, .receipt-detail-id { overflow-wrap: anywhere; }
}


/* Sélecteur de couleur RECEIPT : teintes de l'interface, choix visible et option personnalisée. */
.brand-color-field { margin-bottom: 0; }
.brand-color-picker { position: relative; display: grid; gap: 14px; }
.brand-color-current {
display: flex; align-items: center; gap: 11px; min-width: 0; padding-bottom: 13px;
border-bottom: 1px solid var(--border-color);
}
.brand-color-current-swatch {
flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid rgba(148,163,184,.32);
border-radius: 9px; background: #2563eb; box-shadow: inset 0 0 0 3px rgba(255,255,255,.12);
transition: background-color .18s;
}
.brand-color-current > div { flex: 1; min-width: 0; }
.brand-color-current small, .brand-color-current strong { display: block; }
.brand-color-current small { color: var(--text-muted); font-size: .66rem; line-height: 1.35; }
.brand-color-current strong { margin-top: 2px; color: var(--text-primary); font-size: .79rem; line-height: 1.4; overflow-wrap: anywhere; }
.brand-color-current code { flex-shrink: 0; color: var(--text-secondary); font-size: .7rem; font-weight: 650; letter-spacing: .035em; }
.brand-color-option[data-color="#2563eb"] { --swatch-light:#60a5fa; --swatch-dark:#1d4ed8; }
.brand-color-option[data-color="#10b981"] { --swatch-light:#34d399; --swatch-dark:#059669; }
.brand-color-option[data-color="#ef4444"] { --swatch-light:#f87171; --swatch-dark:#dc2626; }
.brand-color-option[data-color="#06b6d4"] { --swatch-light:#22d3ee; --swatch-dark:#0891b2; }
.brand-color-option[data-color="#f59e0b"] { --swatch-light:#fbbf24; --swatch-dark:#d97706; }
.brand-color-option[data-color="#f43f5e"] { --swatch-light:#fb7185; --swatch-dark:#e11d48; }
.brand-color-option[data-color="#7c3aed"] { --swatch-light:#a78bfa; --swatch-dark:#6d28d9; }
.brand-color-option[data-color="#64748b"] { --swatch-light:#94a3b8; --swatch-dark:#475569; }
.brand-color-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.brand-color-option {
appearance: none; display: grid; place-items: center; gap: 7px; min-width: 0; min-height: 68px;
padding: 8px 5px 7px; color: var(--text-secondary);
background: linear-gradient(145deg,color-mix(in srgb,var(--swatch) 18%,transparent),color-mix(in srgb,var(--swatch) 5%,transparent) 62%,transparent);
border: 1px solid color-mix(in srgb,var(--swatch) 38%,var(--border-color)); border-radius: 10px; font: inherit; cursor: pointer;
transition: transform .16s, border-color .16s, background-color .16s;
}
.brand-color-option:hover { transform: translateY(-1px); border-color: var(--swatch-light); background: linear-gradient(145deg,color-mix(in srgb,var(--swatch) 26%,transparent),color-mix(in srgb,var(--swatch) 8%,transparent) 65%,transparent); }
.brand-color-option:focus-visible, .brand-color-custom:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 3px; }
.brand-color-option[aria-checked="true"] { border-color: var(--swatch-light); background: linear-gradient(145deg,color-mix(in srgb,var(--swatch) 27%,transparent),color-mix(in srgb,var(--swatch) 8%,transparent) 65%,transparent); box-shadow: 0 0 0 1px color-mix(in srgb,var(--swatch-light) 70%,transparent),0 6px 18px color-mix(in srgb,var(--swatch) 14%,transparent); }
.brand-color-sample {
display: grid; place-items: center; width: 38px; height: 30px; border-radius: 8px;
background: linear-gradient(145deg,var(--swatch-light),var(--swatch) 58%,var(--swatch-dark));
box-shadow: inset 0 1px 0 rgba(255,255,255,.24),0 4px 12px color-mix(in srgb,var(--swatch) 28%,transparent);
}
.brand-color-sample i { color: #fff; font-size: .75rem; opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.brand-color-option[aria-checked="true"] .brand-color-sample i { opacity: 1; transform: scale(1); }
.brand-color-option small { max-width: 100%; color: inherit; font-size: .65rem; line-height: 1.2; overflow-wrap: anywhere; }
.brand-color-option[aria-checked="true"] small { color: var(--text-primary); font-weight: 700; }
.brand-color-custom {
appearance: none; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 49px;
padding: 9px 12px; color: var(--text-primary); background: transparent; border: 1px dashed var(--border-color);
border-radius: 10px; font: inherit; text-align: left; cursor: pointer; transition: border-color .16s, background-color .16s;
}
.brand-color-custom:hover, .brand-color-custom.is-custom-selected { border-color: var(--primary-light); background: var(--bg-hover); }
.brand-color-custom > i:first-child { width: 18px; color: var(--primary-light); text-align: center; }
.brand-color-custom > span { flex: 1; min-width: 0; }
.brand-color-custom strong, .brand-color-custom small { display: block; }
.brand-color-custom strong { font-size: .75rem; }
.brand-color-custom small { margin-top: 2px; color: var(--text-muted); font-size: .65rem; }
.brand-color-custom > i:last-child { color: var(--text-muted); font-size: .65rem; }
.brand-color-native { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; pointer-events: none; border: 0; }
body.light-mode .brand-color-current-swatch { box-shadow: inset 0 0 0 3px rgba(255,255,255,.28); }
body.light-mode .brand-color-option[aria-checked="true"] { background: linear-gradient(145deg,color-mix(in srgb,var(--swatch) 18%,transparent),color-mix(in srgb,var(--swatch) 5%,transparent)); }
body.light-mode .brand-color-custom:hover, body.light-mode .brand-color-custom.is-custom-selected { background: #f8fafc; }
@media (max-width:420px) {
.brand-color-grid { gap: 7px; }
.brand-color-option { min-height: 65px; padding-inline: 4px; }
.brand-color-current code { font-size: .65rem; }
}

/* RECEIPT Recurrence V1 — styles limites aux echeanciers et a leur preparation. */
.schedule-intro {
display:flex;align-items:flex-start;gap:11px;margin:0 0 16px;padding:13px 15px;
border:1px solid rgba(6,182,212,.24);border-radius:12px;background:rgba(6,182,212,.07);color:var(--text-secondary);
}
.schedule-intro i { flex:0 0 auto;margin-top:3px;color:#22d3ee; }
.schedule-intro p { margin:0;font-size:.78rem;line-height:1.6; }
.schedule-summary { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:15px; }
.schedule-summary>div { padding:14px 12px;border:1px solid var(--border-color);border-radius:12px;background:var(--bg-card); }
.schedule-summary span,.schedule-summary strong { display:block; }
.schedule-summary span { color:var(--text-muted);font-size:.68rem;font-weight:650; }
.schedule-summary strong { margin-top:5px;color:var(--text-primary);font-size:1.35rem;font-variant-numeric:tabular-nums; }
.schedule-toolbar { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px; }
.schedule-toolbar label { color:var(--text-muted); }
.schedule-toolbar select,.schedule-form input,.schedule-form select,.schedule-form textarea {
box-sizing:border-box;min-height:43px;padding:10px 12px;border:1px solid var(--border-color);border-radius:9px;
background:var(--bg-secondary);color:var(--text-primary);font:inherit;font-size:.8rem;outline:none;color-scheme:dark;
}
.schedule-toolbar select { flex:1;max-width:250px; }
.schedule-form textarea { width:100%;resize:vertical;line-height:1.5; }
.schedule-toolbar .sort-select-picker { flex:1;max-width:250px; }
.schedule-form .sort-select-trigger { min-height:43px;padding:10px 12px;background:var(--bg-input);font-size:.78rem; }
.schedule-form .sort-select-menu { min-width:100%;max-height:260px;overflow-y:auto;overscroll-behavior:contain; }
.schedule-toolbar .sort-select-menu { min-width:100%;max-height:320px;overflow-y:auto;overscroll-behavior:contain; }
.schedule-form .sort-select-option { min-height:44px; }
.schedule-form input:focus,.schedule-form select:focus,.schedule-form textarea:focus,.schedule-toolbar select:focus { border-color:#22d3ee;box-shadow:0 0 0 3px rgba(6,182,212,.12); }
.schedule-client-picker { position:relative;margin-bottom:15px; }
.schedule-client-search-group { position:relative;margin-bottom:0; }
.schedule-client-search-box { position:relative; }
.schedule-client-search-box>i { position:absolute;top:50%;left:13px;z-index:1;transform:translateY(-50%);color:var(--text-muted);font-size:.8rem;pointer-events:none; }
.schedule-client-search-box input { width:100%;min-height:46px;padding:11px 13px 11px 38px!important;border-color:rgba(96,165,250,.35)!important; }
.schedule-client-search-box input:focus { border-color:#60a5fa!important;box-shadow:0 0 0 3px rgba(59,130,246,.14)!important; }
.schedule-client-search-status { display:block;margin-top:7px;color:var(--text-secondary);font-size:.68rem;line-height:1.5; }
.schedule-client-search-status.is-error { color:#fb7185; }
.schedule-client-results { position:absolute;z-index:1400;top:calc(100% - 22px);left:0;right:0;max-height:310px;padding:6px;overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--border-color);border-radius:12px;background:var(--bg-card);box-shadow:0 18px 45px rgba(0,0,0,.34); }
.schedule-client-option { display:flex;align-items:center;gap:10px;width:100%;min-height:58px;padding:9px 10px;border-radius:9px;background:transparent;color:var(--text-primary);font:inherit;text-align:left;cursor:pointer; }
.schedule-client-option:hover,.schedule-client-option:focus-visible { outline:2px solid rgba(96,165,250,.45);outline-offset:-2px;background:var(--bg-hover); }
.schedule-client-option-avatar,.schedule-selected-client-avatar { display:grid;place-items:center;flex:0 0 auto;width:36px;height:36px;border-radius:10px;background:rgba(37,99,235,.16);color:#60a5fa;font-size:.82rem;font-weight:800; }
.schedule-client-option-info { flex:1;min-width:0; }
.schedule-client-option-info strong,.schedule-client-option-info small { display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.schedule-client-option-info strong { font-size:.78rem; }
.schedule-client-option-info small { margin-top:4px;color:var(--text-secondary);font-size:.68rem;white-space:normal;overflow-wrap:anywhere; }
.schedule-client-option-source { flex:0 0 auto;color:var(--text-muted);font-size:.6rem; }
.schedule-client-option>i { flex:0 0 auto;color:var(--text-muted);font-size:.62rem; }
.schedule-client-empty { display:flex;align-items:flex-start;gap:9px;padding:14px 11px;color:var(--text-secondary);font-size:.72rem;line-height:1.5; }
.schedule-client-empty i { margin-top:3px;color:#60a5fa; }
.schedule-client-more { padding:8px 10px;color:var(--text-muted);font-size:.64rem;text-align:center; }
.schedule-selected-client { display:flex;align-items:center;gap:11px;padding:12px;border:1px solid rgba(6,182,212,.32);border-radius:12px;background:rgba(6,182,212,.07); }
.schedule-selected-client-info { flex:1;min-width:0; }
.schedule-selected-client-info strong,.schedule-selected-client-info span,.schedule-selected-client-info small { display:block;overflow-wrap:anywhere; }
.schedule-selected-client-info strong { color:var(--text-primary);font-size:.82rem; }
.schedule-selected-client-info span { margin-top:4px;color:var(--text-secondary);font-size:.68rem;line-height:1.45; }
.schedule-selected-client-info small { margin-top:6px;color:#22d3ee;font-size:.62rem; }
.schedule-client-change { display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:38px;padding:7px 9px;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-card);color:var(--text-secondary);font:inherit;font-size:.65rem;font-weight:700;cursor:pointer; }
.schedule-client-change:hover,.schedule-client-change:focus-visible { border-color:#22d3ee;color:var(--text-primary);outline:none; }
.schedule-client-manual-title { display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:0 0 11px;padding-top:12px;border-top:1px solid var(--border-color); }
.schedule-client-manual-title span { color:var(--text-primary);font-size:.72rem;font-weight:750; }
.schedule-client-manual-title small { color:var(--text-muted);font-size:.62rem;line-height:1.4;text-align:right; }
.schedule-export { display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:8px 11px;border:1px solid rgba(16,185,129,.3);border-radius:9px;background:rgba(16,185,129,.08);color:#34d399;font-size:.73rem;font-weight:700;text-decoration:none;white-space:nowrap; }
.schedules-list { display:grid;gap:13px; }
.schedule-card { padding:17px;border:1px solid var(--border-color);border-radius:14px;background:var(--bg-card); }
.schedule-card.is-overdue { border-color:rgba(244,63,94,.36); }
.schedule-card-top { display:flex;align-items:flex-start;justify-content:space-between;gap:12px; }
.schedule-card-client { min-width:0; }
.schedule-card-client h3 { margin:0;color:var(--text-primary);font-size:.98rem;overflow-wrap:anywhere; }
.schedule-card-client p { margin:5px 0 0;color:var(--text-muted);font-size:.73rem;line-height:1.5;overflow-wrap:anywhere; }
.schedule-state { flex:0 0 auto;padding:5px 8px;border:1px solid var(--border-color);border-radius:999px;color:var(--text-secondary);font-size:.63rem;font-weight:750; }
.schedule-state.active { border-color:rgba(16,185,129,.32);background:rgba(16,185,129,.08);color:#34d399; }
.schedule-state.paused { border-color:rgba(245,158,11,.32);background:rgba(245,158,11,.08);color:#fbbf24; }
.schedule-state.cancelled { border-color:rgba(244,63,94,.3);background:rgba(244,63,94,.07);color:#fb7185; }
.schedule-due { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:15px 0 13px;padding:13px 0;border-top:1px solid var(--border-color);border-bottom:1px solid var(--border-color); }
.schedule-due span,.schedule-due strong { display:block; }
.schedule-due span { color:var(--text-muted);font-size:.62rem;line-height:1.4; }
.schedule-due strong { margin-top:5px;color:var(--text-primary);font-size:.78rem;line-height:1.45;font-variant-numeric:tabular-nums;overflow-wrap:anywhere; }
.schedule-due .is-late strong { color:#fb7185; }
.schedule-current-note { margin:0 0 12px;color:var(--text-secondary);font-size:.72rem;line-height:1.55; }
.schedule-actions { display:flex;flex-wrap:wrap;gap:8px; }
.schedule-action { display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:7px 10px;border:1px solid var(--border-color);border-radius:8px;background:transparent;color:var(--text-secondary);font:inherit;font-size:.7rem;font-weight:700;text-decoration:none;cursor:pointer; }
.schedule-action:hover { border-color:#22d3ee;color:var(--text-primary);background:rgba(6,182,212,.06); }
.schedule-action.primary { border-color:rgba(6,182,212,.4);background:rgba(6,182,212,.1);color:#22d3ee; }
.schedule-action.success { border-color:rgba(16,185,129,.35);background:rgba(16,185,129,.08);color:#34d399; }
.schedule-action.danger { color:#fb7185; }
.schedule-action:disabled { opacity:.55;cursor:wait; }
.schedule-history { margin-top:13px;border-top:1px solid var(--border-color);padding-top:11px; }
.schedule-history summary { color:var(--text-muted);font-size:.69rem;cursor:pointer; }
.schedule-history-row { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid var(--border-color);font-size:.69rem; }
.schedule-history-row:last-child { border-bottom:0; }
.schedule-history-row span { color:var(--text-muted); }
.schedule-history-row strong { color:var(--text-secondary);text-align:right; }
.schedule-modal-content { width:min(100%,650px);max-width:650px;max-height:92vh;padding:0;overflow:hidden; }
.schedule-modal .modal-header { position:relative;min-height:68px;padding:18px 22px; }
.schedule-modal .modal-header h2 { margin:0;padding-right:42px;font-size:1.04rem; }
.schedule-modal-close { position:absolute;top:15px;right:18px;display:grid;place-items:center;width:38px;height:38px;border:1px solid rgba(244,63,94,.45);border-radius:10px;background:rgba(244,63,94,.09);color:#fb7185;font-size:22px;cursor:pointer; }
.schedule-form { max-height:calc(92vh - 68px);padding:20px 22px 23px;overflow-y:auto; }
.schedule-form-note { display:flex;gap:9px;margin:0 0 15px;padding:11px 12px;border:1px solid rgba(6,182,212,.22);border-radius:10px;background:rgba(6,182,212,.06);color:var(--text-secondary);font-size:.72rem;line-height:1.55; }
.schedule-form-note i { margin-top:3px;color:#22d3ee; }
.schedule-fieldset { min-width:0;margin:0 0 15px;padding:15px;border:1px solid var(--border-color);border-radius:12px; }
.schedule-fieldset legend { padding:0 7px;color:var(--text-primary);font-size:.77rem;font-weight:750; }
.schedule-fieldset:disabled { opacity:.68; }
.schedule-form-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px; }
.schedule-form .form-group { margin-bottom:11px; }
.schedule-form .form-group label { display:block;margin-bottom:6px;color:var(--text-secondary);font-size:.71rem;font-weight:650; }
.schedule-form .form-group input,.schedule-form .form-group select { width:100%; }
.schedule-optional-note { display:block;color:var(--text-muted);font-size:.67rem;line-height:1.55; }
.schedule-form-actions { display:flex;justify-content:flex-end;gap:9px; }
.schedule-form-actions button { min-height:42px;padding:10px 15px; }
.create-schedule-banner { display:flex;align-items:flex-start;gap:11px;margin-bottom:15px;padding:13px 14px;border:1px solid rgba(6,182,212,.35);border-radius:11px;background:rgba(6,182,212,.09);color:#67e8f9; }
.create-schedule-banner>i { margin-top:3px; }
.create-schedule-banner>div { flex:1;min-width:0; }
.create-schedule-banner strong,.create-schedule-banner span { display:block; }
.create-schedule-banner strong { font-size:.78rem; }
.create-schedule-banner span { margin-top:4px;color:var(--text-secondary);font-size:.7rem;line-height:1.5;overflow-wrap:anywhere; }
.create-schedule-banner button { border:0;background:transparent;color:inherit;cursor:pointer; }
body.light-mode .schedule-toolbar select,body.light-mode .schedule-form input,body.light-mode .schedule-form select,body.light-mode .schedule-form textarea { color-scheme:light;background:#fff; }
body.light-mode #tab-schedules .sort-select-trigger,body.light-mode .schedule-form .sort-select-trigger { border-color:rgba(37,99,235,.28);background:#fff;color:#0f172a;box-shadow:none; }
body.light-mode #tab-schedules .sort-select-trigger:hover,body.light-mode .schedule-form .sort-select-trigger:hover { border-color:#2563eb; }
body.light-mode #tab-schedules .sort-select-menu,body.light-mode .schedule-form .sort-select-menu,body.light-mode .schedule-client-results { border-color:#dbe4f0;background:#fff;box-shadow:0 18px 40px rgba(15,23,42,.16); }
body.light-mode #tab-schedules .sort-select-option,body.light-mode .schedule-form .sort-select-option { color:#1e293b; }
body.light-mode #tab-schedules .sort-select-option:hover,body.light-mode .schedule-form .sort-select-option:hover { background:#f1f5f9; }
body.light-mode #tab-schedules .sort-select-option[aria-selected="true"],body.light-mode .schedule-form .sort-select-option[aria-selected="true"] { background:#eff6ff;color:#1d4ed8; }
body.light-mode .schedule-client-option:hover,body.light-mode .schedule-client-option:focus-visible { background:#f1f5f9; }
body.light-mode .schedule-selected-client { background:#ecfeff; }
body.light-mode .schedule-selected-client-info small { color:#0e7490; }
body.light-mode .schedule-client-search-status.is-error { color:#be123c; }
body.light-mode .schedule-intro { background:#ecfeff;color:#475569; }
body.light-mode #tab-schedules .add-client-btn { border-color:#1d4ed8;background:#2563eb;color:#fff;box-shadow:0 4px 12px rgba(37,99,235,.18); }
body.light-mode #tab-schedules .add-client-btn:hover { border-color:#1e40af;background:#1d4ed8;color:#fff; }
body.light-mode .schedule-summary>div,body.light-mode .schedule-card { background:#fff; }
body.light-mode .schedule-export { color:#047857; }
body.light-mode .schedule-state.active { color:#047857; }
body.light-mode .schedule-state.paused { color:#b45309; }
body.light-mode .schedule-state.cancelled,body.light-mode .schedule-due .is-late strong { color:#be123c; }
body.light-mode .schedule-action.primary { color:#0e7490; }
body.light-mode .schedule-action.success { color:#047857; }
body.light-mode .create-schedule-banner { color:#0e7490;background:#ecfeff; }

/* Sélection riche du bon original : même parcours que les clients, accent remboursement. */
.create-original-picker { margin-bottom:12px; }
.create-original-search-box input { border-color:rgba(245,158,11,.38)!important; }
.create-original-search-box input:focus { border-color:#fbbf24!important;box-shadow:0 0 0 3px rgba(245,158,11,.13)!important; }
.create-original-results { border-color:rgba(245,158,11,.3); }
.create-original-option-avatar,.create-original-selected-avatar { background:rgba(245,158,11,.14);color:#fbbf24; }
.create-original-option:hover,.create-original-option:focus-visible { outline-color:rgba(245,158,11,.5); }
.create-selected-original { border-color:rgba(245,158,11,.38);background:rgba(245,158,11,.07); }
.create-selected-original .schedule-selected-client-info small { color:#fcd34d; }
.create-original-change { min-height:44px; }
.create-original-change:hover,.create-original-change:focus-visible { border-color:#fbbf24; }
.create-refund-period-row { display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,.55fr);align-items:center;gap:12px;margin:0 0 12px; }
.create-refund-period-row>label { color:var(--text-secondary);font-size:.72rem;line-height:1.45; }
.create-refund-period-row select { width:100%; }
body.light-mode .create-original-results { border-color:#fde68a;background:#fff; }
body.light-mode .create-selected-original { border-color:#f59e0b;background:#fffbeb; }
body.light-mode .create-selected-original .schedule-selected-client-info small { color:#92400e; }
body.light-mode .create-original-option-avatar,body.light-mode .create-original-selected-avatar { color:#b45309;background:#fef3c7; }
@media(max-width:600px) {
.create-refund-period-row { grid-template-columns:1fr;gap:6px; }
.create-selected-original { align-items:flex-start; }
.create-selected-original .schedule-selected-client-info span { white-space:normal; }
}
#tab-clients .client-actions { flex-wrap:wrap; }
#tab-clients .client-action-btn.schedule { min-height:38px;border-color:rgba(6,182,212,.38);background:rgba(6,182,212,.09);color:#22d3ee; }
#tab-clients .client-action-btn.schedule:hover,#tab-clients .client-action-btn.schedule:focus-visible { border-color:#22d3ee;outline:2px solid rgba(6,182,212,.18);outline-offset:2px; }
body.light-mode #tab-clients .client-action-btn.schedule { color:#0e7490;background:#ecfeff; }
@media(max-width:600px) {
.schedule-summary { gap:7px; }
.schedule-summary>div { padding:12px 9px; }
.schedule-toolbar { flex-wrap:wrap; }
.schedule-toolbar select,.schedule-toolbar .sort-select-picker { max-width:none; }
.schedule-toolbar .sort-select-picker { flex:1 1 calc(100% - 32px); }
.schedule-toolbar .schedule-export { margin-left:28px; }
.schedule-client-option-source { display:none; }
.schedule-card { padding:14px; }
.schedule-due { grid-template-columns:1fr 1fr; }
.schedule-due>div:last-child { grid-column:1/-1; }
.schedule-form { padding:17px 15px 20px; }
.schedule-form-grid { grid-template-columns:1fr;gap:0; }
.schedule-form-actions { display:grid;grid-template-columns:1fr 1fr; }
}
@media(max-width:380px) {
.schedule-card-top { flex-direction:column; }
.schedule-actions { display:grid;grid-template-columns:1fr 1fr; }
.schedule-action { min-width:0; }
}

/* Calendriers RECEIPT : composant francais, accessible et coherent clair/sombre. */
.receipt-date-picker{position:relative;width:100%}
.receipt-date-trigger{width:100%;min-height:49px;display:flex;align-items:center;gap:11px;padding:12px 14px;border:1px solid rgba(96,165,250,.3);border-radius:11px;background:#0f172a;color:#94a3b8;text-align:left;font:inherit;font-size:.82rem;cursor:pointer;transition:border-color .2s,box-shadow .2s,background .2s}
.receipt-date-trigger>i:first-child{flex:0 0 auto;color:#60a5fa;font-size:1rem}
.receipt-date-trigger-label{flex:1;min-width:0;line-height:1.45}
.receipt-date-trigger.has-value{color:#f8fafc;font-weight:650}
.receipt-date-chevron{flex:0 0 auto;color:#64748b;font-size:.7rem;transition:transform .2s}
.receipt-date-trigger[aria-expanded="true"] .receipt-date-chevron{transform:rotate(180deg)}
.receipt-date-trigger:hover{border-color:#60a5fa;background:#111c30}
.receipt-date-trigger:focus-visible{outline:0;border-color:#60a5fa;box-shadow:0 0 0 3px rgba(59,130,246,.2)}
.receipt-date-trigger[aria-expanded="true"]{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.14)}
.receipt-calendar{position:relative;z-index:25;width:100%;margin-top:9px;padding:14px;border:1px solid rgba(96,165,250,.32);border-radius:14px;background:linear-gradient(155deg,#172033,#0f172a 70%);box-shadow:0 18px 40px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.035);animation:receiptCalendarIn .16s ease-out}
@keyframes receiptCalendarIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
.receipt-calendar-header{display:grid;grid-template-columns:38px 1fr 38px;align-items:center;gap:8px;margin-bottom:13px}
.receipt-calendar-header strong{color:#f8fafc;text-align:center;font-size:.9rem;font-weight:750;text-transform:none}
.receipt-calendar-nav{display:grid;place-items:center;width:38px;height:38px;border:1px solid rgba(96,165,250,.24);border-radius:9px;background:rgba(37,99,235,.09);color:#93c5fd;cursor:pointer;transition:background .18s,border-color .18s,color .18s}
.receipt-calendar-nav:hover{border-color:#60a5fa;background:rgba(37,99,235,.22);color:#fff}
.receipt-calendar-nav:focus-visible,.receipt-calendar-day:focus-visible,.receipt-calendar-footer button:focus-visible{outline:2px solid #60a5fa;outline-offset:2px}
.receipt-calendar-weekdays,.receipt-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
.receipt-calendar-weekdays{margin-bottom:6px}
.receipt-calendar-weekdays span{padding:4px 0;color:#7dd3fc;text-align:center;font-size:.64rem;font-weight:750;text-transform:uppercase;letter-spacing:.035em}
.receipt-calendar-day{position:relative;display:grid;place-items:center;aspect-ratio:1;min-width:0;min-height:34px;padding:0;border:1px solid transparent;border-radius:9px;background:transparent;color:#e2e8f0;font:inherit;font-size:.77rem;font-weight:600;cursor:pointer;transition:background .15s,border-color .15s,color .15s,transform .15s}
.receipt-calendar-day:hover{border-color:rgba(96,165,250,.45);background:rgba(37,99,235,.17);transform:translateY(-1px)}
.receipt-calendar-day.outside-month{color:#64748b;opacity:.58}
.receipt-calendar-day.is-today{border-color:rgba(96,165,250,.52);color:#93c5fd}
.receipt-calendar-day.is-today:after{content:"";position:absolute;bottom:3px;width:3px;height:3px;border-radius:50%;background:#60a5fa}
.receipt-calendar-day.is-selected{border-color:#3b82f6;background:linear-gradient(135deg,#3b82f6,#1d4ed8);color:#fff;font-weight:800;box-shadow:0 5px 15px rgba(37,99,235,.32)}
.receipt-calendar-day.is-selected:after{background:#fff}
.receipt-calendar-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:13px;padding-top:11px;border-top:1px solid rgba(148,163,184,.14)}
.receipt-calendar-footer button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:7px 10px;border:0;border-radius:8px;background:transparent;color:#93c5fd;font:inherit;font-size:.68rem;font-weight:700;cursor:pointer}
.receipt-calendar-footer button:hover{background:rgba(37,99,235,.14);color:#eff6ff}
.receipt-calendar-footer .receipt-calendar-clear{color:#fda4af}
.receipt-calendar-footer .receipt-calendar-clear:hover{background:rgba(239,68,68,.1);color:#fecaca}
.receipt-calendar-footer>span{color:#64748b;font-size:.58rem;line-height:1.45;text-align:right}
body.light-mode .receipt-date-trigger{border-color:#cbd5e1;background:#fff;color:#64748b}
body.light-mode .receipt-date-trigger.has-value{color:#172033}
body.light-mode .receipt-date-trigger:hover{background:#f8fafc;border-color:#3b82f6}
body.light-mode .receipt-calendar{border-color:#bfdbfe;background:linear-gradient(155deg,#fff,#f8fbff 75%);box-shadow:0 18px 40px rgba(15,23,42,.14)}
body.light-mode .receipt-calendar-header strong{color:#172033}
body.light-mode .receipt-calendar-nav{border-color:#bfdbfe;background:#eff6ff;color:#2563eb}
body.light-mode .receipt-calendar-nav:hover{background:#dbeafe;color:#1d4ed8}
body.light-mode .receipt-calendar-weekdays span{color:#2563eb}
body.light-mode .receipt-calendar-day{color:#334155}
body.light-mode .receipt-calendar-day:hover{border-color:#93c5fd;background:#eff6ff}
body.light-mode .receipt-calendar-day.outside-month{color:#94a3b8}
body.light-mode .receipt-calendar-day.is-today{border-color:#60a5fa;color:#1d4ed8}
body.light-mode .receipt-calendar-day.is-selected{border-color:#2563eb;background:linear-gradient(135deg,#3b82f6,#1d4ed8);color:#fff}
body.light-mode .receipt-calendar-footer{border-color:#e2e8f0}
body.light-mode .receipt-calendar-footer button{color:#2563eb}
body.light-mode .receipt-calendar-footer button:hover{background:#eff6ff;color:#1d4ed8}
body.light-mode .receipt-calendar-footer .receipt-calendar-clear{color:#dc2626}
body.light-mode .receipt-calendar-footer .receipt-calendar-clear:hover{background:#fef2f2;color:#b91c1c}

/* Actions de validation de l'echeancier : meme rouge lumineux que l'interface et vert net. */
.schedule-form-actions .schedule-cancel-btn{border:1px solid rgba(248,113,113,.72);background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;font-weight:800;box-shadow:0 7px 20px rgba(220,38,38,.25),inset 0 1px 0 rgba(255,255,255,.18)}
.schedule-form-actions .schedule-cancel-btn:hover{border-color:#fca5a5;background:linear-gradient(135deg,#f87171,#ef4444);color:#fff;box-shadow:0 9px 25px rgba(239,68,68,.38),0 0 18px rgba(239,68,68,.16);transform:translateY(-1px)}
.schedule-form-actions .schedule-create-btn{border:1px solid rgba(74,222,128,.72);background:linear-gradient(135deg,#22c55e,#16a34a);color:#fff;font-weight:800;box-shadow:0 7px 20px rgba(22,163,74,.25),inset 0 1px 0 rgba(255,255,255,.18)}
.schedule-form-actions .schedule-create-btn:hover{border-color:#86efac;background:linear-gradient(135deg,#4ade80,#22c55e);color:#fff;box-shadow:0 9px 25px rgba(34,197,94,.38),0 0 18px rgba(34,197,94,.16);transform:translateY(-1px)}
.schedule-form-actions .schedule-cancel-btn:focus-visible,.schedule-form-actions .schedule-create-btn:focus-visible{outline:3px solid #fff;outline-offset:3px}
.schedule-form-actions .schedule-cancel-btn:disabled,.schedule-form-actions .schedule-create-btn:disabled{opacity:.62;cursor:wait;transform:none}
@media(max-width:480px){.receipt-calendar{padding:11px}.receipt-calendar-weekdays,.receipt-calendar-grid{gap:3px}.receipt-calendar-day{min-height:32px;border-radius:8px}.receipt-calendar-footer>span{font-size:.54rem}}
@media(prefers-reduced-motion:reduce){.receipt-calendar{animation:none}.receipt-calendar-day,.receipt-date-chevron{transition:none}}

/* Les actions directes reprennent les couleurs des actions du formulaire de recu. */
.schedule-action.save-draft{border-color:rgba(245,158,11,.5);background:linear-gradient(145deg,rgba(245,158,11,.27),rgba(245,158,11,.09) 58%,rgba(15,23,42,.65));color:var(--text-primary);box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12)}
.schedule-action.save-draft:hover{border-color:#fbbf24;background:linear-gradient(145deg,rgba(245,158,11,.38),rgba(245,158,11,.14) 58%,rgba(15,23,42,.65));color:#fef3c7;box-shadow:0 8px 24px rgba(245,158,11,.15)}
.schedule-action.mark-paid{border-color:rgba(16,185,129,.5);background:linear-gradient(145deg,rgba(16,185,129,.27),rgba(16,185,129,.09) 58%,rgba(15,23,42,.65));color:var(--text-primary);box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12)}
.schedule-action.mark-paid:hover{border-color:#34d399;background:linear-gradient(145deg,rgba(16,185,129,.38),rgba(16,185,129,.14) 58%,rgba(15,23,42,.65));color:#d1fae5;box-shadow:0 8px 24px rgba(16,185,129,.15)}
body.light-mode .schedule-action.save-draft{border-color:rgba(217,119,6,.42);background:linear-gradient(145deg,rgba(245,158,11,.17),rgba(245,158,11,.06) 65%,#fff);color:#92400e}
body.light-mode .schedule-action.save-draft:hover{background:#fffbeb;color:#78350f}
body.light-mode .schedule-action.mark-paid{border-color:rgba(5,150,105,.4);background:linear-gradient(145deg,rgba(16,185,129,.17),rgba(16,185,129,.06) 65%,#fff);color:#047857}
body.light-mode .schedule-action.mark-paid:hover{background:#ecfdf5;color:#065f46}

/* Details de recurrence dans l'apercu marchand du recu. */
.receipt-schedule-details{margin-top:20px;padding:18px 0;border-top:1px solid var(--preview-line);border-bottom:1px solid var(--preview-line)}
.receipt-schedule-heading{display:flex;align-items:flex-start;gap:11px;margin-bottom:13px}
.receipt-schedule-heading>i{margin-top:3px;color:#3b82f6}
.receipt-schedule-heading h3{color:var(--preview-text);font-size:.88rem;line-height:1.4}
.receipt-schedule-heading p{margin-top:3px;color:var(--preview-muted);font-size:.68rem;line-height:1.5}
.receipt-schedule-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
.receipt-schedule-grid>div{min-width:0;padding:11px 0;border-bottom:1px solid var(--preview-line)}
.receipt-schedule-grid>div:nth-last-child(-n+2){border-bottom:0}
.receipt-schedule-grid span{display:block;margin-bottom:4px;color:var(--preview-muted);font-size:.67rem}
.receipt-schedule-grid strong{display:block;color:var(--preview-text);font-size:.77rem;font-weight:650;line-height:1.5;overflow-wrap:anywhere}
.receipt-schedule-grid .receipt-schedule-wide strong{font-family:'SFMono-Regular',Consolas,monospace;font-size:.68rem}
@media(max-width:480px){.receipt-schedule-grid{grid-template-columns:1fr}.receipt-schedule-grid>div:nth-last-child(2){border-bottom:1px solid var(--preview-line)}}

/* Memes degrades futuristes que les actions principales de RECEIPT. */
.schedule-form-actions #schedule-submit.schedule-create-btn{--action-rgb:16,185,129;border:1px solid rgba(var(--action-rgb),.5)!important;background:linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65))!important;color:var(--text-primary)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12)!important}
.schedule-form-actions #schedule-submit.schedule-create-btn:hover{border-color:rgba(var(--action-rgb),.85)!important;background:linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7))!important;color:var(--text-primary)!important;box-shadow:0 8px 24px rgba(var(--action-rgb),.15)!important}
.schedule-form-actions .schedule-cancel-btn{--action-rgb:244,63,94;border:1px solid rgba(var(--action-rgb),.5)!important;background:linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65))!important;color:var(--text-primary)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12)!important}
.schedule-form-actions .schedule-cancel-btn:hover{border-color:rgba(var(--action-rgb),.85)!important;background:linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7))!important;color:var(--text-primary)!important;box-shadow:0 8px 24px rgba(var(--action-rgb),.15)!important}


/* Simplification quotidienne : recurrence repliee et une action principale par carte. */
.repeat-payment-option{margin-top:16px;border:1px solid rgba(59,130,246,.25);border-radius:12px;background:rgba(59,130,246,.045);overflow:hidden}
.repeat-payment-option>summary{display:flex;align-items:center;gap:11px;min-height:58px;padding:11px 13px;color:var(--text-primary);cursor:pointer;list-style:none;user-select:none}
.repeat-payment-option>summary::-webkit-details-marker{display:none}
.repeat-payment-option>summary:hover{background:rgba(59,130,246,.07)}
.repeat-payment-option>summary:focus-visible{outline:3px solid rgba(96,165,250,.45);outline-offset:-3px}
.repeat-payment-icon{display:grid;place-items:center;flex:0 0 auto;width:34px;height:34px;border:1px solid rgba(96,165,250,.28);border-radius:9px;background:rgba(59,130,246,.1);color:#60a5fa}
.repeat-payment-option>summary>span:nth-child(2){flex:1;min-width:0}
.repeat-payment-option strong,.repeat-payment-option small{display:block}
.repeat-payment-option strong{font-size:.79rem}
.repeat-payment-option small{margin-top:4px;color:var(--text-muted);font-size:.66rem;font-weight:500;line-height:1.4}
.repeat-payment-chevron{flex:0 0 auto;color:var(--text-muted);font-size:.72rem;transition:transform .2s}
.repeat-payment-option[open] .repeat-payment-chevron{transform:rotate(180deg)}
.repeat-payment-content{padding:0 13px 13px 58px}
.repeat-payment-content p{margin:0 0 11px;color:var(--text-secondary);font-size:.7rem;line-height:1.55}
.repeat-payment-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:9px 13px;border:1px solid rgba(59,130,246,.5);border-radius:9px;background:linear-gradient(145deg,rgba(59,130,246,.27),rgba(59,130,246,.09) 58%,rgba(15,23,42,.65));box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12);color:var(--text-primary);font:inherit;font-size:.72rem;font-weight:750;cursor:pointer;transition:all .2s}
.repeat-payment-button:hover{border-color:#60a5fa;background:linear-gradient(145deg,rgba(59,130,246,.36),rgba(59,130,246,.13) 58%,rgba(15,23,42,.7));transform:translateY(-1px)}
.repeat-payment-button:focus-visible{outline:3px solid rgba(96,165,250,.4);outline-offset:2px}
.schedule-actions{display:block}
.schedule-primary-action{width:100%;min-height:43px;font-size:.76rem}
.schedule-more{margin-top:10px;border-top:1px solid var(--border-color);padding-top:10px}
.schedule-more-trigger{display:flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:8px 10px;border:1px solid transparent;border-radius:8px;color:var(--text-muted);font-size:.7rem;font-weight:700;cursor:pointer;list-style:none;user-select:none;transition:all .2s}
.schedule-more-trigger::-webkit-details-marker{display:none}
.schedule-more-trigger>i:last-child{margin-left:auto;font-size:.62rem;transition:transform .2s}
.schedule-more-trigger>i:first-child{margin-right:auto}
.schedule-more-trigger:hover{border-color:var(--border-color);background:rgba(148,163,184,.05);color:var(--text-primary)}
.schedule-more-trigger:focus-visible{outline:3px solid rgba(96,165,250,.35);outline-offset:2px}
.schedule-more[open] .schedule-more-trigger>i:last-child{transform:rotate(180deg)}
.schedule-more-content{padding-top:10px;animation:scheduleMoreIn .16s ease-out}
@keyframes scheduleMoreIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.schedule-secondary-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.schedule-secondary-actions .schedule-action{width:100%;min-height:39px;text-align:center}
.schedule-action.view-receipt,.schedule-action.edit-schedule,.schedule-action.email-reminder{--action-rgb:59,130,246}
.schedule-action.save-draft,.schedule-action.pause-schedule{--action-rgb:245,158,11}
.schedule-action.mark-paid,.schedule-action.whatsapp-reminder{--action-rgb:16,185,129}
.schedule-action.danger{--action-rgb:244,63,94}
.schedule-action.view-receipt,.schedule-action.edit-schedule,.schedule-action.email-reminder,
.schedule-action.save-draft,.schedule-action.pause-schedule,.schedule-action.mark-paid,
.schedule-action.whatsapp-reminder,.schedule-action.danger{border:1px solid rgba(var(--action-rgb),.5);background:linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65));box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12);color:var(--text-primary)}
.schedule-action.view-receipt:hover,.schedule-action.edit-schedule:hover,.schedule-action.email-reminder:hover,
.schedule-action.save-draft:hover,.schedule-action.pause-schedule:hover,.schedule-action.mark-paid:hover,
.schedule-action.whatsapp-reminder:hover,.schedule-action.danger:hover{border-color:rgba(var(--action-rgb),.85);background:linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7));color:var(--text-primary);transform:translateY(-1px)}
.schedule-action:focus-visible{outline:3px solid rgba(var(--action-rgb,96,165,250),.32);outline-offset:2px}
.schedule-history{margin-top:12px;padding-top:11px}
.schedule-history h4{display:flex;align-items:center;gap:7px;margin:0 0 5px;color:var(--text-muted);font-size:.69rem}
body.light-mode .repeat-payment-option{background:#f8fbff}
body.light-mode .repeat-payment-option>summary:hover{background:#eff6ff}
body.light-mode .repeat-payment-button{background:linear-gradient(145deg,rgba(59,130,246,.17),rgba(59,130,246,.06) 65%,#fff);color:#1d4ed8;box-shadow:none}
body.light-mode .schedule-action.view-receipt,body.light-mode .schedule-action.edit-schedule,body.light-mode .schedule-action.email-reminder,
body.light-mode .schedule-action.save-draft,body.light-mode .schedule-action.pause-schedule,body.light-mode .schedule-action.mark-paid,
body.light-mode .schedule-action.whatsapp-reminder,body.light-mode .schedule-action.danger{background:linear-gradient(145deg,rgba(var(--action-rgb),.17),rgba(var(--action-rgb),.06) 65%,#fff);box-shadow:none}
body.light-mode .schedule-action.view-receipt,body.light-mode .schedule-action.edit-schedule,body.light-mode .schedule-action.email-reminder{color:#1d4ed8}
body.light-mode .schedule-action.save-draft,body.light-mode .schedule-action.pause-schedule{color:#92400e}
body.light-mode .schedule-action.mark-paid,body.light-mode .schedule-action.whatsapp-reminder{color:#047857}
body.light-mode .schedule-action.danger{color:#be123c}
#tab-clients .client-action-btn.schedule{border-color:rgba(59,130,246,.38);background:rgba(59,130,246,.09);color:#60a5fa}
#tab-clients .client-action-btn.schedule:hover,#tab-clients .client-action-btn.schedule:focus-visible{border-color:#60a5fa;outline-color:rgba(59,130,246,.18)}
body.light-mode #tab-clients .client-action-btn.schedule{color:#1d4ed8;background:#eff6ff}
@media(max-width:600px){.repeat-payment-content{padding-left:13px}.repeat-payment-button{width:100%}.schedule-secondary-actions{grid-template-columns:1fr}.schedule-secondary-actions .schedule-action{min-height:42px}}
@media(max-width:380px){.schedule-actions{display:block}.repeat-payment-option>summary{gap:8px;padding:10px}.repeat-payment-option small{font-size:.62rem}}


/* Identification des echeances dans Accueil, Paiements et Brouillons. */
.receipt-document-badges{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.receipt-schedule-badge{display:inline-flex;align-items:center;gap:5px;width:max-content;max-width:100%;padding:4px 8px;border:1px solid rgba(59,130,246,.42);border-radius:999px;background:linear-gradient(145deg,rgba(59,130,246,.2),rgba(6,182,212,.07));box-shadow:inset 0 1px 0 rgba(255,255,255,.03);color:#93c5fd;font-size:.62rem;font-weight:750;line-height:1.35;white-space:nowrap}
.receipt-schedule-badge i{font-size:.6rem}
.schedule-direct-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.schedule-direct-actions .schedule-action{width:100%;min-height:44px;padding:9px 11px;line-height:1.4;text-align:center}
body.light-mode .receipt-schedule-badge{border-color:rgba(37,99,235,.3);background:linear-gradient(145deg,#eff6ff,#ecfeff);color:#1d4ed8;box-shadow:none}
body.light-mode .schedule-form-actions #schedule-submit.schedule-create-btn,body.light-mode .schedule-form-actions .schedule-cancel-btn{background:linear-gradient(145deg,rgba(var(--action-rgb),.17),rgba(var(--action-rgb),.06) 65%,#fff)!important;box-shadow:none!important}
body.light-mode .schedule-form-actions #schedule-submit.schedule-create-btn{color:#047857!important}
body.light-mode .schedule-form-actions .schedule-cancel-btn{color:#be123c!important}
body.light-mode .schedule-form-actions #schedule-submit.schedule-create-btn:hover,body.light-mode .schedule-form-actions .schedule-cancel-btn:hover{background:linear-gradient(145deg,rgba(var(--action-rgb),.24),rgba(var(--action-rgb),.09) 65%,#fff)!important}
@media(max-width:420px){.schedule-direct-actions{grid-template-columns:1fr}.schedule-direct-actions .schedule-action{min-height:44px}}


/* Choix explicite dans la modale : recurrence seule ou premiere echeance en brouillon. */
.schedule-form-actions #schedule-save-draft.schedule-draft-btn{--action-rgb:245,158,11;border:1px solid rgba(var(--action-rgb),.5)!important;background:linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65))!important;color:var(--text-primary)!important;font-weight:800;box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12)!important}
.schedule-form-actions #schedule-save-draft.schedule-draft-btn:hover{border-color:rgba(var(--action-rgb),.85)!important;background:linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7))!important;color:var(--text-primary)!important;box-shadow:0 8px 24px rgba(var(--action-rgb),.15)!important}
.schedule-form-actions .schedule-cancel-btn:focus-visible,.schedule-form-actions .schedule-create-btn:focus-visible,.schedule-form-actions .schedule-draft-btn:focus-visible{outline:3px solid rgba(var(--action-rgb,96,165,250),.45);outline-offset:3px}
.schedule-form-actions .schedule-cancel-btn:disabled,.schedule-form-actions .schedule-create-btn:disabled,.schedule-form-actions .schedule-draft-btn:disabled{opacity:.62;cursor:wait;transform:none}
body.light-mode .schedule-form-actions #schedule-save-draft.schedule-draft-btn{background:linear-gradient(145deg,rgba(var(--action-rgb),.17),rgba(var(--action-rgb),.06) 65%,#fff)!important;color:#92400e!important;box-shadow:none!important}
body.light-mode .schedule-form-actions #schedule-save-draft.schedule-draft-btn:hover{background:linear-gradient(145deg,rgba(var(--action-rgb),.24),rgba(var(--action-rgb),.09) 65%,#fff)!important}
@media(max-width:600px){.schedule-form-actions .schedule-draft-btn{grid-column:1/-1;grid-row:1}.schedule-form-actions .schedule-cancel-btn{grid-column:1;grid-row:2}.schedule-form-actions .schedule-create-btn{grid-column:2;grid-row:2}.schedule-form-actions button{min-height:46px}}


/* Calcul facultatif de la date de fin pour les recurrences en jours. */
.schedule-auto-end{margin:2px 0 12px;padding:11px 13px;border:1px solid rgba(59,130,246,.28);border-radius:12px;background:linear-gradient(145deg,rgba(59,130,246,.1),rgba(6,182,212,.035));color:var(--text-secondary)}
.schedule-auto-end-toggle{display:flex;align-items:flex-start;gap:9px;cursor:pointer;color:var(--text-primary);font-size:.75rem;font-weight:700;line-height:1.45}
.schedule-auto-end-toggle input{flex:0 0 auto;width:16px;height:16px;margin:1px 0 0;accent-color:#3b82f6;cursor:pointer}
.schedule-auto-end-toggle i{color:#60a5fa;margin-right:4px}
.schedule-auto-end small{display:block;margin:6px 0 0 25px;color:var(--text-muted);font-size:.66rem;line-height:1.5}
body.light-mode .schedule-auto-end{border-color:rgba(37,99,235,.22);background:linear-gradient(145deg,#eff6ff,#f0fdfa);color:#475569}
body.light-mode .schedule-auto-end-toggle{color:#1e293b}
body.light-mode .schedule-auto-end-toggle i{color:#2563eb}
.schedule-auto-end-toggle:focus-within{outline:3px solid rgba(59,130,246,.2);outline-offset:3px;border-radius:6px}


/* Suppressions, annulations et archivages : meme langage visuel danger. */
.document-danger-btn,.client-action-btn.danger,.history-client-archive,.notif-delete{
--action-rgb:244,63,94;border:1px solid rgba(var(--action-rgb),.5);background:linear-gradient(145deg,rgba(var(--action-rgb),.27),rgba(var(--action-rgb),.09) 58%,rgba(15,23,42,.65));box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 8px 20px rgba(2,6,23,.12);color:var(--text-primary);font:inherit;font-weight:750;cursor:pointer;transition:border-color .2s,background .2s,transform .2s,box-shadow .2s
}
.document-danger-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 13px;border-radius:10px;text-decoration:none}
.document-danger-btn.compact{min-height:44px;padding:8px 11px;font-size:.7rem;white-space:normal;line-height:1.35}
.document-danger-btn:hover,.client-action-btn.danger:hover,.history-client-archive:hover,.notif-delete:hover{border-color:rgba(var(--action-rgb),.85);background:linear-gradient(145deg,rgba(var(--action-rgb),.36),rgba(var(--action-rgb),.13) 58%,rgba(15,23,42,.7));box-shadow:0 8px 24px rgba(var(--action-rgb),.15);transform:translateY(-1px)}
.document-danger-btn:focus-visible,.client-action-btn.danger:focus-visible,.history-client-archive:focus-visible,.notif-delete:focus-visible{outline:3px solid rgba(251,113,133,.45);outline-offset:2px}
.document-danger-btn:disabled,.client-action-btn.danger:disabled,.history-client-archive:disabled,.notif-delete:disabled{opacity:.5;cursor:not-allowed;transform:none}
.receipt-status-cancelled{display:inline-flex;align-items:center;gap:5px;color:#fda4af;border:1px solid rgba(244,63,94,.42);background:rgba(244,63,94,.11)}
.refund-item.is-cancelled{border-color:rgba(244,63,94,.25)}
.refund-history-modal-row{align-items:center;gap:12px}
.refund-history-modal-side{display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex:0 0 auto}
.schedule-history-row{align-items:center;gap:10px}
.schedule-history-values{display:flex;flex:1;min-width:0;align-items:center;justify-content:space-between;gap:10px}
.schedule-installment-cancel{flex:0 0 auto}
.client-action-btn.danger{color:#fda4af}
.history-client-archive{min-height:44px}
.notif-item{position:relative;padding-right:58px}
.notif-delete{position:absolute;top:12px;right:12px;display:grid;place-items:center;width:44px;height:44px;padding:0;border-radius:11px;color:#fda4af}
.destructive-confirm-content{position:relative;width:100%;max-width:480px;max-height:90dvh;padding:30px;overflow-y:auto;text-align:center;overscroll-behavior:contain}
.destructive-confirm-close{position:absolute;top:12px;right:12px}
.destructive-confirm-icon{display:grid;place-items:center;width:68px;height:68px;margin:0 auto 18px;border:1px solid rgba(251,113,133,.48);border-radius:20px;background:rgba(244,63,94,.13);box-shadow:0 0 28px rgba(244,63,94,.12);color:#fb7185;font-size:2rem}
.destructive-confirm-content h2{padding:0 24px;color:var(--text-primary);font-size:1.3rem;line-height:1.35}
.destructive-confirm-subject{margin-top:10px;color:#fda4af!important;font-weight:750;overflow-wrap:anywhere}
.destructive-confirm-content p{color:var(--text-secondary);font-size:.92rem;line-height:1.65}
.destructive-confirm-consequence{margin-top:16px;padding:13px 14px;border:1px solid rgba(244,63,94,.3);border-radius:11px;background:rgba(244,63,94,.07);color:var(--text-secondary);font-size:.8rem;line-height:1.6;text-align:left}
.destructive-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:24px}
.destructive-confirm-actions button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:11px 12px;border-radius:11px;font:inherit;font-weight:750;cursor:pointer;line-height:1.35}
.destructive-confirm-cancel{border:1px solid var(--border-color);background:var(--bg-hover);color:var(--text-primary)}
.destructive-confirm-cancel:hover{background:var(--border-color)}
.destructive-confirm-accept{border:1px solid rgba(251,113,133,.65);background:linear-gradient(145deg,rgba(244,63,94,.42),rgba(190,18,60,.24));box-shadow:0 8px 24px rgba(244,63,94,.18);color:var(--text-primary)}
.destructive-confirm-accept:hover{border-color:#fb7185;background:linear-gradient(145deg,rgba(244,63,94,.52),rgba(190,18,60,.32));transform:translateY(-1px)}
.destructive-confirm-actions button:focus-visible{outline:3px solid rgba(251,113,133,.45);outline-offset:2px}
.destructive-confirm-actions button:disabled,.destructive-confirm-close:disabled{opacity:.55;cursor:wait;transform:none}
body.light-mode .document-danger-btn,body.light-mode .client-action-btn.danger,body.light-mode .history-client-archive,body.light-mode .notif-delete{background:linear-gradient(145deg,rgba(244,63,94,.17),rgba(244,63,94,.06) 65%,#fff);box-shadow:none;color:#be123c}
body.light-mode .receipt-status-cancelled{color:#be123c;background:#fff1f2}
body.light-mode .destructive-confirm-subject{color:#be123c!important}
body.light-mode .destructive-confirm-accept{color:#881337}
@media(max-width:600px){.destructive-confirm-content{padding:28px 20px 20px}.schedule-history-row{align-items:stretch;flex-direction:column}.schedule-installment-cancel{width:100%}.refund-history-modal-side{align-items:stretch}.receipt-refund-document-actions{flex-wrap:wrap}}
@media(max-width:420px){.destructive-confirm-actions{grid-template-columns:1fr}.destructive-confirm-accept{grid-row:1}.notif-item{padding-right:52px}.notif-delete{right:7px}}
@media(prefers-reduced-motion:reduce){.document-danger-btn,.client-action-btn.danger,.history-client-archive,.notif-delete,.destructive-confirm-actions button{transition:none}}


/* Corbeille et choix comptable explicite. */
.destructive-accounting-choices{display:grid;gap:11px;margin-top:20px;text-align:left}
.destructive-accounting-choice{position:relative;display:block;cursor:pointer}
.destructive-accounting-choice input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.destructive-accounting-choice>span{display:grid;grid-template-columns:30px 1fr;gap:5px 10px;min-height:86px;padding:15px;border:1px solid rgba(52,211,153,.38);border-radius:13px;background:linear-gradient(145deg,rgba(16,185,129,.12),rgba(15,23,42,.42));transition:border-color .18s,background .18s,box-shadow .18s}
.destructive-accounting-choice.remove>span{border-color:rgba(251,113,133,.42);background:linear-gradient(145deg,rgba(244,63,94,.12),rgba(15,23,42,.42))}
.destructive-accounting-choice i{grid-row:1/3;padding-top:3px;color:#34d399;font-size:1.15rem}
.destructive-accounting-choice.remove i{color:#fb7185}
.destructive-accounting-choice strong{color:var(--text-primary);font-size:.84rem;line-height:1.45}
.destructive-accounting-choice small{color:var(--text-secondary);font-size:.74rem;line-height:1.5}
.destructive-accounting-choice:hover>span{border-color:rgba(52,211,153,.8);box-shadow:0 8px 22px rgba(2,6,23,.14)}
.destructive-accounting-choice.remove:hover>span{border-color:rgba(251,113,133,.82)}
.destructive-accounting-choice input:checked+span{border-color:#34d399;box-shadow:0 0 0 3px rgba(52,211,153,.15),inset 0 0 0 1px rgba(52,211,153,.22);background:linear-gradient(145deg,rgba(16,185,129,.23),rgba(15,23,42,.5))}
.destructive-accounting-choice.remove input:checked+span{border-color:#fb7185;box-shadow:0 0 0 3px rgba(251,113,133,.16),inset 0 0 0 1px rgba(251,113,133,.2);background:linear-gradient(145deg,rgba(244,63,94,.22),rgba(15,23,42,.5))}
.destructive-accounting-choice input:focus-visible+span{outline:3px solid rgba(96,165,250,.5);outline-offset:3px}
.destructive-confirm-accept:disabled{cursor:not-allowed}
.trash-intro{display:flex;align-items:flex-start;gap:11px;margin-bottom:18px;padding:14px 16px;border:1px solid rgba(96,165,250,.28);border-radius:13px;background:rgba(37,99,235,.09);color:var(--text-secondary)}
.trash-intro i{padding-top:3px;color:#60a5fa}
.trash-intro p{margin:0;font-size:.82rem;line-height:1.6}
.trash-list{display:grid;gap:13px}
.trash-item{display:flex;align-items:flex-start;gap:14px;padding:17px;border:1px solid var(--border-color);border-radius:15px;background:linear-gradient(145deg,var(--bg-card),rgba(15,23,42,.32));box-shadow:0 8px 24px rgba(2,6,23,.1)}
.trash-item-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border:1px solid rgba(96,165,250,.3);border-radius:12px;background:rgba(37,99,235,.12);color:#60a5fa;font-size:1.1rem}
.trash-item-main{flex:1;min-width:0}
.trash-item-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;flex-wrap:wrap}
.trash-item-heading>strong{color:var(--text-primary);font-size:.95rem}
.trash-accounting{display:inline-flex;padding:5px 8px;border:1px solid;border-radius:8px;font-size:.66rem;font-weight:750;line-height:1.35}
.trash-accounting.kept{border-color:rgba(52,211,153,.35);background:rgba(16,185,129,.1);color:#6ee7b7}
.trash-accounting.removed{border-color:rgba(251,113,133,.38);background:rgba(244,63,94,.1);color:#fda4af}
.trash-item-main>p{margin:7px 0;color:var(--text-secondary);font-size:.78rem;overflow-wrap:anywhere}
.trash-item-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--text-muted);font-size:.7rem}
.trash-item-meta strong{color:var(--text-primary);font-size:.88rem}
.trash-item-actions{display:flex;gap:9px;margin-top:14px;flex-wrap:wrap}
.trash-item-actions button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:9px 13px;border:1px solid;border-radius:10px;font:inherit;font-size:.75rem;font-weight:750;cursor:pointer}
.trash-consult{border-color:rgba(96,165,250,.4);background:rgba(37,99,235,.13);color:#93c5fd}
.trash-restore{border-color:rgba(52,211,153,.42);background:rgba(16,185,129,.13);color:#6ee7b7}
.trash-item-actions button:hover{filter:brightness(1.18);transform:translateY(-1px)}
.trash-item-actions button:focus-visible{outline:3px solid rgba(96,165,250,.4);outline-offset:2px}
.trash-empty{display:grid;place-items:center;gap:8px;padding:35px 18px}
.trash-empty i{color:#64748b;font-size:1.8rem}
.trash-empty strong{color:var(--text-primary)}
.trash-empty span{color:var(--text-muted);font-size:.8rem}
body.light-mode .destructive-accounting-choice>span{background:linear-gradient(145deg,#ecfdf5,#fff)}
body.light-mode .destructive-accounting-choice.remove>span{background:linear-gradient(145deg,#fff1f2,#fff)}
body.light-mode .trash-item{background:#fff}
body.light-mode .trash-accounting.kept{color:#047857}
body.light-mode .trash-accounting.removed{color:#be123c}
body.light-mode .trash-consult{color:#1d4ed8}
body.light-mode .trash-restore{color:#047857}
@media(max-width:520px){.trash-item{gap:10px;padding:14px}.trash-item-icon{flex-basis:38px;width:38px;height:38px}.trash-item-heading{display:grid}.trash-item-actions{display:grid;grid-template-columns:1fr 1fr}.trash-item-actions button{width:100%}.trash-item-meta{align-items:flex-start;flex-direction:column}.destructive-accounting-choice>span{padding:13px}}
@media(max-width:360px){.trash-item-actions{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.destructive-accounting-choice>span,.trash-item-actions button{transition:none}}


/* Comptes entreprise : extension de l'interface existante */
.supervision-banner{display:flex;align-items:center;justify-content:center;gap:10px;margin:10px auto 0;padding:11px 15px;max-width:1100px;border:1px solid rgba(245,158,11,.42);border-radius:12px;background:rgba(245,158,11,.12);color:#fcd34d;font-size:.82rem;font-weight:650}.supervision-banner span{flex:1}.supervision-banner button{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:6px 10px;border:1px solid rgba(245,158,11,.35);border-radius:8px;background:transparent;color:inherit;font:inherit;cursor:pointer}.employee-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:15px}.employee-invite-result{margin-top:17px;padding:15px;border:1px solid rgba(16,185,129,.35);border-radius:12px;background:rgba(16,185,129,.08);color:#a7f3d0}.employee-invite-result p{color:var(--text-secondary);font-size:.78rem}.employee-invite-link{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px}.employee-invite-link input{min-width:0;padding:11px;border:1px solid var(--border-color);border-radius:9px;background:var(--bg-primary);color:var(--text-primary)}.employee-card,.employee-invitation-row{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:11px;padding:16px;border:1px solid var(--border-color);border-radius:14px;background:var(--bg-card)}.employee-card-main{display:flex;align-items:center;gap:13px;min-width:0}.employee-card-main h3{margin:0;color:var(--text-primary);font-size:.95rem}.employee-card-main p{margin:4px 0;color:var(--text-secondary);font-size:.75rem;overflow-wrap:anywhere}.employee-avatar{display:grid;place-items:center;flex:0 0 46px;width:46px;height:46px;overflow:hidden;border-radius:13px;background:rgba(37,99,235,.18);color:#93c5fd;font-weight:800}.employee-avatar img{width:100%;height:100%;object-fit:cover}.employee-state{display:inline-flex;color:#34d399;font-size:.68rem}.employee-state.disabled{color:#f87171}.employee-card-actions,.employee-invitation-row>div:last-child{display:flex;gap:8px;flex-wrap:wrap}.employee-invitation-row strong,.employee-invitation-row span,.employee-invitation-row small{display:block}.employee-invitation-row span,.employee-invitation-row small{margin-top:4px;color:var(--text-secondary);font-size:.72rem}.employee-section-title{margin:23px 0 12px;color:var(--text-primary);font-size:.95rem}.activity-intro{color:var(--text-secondary);font-size:.82rem}.activity-row{display:flex;gap:12px;padding:15px 0;border-bottom:1px solid var(--border-color)}.activity-icon{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:10px;background:rgba(16,185,129,.12);color:#34d399}.activity-row strong{color:var(--text-primary);font-size:.8rem}.activity-row p{margin:5px 0;color:var(--text-secondary);font-size:.8rem;line-height:1.5;overflow-wrap:anywhere}.activity-row time{color:var(--text-muted);font-size:.68rem}.employee-public-choice{display:flex;align-items:center;gap:9px;margin:12px 0;color:var(--text-secondary);font-size:.8rem}.employee-public-choice input{width:18px;height:18px;accent-color:#2563eb}.employee-code-content{max-width:480px;padding:25px}.employee-code-content>p{color:var(--text-secondary);font-size:.84rem;line-height:1.55}.employee-code-value{margin:15px 0;padding:12px;border:1px solid rgba(59,130,246,.3);border-radius:10px;background:rgba(37,99,235,.1);color:#93c5fd;font-weight:700;overflow-wrap:anywhere}.employee-code-content input{text-align:center;font-size:1.5rem;letter-spacing:.3em}.employee-code-content .btn-secondary{margin-top:10px}.employee-code-content>small{display:block;margin-top:15px;color:var(--text-muted);line-height:1.5}.employee-code-error{min-height:20px;color:#f87171!important}.client-request-status{margin:9px 0;color:#93c5fd;font-size:.73rem}.supervision-mode [data-tab="create"],.supervision-mode #history-create-button,.supervision-mode #receipt-detail-pay,.supervision-mode #receipt-detail-cancel,.supervision-mode #receipt-detail-refund{display:none!important}
@media(max-width:620px){.supervision-banner{align-items:flex-start;flex-wrap:wrap;margin:8px 10px 0}.supervision-banner button{width:100%;justify-content:center}.employee-form-grid{grid-template-columns:1fr}.employee-card,.employee-invitation-row{align-items:stretch;flex-direction:column}.employee-card-actions,.employee-invitation-row>div:last-child{display:grid;grid-template-columns:1fr}.employee-invite-link{grid-template-columns:1fr}.employee-invite-link button{justify-content:center}.employee-code-content{padding:20px 16px}}

.receipt-responsible-control{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;margin-top:8px}.receipt-responsible-control select{min-width:0;padding:10px;border:1px solid var(--border-color);border-radius:9px;background:var(--bg-primary);color:var(--text-primary)}.employee-card-actions .btn-secondary,.employee-invitation-row .btn-secondary,.supervision-banner button{min-height:44px}@media(max-width:480px){.receipt-responsible-control{grid-template-columns:1fr}.receipt-responsible-control button{min-height:44px}}


/* Recherche unifiee, impression et missions de brouillon */
body.light-mode .sort-select-menu { border-color:#dbe4f0;background:#fff;box-shadow:0 18px 40px rgba(15,23,42,.16); }
body.light-mode .sort-select-option { color:#1e293b; }
body.light-mode .sort-select-option:hover,body.light-mode .sort-select-option:focus-visible { background:#f1f5f9; }
body.light-mode .sort-select-option[aria-selected="true"] { background:#eff6ff;color:#1d4ed8; }
body.light-mode .sort-select-search-box input { background:#fff;color:#0f172a; }
.create-mission-card { margin-bottom:16px;border-color:rgba(45,212,191,.3);background:linear-gradient(145deg,rgba(20,184,166,.09),rgba(15,23,42,.35)); }
.create-mission-heading { display:flex;align-items:flex-start;gap:12px;margin-bottom:14px; }
.create-mission-heading>i { margin-top:3px;color:#2dd4bf;font-size:1.15rem; }
.create-mission-heading h3 { margin:0 0 4px;color:var(--text-primary);font-size:.95rem; }
.create-mission-heading p { margin:0;color:var(--text-secondary);font-size:.75rem;line-height:1.55; }
.create-mission-note { margin:10px 0 0;color:#99f6e4;font-size:.72rem;line-height:1.55; }
.mission-native-select{display:none!important}.mission-multi-select{position:relative}.mission-multi-trigger{display:flex;align-items:center;gap:12px;width:100%;min-height:70px;padding:12px 14px;border:1px solid rgba(45,212,191,.38);border-radius:14px;background:linear-gradient(135deg,rgba(15,23,42,.9),rgba(20,184,166,.09));color:var(--text-primary);text-align:left;cursor:pointer;transition:border-color .2s,box-shadow .2s}.mission-multi-trigger:hover,.mission-multi-select.open .mission-multi-trigger{border-color:#2dd4bf;box-shadow:0 0 0 3px rgba(45,212,191,.1)}.mission-trigger-icon{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;border-radius:12px;background:rgba(45,212,191,.13);color:#5eead4;font-size:1rem}.mission-trigger-copy{flex:1;min-width:0}.mission-trigger-copy strong,.mission-trigger-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mission-trigger-copy strong{font-size:.85rem}.mission-trigger-copy small{margin-top:4px;color:var(--text-secondary);font-size:.68rem}.mission-trigger-chevron{color:#5eead4;transition:transform .2s}.mission-multi-select.open .mission-trigger-chevron{transform:rotate(180deg)}.mission-multi-panel{margin-top:10px;padding:14px;border:1px solid rgba(45,212,191,.3);border-radius:15px;background:var(--bg-card);box-shadow:0 14px 34px rgba(0,0,0,.18)}.mission-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px}.mission-panel-head strong,.mission-panel-head small{display:block}.mission-panel-head strong{font-size:.8rem}.mission-panel-head small{margin-top:3px;color:var(--text-secondary);font-size:.66rem}.mission-clear{padding:5px 8px;border:0;background:transparent;color:#fda4af;font-size:.68rem;cursor:pointer}.mission-select-all{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:49px;padding:10px 12px;border:1px solid rgba(96,165,250,.3);border-radius:11px;background:rgba(59,130,246,.08);color:#93c5fd;cursor:pointer}.mission-select-all>span{display:flex;align-items:center;gap:9px}.mission-select-all strong{font-size:.75rem}.mission-select-all.selected{border-color:#2dd4bf;background:rgba(45,212,191,.12);color:#5eead4}.mission-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:280px;margin-top:11px;padding-right:3px;overflow:auto}.mission-employee-option{display:flex;align-items:center;gap:9px;min-width:0;min-height:61px;padding:9px;border:1px solid var(--border-color);border-radius:11px;background:var(--bg-body);color:var(--text-primary);text-align:left;cursor:pointer;transition:border-color .18s,background .18s,transform .18s}.mission-employee-option:hover{transform:translateY(-1px);border-color:#2dd4bf}.mission-employee-option.selected{border-color:#2dd4bf;background:rgba(45,212,191,.1)}.mission-employee-avatar{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:10px;background:rgba(59,130,246,.13);color:#93c5fd;font-weight:800}.mission-employee-option.selected .mission-employee-avatar{background:rgba(45,212,191,.16);color:#5eead4}.mission-employee-copy{flex:1;min-width:0}.mission-employee-copy strong,.mission-employee-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mission-employee-copy strong{font-size:.73rem}.mission-employee-copy small{margin-top:3px;color:var(--text-secondary);font-size:.61rem}.mission-employee-check{display:grid;place-items:center;flex:0 0 23px;width:23px;height:23px;border:1px solid var(--border-color);border-radius:7px;color:transparent}.mission-employee-option.selected .mission-employee-check{border-color:#2dd4bf;background:#0d9488;color:#fff}.mission-multiple-explain{margin:12px 2px 0;color:var(--text-secondary);font-size:.66rem;line-height:1.5}.mission-options-empty{grid-column:1/-1;padding:22px 10px;color:var(--text-secondary);font-size:.72rem;text-align:center}body.light-mode .mission-multi-trigger{background:linear-gradient(135deg,#fff,#f0fdfa)}body.light-mode .mission-select-all{background:#eff6ff}body.light-mode .mission-employee-option.selected{background:#f0fdfa}@media(max-width:600px){.mission-options{grid-template-columns:1fr;max-height:42dvh}.mission-multi-trigger{min-height:66px}.mission-multi-panel{padding:11px}}
body.light-mode .create-mission-card { background:#f0fdfa;border-color:#99f6e4; }
body.light-mode .create-mission-note { color:#0f766e; }
.receipt-detail-share { margin:0 0 18px; }
.receipt-mission-owner { color:#99f6e4;font-size:.72rem; }
.refund-share-row { grid-template-columns:repeat(auto-fit,minmax(105px,1fr)); }
.refund-mission-line { margin-top:8px;color:#99f6e4;font-size:.72rem;line-height:1.5; }
@media(max-width:480px){.sort-select-menu{position:fixed;left:16px;right:16px;top:auto;bottom:16px;width:auto;min-width:0;max-width:none}.sort-select-options{max-height:48dvh}.create-mission-heading{gap:10px}}

/* Missions collectives, preuves portables et cles API */
.collection-action{border-color:rgba(45,212,191,.4);color:#5eead4}.receipt-collection-summary{margin:0 0 16px;padding:14px;border:1px solid rgba(45,212,191,.28);border-radius:12px;background:rgba(20,184,166,.07)}.receipt-collection-summary,.receipt-collection-summary>div{display:flex;align-items:center;justify-content:space-between;gap:12px}.receipt-collection-summary>div>i{color:#2dd4bf;font-size:1.2rem}.receipt-collection-summary span{display:grid;gap:4px;flex:1}.receipt-collection-summary strong{color:var(--text-primary);font-size:.82rem}.receipt-collection-summary small{color:var(--text-secondary);font-size:.7rem;overflow-wrap:anywhere}.collection-modal-content{max-width:680px;max-height:92dvh;overflow-y:auto}.collection-modal-body{padding:20px}.collection-intro,.collection-privacy-note{color:var(--text-secondary);font-size:.78rem;line-height:1.6}.collection-privacy-note{padding:12px;border-radius:10px;background:rgba(59,130,246,.07)}.collection-date-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.collection-location-status{min-height:20px;color:#5eead4;font-size:.75rem}.collection-status-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:17px;border-bottom:1px solid var(--border-color)}.collection-status-head h3{margin:12px 0 4px;color:var(--text-primary);overflow-wrap:anywhere}.collection-status-head p{margin:0;color:var(--text-muted);font-size:.7rem}.collection-status-head>strong{max-width:45%;color:var(--text-primary);font-size:1.05rem;text-align:right;overflow-wrap:anywhere}.collection-status{display:inline-flex;padding:6px 10px;border-radius:999px;background:rgba(59,130,246,.13);color:#93c5fd;font-size:.7rem;font-weight:750}.collection-status.collection-open{background:rgba(245,158,11,.13);color:#fcd34d}.collection-status.collection-assigned,.collection-status.collection-collected{background:rgba(20,184,166,.13);color:#5eead4}.collection-status.collection-completed{background:rgba(16,185,129,.13);color:#6ee7b7}.collection-status.collection-cancelled,.collection-status.collection-expired{background:rgba(148,163,184,.12);color:#cbd5e1}.collection-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}.collection-facts>div{min-width:0;padding:12px;border:1px solid var(--border-color);border-radius:10px}.collection-facts span,.collection-facts strong{display:block}.collection-facts span{color:var(--text-muted);font-size:.68rem}.collection-facts strong{margin-top:5px;color:var(--text-primary);font-size:.78rem;overflow-wrap:anywhere}.collection-handover-note{padding:13px;border:1px solid rgba(245,158,11,.3);border-radius:10px;background:rgba(245,158,11,.08);color:#fcd34d;font-size:.78rem;line-height:1.55}.collection-responses-title{color:var(--text-primary);font-size:.85rem}.collection-responses>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-top:1px solid var(--border-color)}.collection-responses span{display:grid;gap:3px}.collection-responses strong{color:var(--text-primary);font-size:.78rem}.collection-responses small{color:var(--text-muted);font-size:.67rem}.collection-responses b{font-size:.68rem;text-align:right}.response-pending{color:#fcd34d}.response-accepted{color:#6ee7b7}.response-refused{color:#fda4af}.response-superseded{color:var(--text-muted)}.collection-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}.collection-actions>*{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;text-align:center;text-decoration:none}.collection-whatsapp{color:#6ee7b7}.developer-proof-card{margin:15px 0}.developer-key-create{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}.developer-key-create input{min-width:0}.developer-key-secret{margin:15px 0;padding:15px;border:1px solid rgba(245,158,11,.4);border-radius:12px;background:rgba(245,158,11,.08);color:#fcd34d}.developer-key-secret p{color:var(--text-secondary);font-size:.75rem}.developer-key-secret>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px}.developer-key-secret input{min-width:0;font-family:monospace;font-size:.75rem}.developer-key-list{margin-top:14px}.developer-key-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 0;border-top:1px solid var(--border-color)}.developer-key-row>div{display:grid;gap:4px;min-width:0}.developer-key-row strong{color:var(--text-primary);font-size:.8rem}.developer-key-row code,.developer-key-row small{color:var(--text-muted);font-size:.68rem;overflow-wrap:anywhere}.developer-key-revoked{color:#fda4af;font-size:.7rem}.developer-documentation-link{display:inline-flex;align-items:center;gap:8px;margin-top:15px;color:#93c5fd;font-size:.76rem}.download-btn.proof{background:#0f766e;color:white}.download-btn.proof:hover{background:#115e59}
body.light-mode .collection-action{color:#0f766e}body.light-mode .collection-status-head>strong,body.light-mode .collection-facts strong{color:#0f172a}body.light-mode .collection-status.collection-open{color:#a16207}body.light-mode .collection-status.collection-assigned,body.light-mode .collection-status.collection-collected{color:#0f766e}body.light-mode .collection-status.collection-completed{color:#047857}body.light-mode .collection-status.collection-cancelled,body.light-mode .collection-status.collection-expired{color:#475569}body.light-mode .collection-handover-note{color:#92400e}body.light-mode .developer-key-secret{color:#92400e}body.light-mode .developer-documentation-link{color:#1d4ed8}
@media(max-width:560px){.collection-date-grid,.collection-facts,.collection-actions,.developer-key-create{grid-template-columns:1fr}.collection-status-head{display:block}.collection-status-head>strong{display:block;max-width:100%;margin-top:12px;text-align:left}.receipt-collection-summary{align-items:stretch;flex-direction:column}.receipt-collection-summary button{width:100%}.developer-key-secret>div{grid-template-columns:1fr}.developer-key-row{align-items:stretch;flex-direction:column}.developer-key-row button{width:100%}.collection-modal-body{padding:16px}}
@media(prefers-reduced-motion:reduce){.receipt-collection-summary,.collection-actions>*{transition:none}}


/* Import volontaire d'un contact et adresse personnelle employé. */
.contact-import-panel {
    margin: 0 0 18px;
    padding: 13px;
    border: 1px solid rgba(96,165,250,.24);
    border-radius: 12px;
    background: rgba(15,23,42,.34);
}
.contact-import-btn {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
}
.contact-import-btn:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 3px; }
.contact-import-btn:disabled { opacity: .65; cursor: wait; }
.contact-import-status {
    margin: 9px 2px 0;
    color: var(--text-muted);
    font-size: .72rem;
    line-height: 1.5;
}
.contact-import-status.is-success { color: #6ee7b7; }
.contact-import-status.is-error { color: #fca5a5; }
.employee-location-picker { margin-top: 17px; }
.employee-address-note {
    display: block;
    margin-top: 9px;
    color: var(--text-muted);
    font-size: .7rem;
    line-height: 1.5;
}
body.light-mode .contact-import-panel { background: rgba(37,99,235,.045); }
body.light-mode .contact-import-status.is-success { color: #047857; }
body.light-mode .contact-import-status.is-error { color: #b91c1c; }
@media (max-width: 480px) {
    .contact-import-panel { padding: 11px; }
    .contact-import-btn { padding-inline: 10px; font-size: .76rem; }
}


/* Lisibilité du formulaire client en thème clair ; le thème sombre est inchangé. */
body.light-mode #add-client-modal .modal-content {
    background: #fff;
    color: #0f172a;
    border-color: #dbe4f0;
}
body.light-mode #add-client-modal .modal-header h2,
body.light-mode #add-client-modal .form-group > label,
body.light-mode #add-client-modal .location-picker > label {
    color: #0f172a;
}
body.light-mode #add-client-modal .add-client-intro {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}
body.light-mode #add-client-modal input,
body.light-mode #add-client-modal select,
body.light-mode #add-client-modal textarea {
    background: #fff;
    color: #0f172a;
    border-color: #cbd5e1;
    color-scheme: light;
}
body.light-mode #add-client-modal input::placeholder,
body.light-mode #add-client-modal textarea::placeholder { color: #64748b; }
body.light-mode #add-client-modal .location-picker {
    background: #f8fafc;
    border-color: #dbe4f0;
}
body.light-mode #add-client-modal .contact-import-btn,
body.light-mode #add-client-modal .location-search-btn {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}
body.light-mode #add-client-modal .contact-import-btn:hover,
body.light-mode #add-client-modal .location-search-btn:hover { background: #1d4ed8; }
body.light-mode #add-client-modal .location-current-btn {
    background: #f0fdfa;
    color: #0f766e;
    border-color: #99f6e4;
}
body.light-mode #add-client-modal .contact-import-status,
body.light-mode #add-client-modal .location-results,
body.light-mode #add-client-modal .location-selected { color: #475569; }
body.light-mode #add-client-modal .location-result-btn {
    background: #fff;
    color: #0f172a;
    border-color: #dbe4f0;
}
body.light-mode #add-client-modal .location-result-btn:hover { background: #eff6ff; }


/* Actions du détail : rangées régulières, sans bouton isolé sur grand écran. */
@media (min-width: 601px) {
    #receipt-detail-modal .receipt-detail-share {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    #receipt-detail-modal .receipt-detail-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }
}
#receipt-detail-modal .receipt-detail-share .share-btn,
#receipt-detail-modal .receipt-detail-actions > * {
    width: 100%;
    min-width: 0;
    margin: 0;
    align-self: stretch;
}
#receipt-detail-modal .receipt-detail-share .share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    text-align: center;
}
#receipt-detail-modal .receipt-detail-actions > .hidden {
    display: none !important;
}
@media (max-width: 600px) {
    #receipt-detail-modal .receipt-detail-share {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #receipt-detail-modal .receipt-detail-share .share-btn.print {
        grid-column: 1 / -1;
    }
    #receipt-detail-modal .receipt-detail-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 390px) {
    #receipt-detail-modal .receipt-detail-actions {
        grid-template-columns: 1fr;
    }
}


/* Cartes de l'accueil : les cinq partages et les trois actions principales restent alignés. */
@media (min-width: 900px) {
    .receipt-item .receipt-share-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .receipt-item .receipt-downloads {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        justify-content: stretch;
    }
    .receipt-item .receipt-downloads > * {
        width: 100%;
        min-width: 0;
        margin: 0;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
    }
}


/* Cartes : deux rangées de quatre actions, partage d'abord et suppression en dernier. */
.receipt-item .receipt-card-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.receipt-item .receipt-card-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 10px 8px;
    box-sizing: border-box;
    border-radius: 9px;
    font-size: .78rem;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}
.receipt-item .receipt-card-actions > * > i { flex: 0 0 auto; }
.receipt-item .receipt-card-actions > * > span { min-width: 0; overflow-wrap: anywhere; }
.receipt-item .receipt-card-actions .receipt-download-excel,
.receipt-item .receipt-card-actions .receipt-download-pdf,
.receipt-item .receipt-card-actions .receipt-pay-btn {
    min-height: 48px;
    padding: 10px 8px;
}
@media (max-width: 700px) {
    .receipt-item .receipt-card-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
    .receipt-item .receipt-card-actions { grid-template-columns: 1fr; }
}


.receipt-item .receipt-card-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.receipt-item .receipt-card-secondary-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 9px 8px;
    box-sizing: border-box;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}


/* Finition des téléchargements et des fermetures de fenêtres. */
.receipt-item .receipt-card-actions .receipt-download-excel,
.receipt-item .receipt-card-actions .receipt-download-pdf {
    border: 1px solid transparent;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 5px 15px rgba(0,0,0,.12);
}
.receipt-item .receipt-card-actions .receipt-download-excel {
    background: rgba(16,185,129,.14);
    border-color: rgba(52,211,153,.4);
    color: #34d399;
}
.receipt-item .receipt-card-actions .receipt-download-pdf {
    background: rgba(239,68,68,.14);
    border-color: rgba(248,113,113,.4);
    color: #f87171;
}
.receipt-item .receipt-card-actions .receipt-download-excel:hover {
    background: rgba(16,185,129,.24);
    border-color: #34d399;
}
.receipt-item .receipt-card-actions .receipt-download-pdf:hover {
    background: rgba(239,68,68,.24);
    border-color: #f87171;
}
body.light-mode .receipt-item .receipt-card-actions .receipt-download-excel { color: #047857; background: #ecfdf5; }
body.light-mode .receipt-item .receipt-card-actions .receipt-download-pdf { color: #b91c1c; background: #fef2f2; }

#receipt-detail-modal .receipt-detail-share,
#receipt-detail-modal .receipt-detail-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}
#receipt-detail-modal .receipt-detail-share > *,
#receipt-detail-modal .receipt-detail-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 10px 8px;
    box-sizing: border-box;
    border-radius: 9px;
    font-size: .78rem;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}
#receipt-detail-modal .receipt-detail-share > * > i,
#receipt-detail-modal .receipt-detail-actions > * > i { flex: 0 0 auto; }
#receipt-detail-modal .receipt-detail-share > * > span,
#receipt-detail-modal .receipt-detail-actions > * > span { min-width: 0; overflow-wrap: anywhere; }
#receipt-detail-modal .receipt-detail-actions > .hidden { display: none !important; }

.modal-header {
    position: sticky;
    top: 0;
    z-index: 45;
    flex-shrink: 0;
    background: var(--bg-card);
}
.modal-content > .modal-close {
    position: sticky !important;
    top: 12px;
    z-index: 46;
    align-self: flex-end;
    flex-shrink: 0;
    margin: 12px 12px 0 auto;
}
.modal-close,
.schedule-modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(251,113,133,.8) !important;
    border-radius: 10px;
    background: rgba(225,29,72,.2) !important;
    color: #fb7185 !important;
    font-size: 1.45rem;
    line-height: 1;
    box-shadow: 0 0 8px rgba(244,63,94,.55), 0 0 20px rgba(244,63,94,.28), inset 0 0 9px rgba(251,113,133,.12);
    text-shadow: 0 0 8px rgba(251,113,133,.9);
    cursor: pointer;
}
.modal-close:hover,
.schedule-modal-close:hover {
    background: rgba(225,29,72,.38) !important;
    color: #fff1f2 !important;
    box-shadow: 0 0 11px rgba(244,63,94,.8), 0 0 26px rgba(244,63,94,.45), inset 0 0 10px rgba(251,113,133,.2);
}
.modal .neon-back-btn {
    position: sticky;
    bottom: 10px;
    z-index: 40;
    box-shadow: 0 5px 20px rgba(0,0,0,.28);
}

@media (max-width: 700px) {
    #receipt-detail-modal .receipt-detail-share,
    #receipt-detail-modal .receipt-detail-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
    #receipt-detail-modal .receipt-detail-share,
    #receipt-detail-modal .receipt-detail-actions { grid-template-columns: 1fr; }
}


/* Total des statistiques : hiérarchie principale et lecture immédiate. */
#stats-options-modal .stats-options-subtitle.is-amount-total {
    display: grid;
    gap: 6px;
    margin: 0 0 22px;
    padding: 20px 22px;
    border: 1px solid rgba(96,165,250,.38);
    border-radius: 16px;
    background: linear-gradient(135deg,rgba(37,99,235,.2),rgba(124,58,237,.1) 55%,rgba(15,23,42,.35));
    box-shadow: 0 12px 32px rgba(2,6,23,.2),inset 0 1px 0 rgba(255,255,255,.04);
}
#stats-options-modal .stats-options-total-label {
    color: #93c5fd;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
#stats-options-modal .stats-options-total-value {
    display: block;
    max-width: 100%;
    color: #f8fbff;
    font-size: clamp(2rem,5vw,3rem);
    font-weight: 850;
    line-height: 1.12;
    letter-spacing: -.045em;
    overflow-wrap: anywhere;
    text-shadow: 0 0 24px rgba(96,165,250,.2);
    font-variant-numeric: tabular-nums;
}
#stats-options-modal .stats-options-total-hint {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: .78rem;
    line-height: 1.55;
}
body.light-mode #stats-options-modal .stats-options-subtitle.is-amount-total {
    border-color: rgba(37,99,235,.3);
    background: linear-gradient(135deg,#eff6ff,#f5f3ff 60%,#fff);
    box-shadow: 0 10px 26px rgba(37,99,235,.08);
}
body.light-mode #stats-options-modal .stats-options-total-label { color: #2563eb; }
body.light-mode #stats-options-modal .stats-options-total-value { color: #0f172a; text-shadow: none; }
body.light-mode #stats-options-modal .stats-options-total-hint { color: #475569; }
@media (max-width: 480px) {
    #stats-options-modal .stats-options-subtitle.is-amount-total { padding: 17px 16px; border-radius: 13px; }
    #stats-options-modal .stats-options-total-value { font-size: clamp(1.75rem,9vw,2.4rem); }
}


/* Invitation employé : formulaire déplié uniquement sur action explicite. */
.employee-invite-card { padding: 16px; }
.employee-invite-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    margin: 0;
}
.employee-invite-toggle .employee-invite-chevron {
    margin-left: auto;
    transition: transform .2s ease;
}
.employee-invite-toggle > i:first-child { margin-right: auto; }
.employee-invite-toggle.is-open .employee-invite-chevron { transform: rotate(180deg); }
.employee-invite-panel { padding-top: 20px; animation: employeeInviteReveal .2s ease-out; }
.employee-invite-panel > h3 { margin-top: 0; }
@keyframes employeeInviteReveal {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .employee-invite-panel { animation: none; }
    .employee-invite-toggle .employee-invite-chevron { transition: none; }
}


/* Contact employé : accès rapide, mobile et desktop. */
.employee-card-actions .employee-contact-open {
    border: 1px solid rgba(45,212,191,.38);
    background: linear-gradient(135deg,rgba(13,148,136,.22),rgba(37,99,235,.16));
    color: #5eead4;
}
.employee-card-actions .employee-contact-open:hover {
    border-color: #2dd4bf;
    background: linear-gradient(135deg,rgba(13,148,136,.32),rgba(37,99,235,.24));
    box-shadow: 0 0 18px rgba(45,212,191,.12);
}
.employee-contact-content { max-width: 590px; }
.employee-contact-body { padding: 20px; overflow-y: auto; }
.employee-contact-identity { display: flex; align-items: center; gap: 13px; }
.employee-contact-icon { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 13px; background: rgba(37,99,235,.16); color: #93c5fd; font-size: 1.15rem; }
.employee-contact-identity strong,.employee-contact-identity small { display: block; overflow-wrap: anywhere; }
.employee-contact-identity strong { color: var(--text-primary); font-size: 1.02rem; }
.employee-contact-identity small { margin-top: 4px; color: var(--text-secondary); font-size: .76rem; }
.employee-contact-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.employee-contact-details p { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; padding: 11px 12px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-body); color: var(--text-secondary); font-size: .75rem; }
.employee-contact-details p i { flex: 0 0 auto; color: #60a5fa; }
.employee-contact-details p span { min-width: 0; overflow-wrap: anywhere; }
.employee-contact-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.employee-contact-action { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 72px; padding: 13px 14px; box-sizing: border-box; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-body); color: var(--text-primary); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: border-color .2s,background .2s,transform .2s; }
.employee-contact-action > i { flex: 0 0 28px; font-size: 1.35rem; text-align: center; }
.employee-contact-action > span { min-width: 0; }
.employee-contact-action strong,.employee-contact-action small { display: block; overflow-wrap: anywhere; }
.employee-contact-action strong { font-size: .83rem; }
.employee-contact-action small { margin-top: 4px; color: var(--text-secondary); font-size: .66rem; line-height: 1.35; }
.employee-contact-action:hover { transform: translateY(-1px); background: var(--bg-hover); }
.employee-contact-action.call { border-color: rgba(59,130,246,.35); }
.employee-contact-action.call > i { color: #60a5fa; }
.employee-contact-action.whatsapp { border-color: rgba(16,185,129,.35); }
.employee-contact-action.whatsapp > i { color: #34d399; }
.employee-contact-action.email { border-color: rgba(168,85,247,.35); }
.employee-contact-action.email > i { color: #c084fc; }
.employee-contact-action.sms { border-color: rgba(245,158,11,.35); }
.employee-contact-action.sms > i { color: #fbbf24; }
.employee-contact-action.other > i { color: #93c5fd; }
.employee-contact-mobile-note { margin: 14px 0 0; color: var(--text-muted); font-size: .7rem; line-height: 1.5; text-align: center; }
.employee-contact-copy { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border-color); }
.employee-contact-copy button { min-height: 40px; padding: 9px 13px; font-size: .72rem; }
body.light-mode .employee-card-actions .employee-contact-open { color: #0f766e; background: linear-gradient(135deg,#ecfdf5,#eff6ff); }
body.light-mode .employee-contact-action { background: #f8fafc; }
body.light-mode .employee-contact-action:hover { background: #eff6ff; }
@media (max-width: 560px) {
    .employee-contact-body { padding: 16px; }
    .employee-contact-details,.employee-contact-grid { grid-template-columns: 1fr; }
    .employee-contact-action { min-height: 64px; }
    .employee-contact-copy { display: grid; grid-template-columns: 1fr; }
    .employee-contact-copy button { width: 100%; }
}


/* Le même composant de contact est réutilisé pour les clients et les bons. */
.client-actions .client-action-btn.contact,
.receipt-item .receipt-card-secondary-actions .employee-contact-open,
.receipt-detail-secondary-actions .employee-contact-open {
    border: 1px solid rgba(45,212,191,.38);
    background: linear-gradient(135deg,rgba(13,148,136,.2),rgba(37,99,235,.14));
    color: #5eead4;
}
.client-actions .client-action-btn.contact:hover,
.receipt-item .receipt-card-secondary-actions .employee-contact-open:hover,
.receipt-detail-secondary-actions .employee-contact-open:hover {
    border-color: #2dd4bf;
    background: linear-gradient(135deg,rgba(13,148,136,.3),rgba(37,99,235,.22));
}
.receipt-item .receipt-card-secondary-actions .employee-contact-open,
.receipt-detail-secondary-actions .employee-contact-open {
    min-height: 48px;
    padding: 10px 8px;
    border-radius: 9px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    box-shadow: none;
}
.receipt-item .receipt-card-secondary-actions .employee-contact-open>i,
.receipt-detail-secondary-actions .employee-contact-open>i { flex: 0 0 auto; }
.receipt-item .receipt-card-secondary-actions .employee-contact-open>span,
.receipt-detail-secondary-actions .employee-contact-open>span { min-width: 0; overflow-wrap: anywhere; }
.receipt-detail-secondary-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 18px 0 12px; }
.receipt-detail-secondary-actions .employee-contact-open { grid-column: 1/-1; width: 100%; text-decoration: none; }
.receipt-detail-secondary-actions > .hidden { display: none !important; }
.receipt-detail-priority-actions > #receipt-detail-pay,
.receipt-detail-priority-actions > #receipt-detail-refund { width: 100%; min-height: 50px; margin: 0; }
.receipt-detail-priority-actions + .receipt-detail-share { margin-top: 0; }
.receipt-detail-actions > #receipt-detail-cancel { grid-column: 1/-1; }
@media(max-width:700px){.receipt-detail-secondary-actions{grid-template-columns:1fr}}
body.light-mode .client-actions .client-action-btn.contact,
body.light-mode .receipt-item .receipt-card-secondary-actions .employee-contact-open,
body.light-mode .receipt-detail-secondary-actions .employee-contact-open { color: #0f766e; background: linear-gradient(135deg,#ecfdf5,#eff6ff); }

/* Boutons + / − unifiés pour tous les champs numériques. */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; appearance: none; }
.number-stepper { position: relative; width: 100%; min-width: 0; }
.number-stepper-input { width: 100%; box-sizing: border-box; padding-right: 59px !important; font-variant-numeric: tabular-nums; }
.number-stepper-controls {
    position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
    display: grid; grid-template-rows: 1fr 1fr; width: 38px; height: 38px;
    overflow: hidden; border: 1px solid rgba(96,165,250,.34); border-radius: 9px;
    background: linear-gradient(145deg,rgba(37,99,235,.24),rgba(15,23,42,.88));
    box-shadow: 0 4px 12px rgba(2,6,23,.24),inset 0 1px 0 rgba(255,255,255,.06);
}
.number-stepper-button {
    display: grid; place-items: center; min-width: 0; min-height: 0; padding: 0;
    border: 0; background: transparent; color: #93c5fd; font-size: .61rem; line-height: 1;
    cursor: pointer; transition: color .16s,background .16s,transform .12s;
}
.number-stepper-button:first-child { border-bottom: 1px solid rgba(96,165,250,.22); }
.number-stepper-button:hover { background: rgba(59,130,246,.28); color: #eff6ff; }
.number-stepper-button:active { background: rgba(59,130,246,.4); transform: scale(.9); }
.number-stepper-button:focus-visible { position: relative; z-index: 1; outline: 2px solid #60a5fa; outline-offset: -2px; }
.number-stepper-button:disabled { cursor: not-allowed; opacity: .35; }
.number-stepper.is-disabled .number-stepper-controls { opacity: .55; }
.payment-breakdown > .number-stepper > input,
.payment-confirm-field .number-stepper > input { min-height: 48px; }
.payment-breakdown > .number-stepper > input {
    border: 1px solid rgba(52,211,153,.32); border-radius: 10px;
    background: var(--bg-input); color: var(--text-primary); font: inherit;
}
.payment-breakdown > .number-stepper > input:focus { border-color: #34d399; box-shadow: 0 0 0 3px rgba(16,185,129,.12); outline: none; }
.payment-breakdown .number-stepper-controls,
.payment-confirm-field .number-stepper-controls {
    border-color: rgba(52,211,153,.38);
    background: linear-gradient(145deg,rgba(16,185,129,.22),rgba(15,23,42,.9));
}
.payment-breakdown .number-stepper-button,
.payment-confirm-field .number-stepper-button { color: #6ee7b7; }
.payment-breakdown .number-stepper-button:first-child,
.payment-confirm-field .number-stepper-button:first-child { border-bottom-color: rgba(52,211,153,.23); }
.payment-breakdown .number-stepper-button:hover,
.payment-confirm-field .number-stepper-button:hover { background: rgba(16,185,129,.25); color: #ecfdf5; }
body.light-mode .number-stepper-controls { border-color: #bfdbfe; background: linear-gradient(145deg,#eff6ff,#dbeafe); box-shadow: 0 3px 9px rgba(37,99,235,.1); }
body.light-mode .number-stepper-button { color: #2563eb; }
body.light-mode .number-stepper-button:first-child { border-bottom-color: #bfdbfe; }
body.light-mode .number-stepper-button:hover { background: #bfdbfe; color: #1e3a8a; }
body.light-mode .payment-breakdown .number-stepper-controls,
body.light-mode .payment-confirm-field .number-stepper-controls { border-color: #a7f3d0; background: linear-gradient(145deg,#ecfdf5,#d1fae5); }
body.light-mode .payment-breakdown .number-stepper-button,
body.light-mode .payment-confirm-field .number-stepper-button { color: #047857; }
@media(max-width:480px) {
    .number-stepper-controls { right: 6px; width: 36px; height: 38px; }
    .number-stepper-input { padding-right: 54px !important; }
}
@media(prefers-reduced-motion:reduce) { .number-stepper-button { transition: none; } }
