/* ═══════════════════════════════════════════════════════
   Profacto v3 — Design System & Global Overrides
   Style: Corporate Minimalism (SaaS ERP)
   ═══════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
    --pf-primary: #4f6ef7;
    --pf-primary-soft: rgba(79, 110, 247, 0.08);
    --pf-primary-hover: #3d5ce5;
    --pf-success: #22c55e;
    --pf-success-soft: rgba(34, 197, 94, 0.08);
    --pf-danger: #ef4444;
    --pf-danger-soft: rgba(239, 68, 68, 0.08);
    --pf-warning: #f59e0b;
    --pf-warning-soft: rgba(245, 158, 11, 0.08);
    --pf-info: #3b82f6;
    --pf-info-soft: rgba(59, 130, 246, 0.08);

    --pf-text: #1e293b;
    --pf-text-secondary: #64748b;
    --pf-text-muted: #94a3b8;
    --pf-border: #e2e8f0;
    --pf-border-light: #f1f5f9;
    --pf-bg: #f8fafc;
    --pf-bg-card: #ffffff;
    --pf-radius: 0.625rem;
    --pf-radius-lg: 0.875rem;
    --pf-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --pf-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --pf-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --pf-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --pf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─── Global Typography ─── */
body {
    font-family: var(--pf-font) !important;
    color: var(--pf-text);
    background-color: var(--pf-bg) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 0.875rem;
    line-height: 1.6;
}
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    color: var(--pf-text);
    letter-spacing: -0.01em;
}
.text-muted { color: var(--pf-text-secondary) !important; }
a { transition: color var(--pf-transition); }
small, .small, .fs-11, .fs-12, .fs-13 { line-height: 1.5; }

/* ─── Content Area ─── */
.content-page { background: var(--pf-bg); }
.content { padding: 24px 28px 24px; }

/* ─── Cards ─── */
.card {
    border: 1px solid var(--pf-border) !important;
    border-radius: var(--pf-radius) !important;
    box-shadow: var(--pf-shadow-sm) !important;
    transition: box-shadow var(--pf-transition);
    background: var(--pf-bg-card);
}
.card:hover {
    box-shadow: var(--pf-shadow) !important;
}
.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--pf-border-light) !important;
    padding: 16px 20px !important;
}
.card-body { padding: 20px !important; }
.card-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--pf-text);
    margin-bottom: 0;
}
.card-footer {
    background: transparent !important;
    border-top: 1px solid var(--pf-border-light) !important;
}

/* ─── Tables ─── */
.table { color: var(--pf-text); }
.table > thead > tr > th {
    font-size: 0.7rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pf-text-secondary) !important;
    border-bottom: 2px solid var(--pf-border) !important;
    padding: 10px 12px !important;
    white-space: nowrap;
    background: transparent !important;
}
.table > tbody > tr > td {
    padding: 12px 12px !important;
    vertical-align: middle;
    border-bottom: 1px solid var(--pf-border-light) !important;
    font-size: 0.8125rem;
}
.table > tbody > tr:last-child > td {
    border-bottom: none !important;
}
.table > tbody > tr:hover > td {
    background-color: var(--pf-primary-soft) !important;
}

/* ─── Topbar / Navbar ─── */
.topbar-custom {
    background: var(--pf-bg-card) !important;
    border-bottom: 1px solid var(--pf-border) !important;
    box-shadow: none !important;
}
.topbar-custom .topbar-search .form-control {
    border-radius: 8px !important;
    background: var(--pf-bg) !important;
    border: 1px solid var(--pf-border) !important;
    font-size: 0.8125rem;
}
.topbar-custom .topbar-search .form-control:focus {
    border-color: var(--pf-primary) !important;
    box-shadow: 0 0 0 3px var(--pf-primary-soft) !important;
}

/* ─── Sidebar ─── */
.app-sidebar-menu {
    background: var(--pf-bg-card) !important;
    border-right: 1px solid var(--pf-border) !important;
    box-shadow: none !important;
}
body[data-menu-color="light"] .app-sidebar-menu {
    background: var(--pf-bg-card) !important;
}
body[data-menu-color="light"] #sidebar-menu > ul > li > a {
    color: var(--pf-text-secondary) !important;
    font-weight: 500;
    font-size: 0.8125rem !important;
    border-radius: 6px;
    margin: 1px 12px;
    padding: 9px 12px !important;
    transition: all var(--pf-transition);
}
body[data-menu-color="light"] #sidebar-menu > ul > li > a:hover {
    color: var(--pf-primary) !important;
    background: var(--pf-primary-soft) !important;
}
body[data-menu-color="light"] #sidebar-menu > ul > li.menuitem-active > a,
body[data-menu-color="light"] #sidebar-menu > ul > li > a.active {
    color: var(--pf-primary) !important;
    background: var(--pf-primary-soft) !important;
    font-weight: 600;
}
/* Sub-menu items */
body[data-menu-color="light"] #sidebar-menu > ul ul a {
    color: var(--pf-text-muted) !important;
    font-size: 0.8rem !important;
    padding: 6px 12px 6px 44px !important;
    border-radius: 4px;
    margin: 0 12px;
}
body[data-menu-color="light"] #sidebar-menu > ul ul a:hover,
body[data-menu-color="light"] #sidebar-menu > ul ul a.active {
    color: var(--pf-primary) !important;
    background: var(--pf-primary-soft) !important;
}
/* Menu section titles */
body[data-menu-color="light"] .menu-title {
    color: var(--pf-text-muted) !important;
    font-size: 0.625rem !important;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 12px 24px 6px !important;
}
/* Logo box */
.logo-box {
    border-bottom: 1px solid var(--pf-border-light) !important;
}

/* ─── Buttons ─── */
.btn {
    font-weight: 500;
    font-size: 0.8125rem;
    border-radius: 8px !important;
    padding: 7px 16px;
    transition: all var(--pf-transition);
    letter-spacing: 0.01em;
}
.btn-sm {
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 6px !important;
}
.btn-primary {
    background: var(--pf-primary) !important;
    border-color: var(--pf-primary) !important;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--pf-primary-hover) !important;
    border-color: var(--pf-primary-hover) !important;
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.25) !important;
}
.btn-outline-primary {
    color: var(--pf-primary) !important;
    border-color: var(--pf-primary) !important;
}
.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary,
.btn-outline-primary.active {
    background: var(--pf-primary) !important;
    color: #fff !important;
    border-color: var(--pf-primary) !important;
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.2) !important;
}

/* Same fix for other outline button variants in btn-check toggle groups */
.btn-check:checked + .btn-outline-secondary { background: #64748b !important; color: #fff !important; border-color: #64748b !important; }
.btn-check:checked + .btn-outline-success { background: var(--pf-success) !important; color: #fff !important; border-color: var(--pf-success) !important; }
.btn-check:checked + .btn-outline-danger { background: var(--pf-danger) !important; color: #fff !important; border-color: var(--pf-danger) !important; }
.btn-check:checked + .btn-outline-warning { background: var(--pf-warning) !important; color: #fff !important; border-color: var(--pf-warning) !important; }
.btn-check:checked + .btn-outline-info { background: var(--pf-info) !important; color: #fff !important; border-color: var(--pf-info) !important; }

/* ─── Form Controls ─── */
.form-control, .form-select {
    border: 1px solid var(--pf-border) !important;
    border-radius: 8px !important;
    font-size: 0.8125rem;
    padding: 8px 12px;
    color: var(--pf-text);
    transition: border-color var(--pf-transition), box-shadow var(--pf-transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--pf-primary) !important;
    box-shadow: 0 0 0 3px var(--pf-primary-soft) !important;
}
.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--pf-text);
    margin-bottom: 4px;
}
.form-check-input:checked {
    background-color: var(--pf-primary);
    border-color: var(--pf-primary);
}
.input-group-text {
    background: var(--pf-bg) !important;
    border-color: var(--pf-border) !important;
    font-size: 0.8125rem;
}

/* ─── Badges ─── */
.badge {
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    padding: 4px 8px;
    border-radius: 5px;
}
.bg-success { background-color: var(--pf-success) !important; }
.bg-danger { background-color: var(--pf-danger) !important; }
.bg-warning { background-color: var(--pf-warning) !important; color: #fff !important; }
.bg-info { background-color: var(--pf-info) !important; }
.bg-primary { background-color: var(--pf-primary) !important; }
.bg-secondary { background-color: #64748b !important; }
.bg-success-subtle { background-color: var(--pf-success-soft) !important; }
.bg-danger-subtle { background-color: var(--pf-danger-soft) !important; }
.bg-warning-subtle { background-color: var(--pf-warning-soft) !important; }
.bg-info-subtle { background-color: var(--pf-info-soft) !important; }

/* ─── Alerts ─── */
.alert {
    border-radius: var(--pf-radius) !important;
    font-size: 0.8125rem;
    border: none !important;
}
.alert-success { background: var(--pf-success-soft); color: #15803d; }
.alert-danger { background: var(--pf-danger-soft); color: #b91c1c; }
.alert-warning { background: var(--pf-warning-soft); color: #92400e; }
.alert-info { background: var(--pf-info-soft); color: #1d4ed8; }

/* ─── Modals ─── */
.modal-content {
    border: none !important;
    border-radius: var(--pf-radius-lg) !important;
    box-shadow: var(--pf-shadow-lg) !important;
}
.modal-header {
    border-bottom: 1px solid var(--pf-border-light) !important;
    padding: 16px 24px !important;
}
.modal-body { padding: 20px 24px !important; }
.modal-footer {
    border-top: 1px solid var(--pf-border-light) !important;
    padding: 12px 24px !important;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
    font-size: 0.75rem;
    margin-bottom: 0;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: "/" !important;
    color: var(--pf-text-muted);
}
.breadcrumb-item a {
    color: var(--pf-text-secondary);
    text-decoration: none;
}
.breadcrumb-item a:hover { color: var(--pf-primary); }

/* ─── Pagination ─── */
.page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    font-size: 0.8125rem;
    border: 1px solid var(--pf-border);
    color: var(--pf-text-secondary);
}
.page-item.active .page-link {
    background-color: var(--pf-primary) !important;
    border-color: var(--pf-primary) !important;
}

/* ─── Dropdown ─── */
.dropdown-menu {
    border: 1px solid var(--pf-border) !important;
    border-radius: var(--pf-radius) !important;
    box-shadow: var(--pf-shadow-lg) !important;
    padding: 6px !important;
    font-size: 0.8125rem;
}
.dropdown-item {
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 0.8125rem;
    color: var(--pf-text);
    transition: background var(--pf-transition);
}
.dropdown-item:hover, .dropdown-item:focus {
    background: var(--pf-primary-soft) !important;
    color: var(--pf-primary) !important;
}

/* ─── Nav Pills / Tabs ─── */
.nav-pills .nav-link {
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--pf-text-secondary);
    padding: 8px 16px;
    transition: all var(--pf-transition);
}
.nav-pills .nav-link:hover {
    background: var(--pf-primary-soft);
    color: var(--pf-primary);
}
.nav-pills .nav-link.active {
    background: var(--pf-primary) !important;
    color: #fff !important;
}

/* ─── Compliance Banner ─── */
.alert-compliance {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24 !important;
    border-radius: var(--pf-radius) !important;
}

/* ─── KPI Stat Cards ─── */
.card .text-uppercase.fs-11 {
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--pf-text-muted) !important;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── Utility additions ─── */
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.rounded-lg { border-radius: var(--pf-radius-lg) !important; }

/* ─── Print ─── */
@media print {
    .topbar-custom, .app-sidebar-menu, .breadcrumb, .btn { display: none !important; }
    .content-page { margin-left: 0 !important; }
    .content { padding: 0 !important; }
}

/* ─── Responsive refinements ─── */
@media (max-width: 768px) {
    .content { padding: 16px !important; }
    .card-body { padding: 16px !important; }
    .grid-stack { min-height: auto; }
}

/* ─── Animations ─── */
@media (prefers-reduced-motion: no-preference) {
    .card { transition: box-shadow 200ms ease, transform 200ms ease; }
    .btn { transition: all 150ms ease; }
}

/* ═══════════════════════════════════════════════════════
   End Design System — Component overrides below
   ═══════════════════════════════════════════════════════ */

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Border dashed utility */
.border-dashed {
    border-style: dashed !important;
}

/* Sidebar bottom menu (Compte) — mirrors #sidebar-menu styles */
.sidebar-bottom-menu {
    flex-shrink: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 10px;
}
.sidebar-bottom-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-bottom-menu ul > li > a {
    color: #2f384f;
    display: block;
    padding: 10px 20px;
    position: relative;
    transition: all .4s;
    font-size: .938rem;
    font-weight: 500;
}
.sidebar-bottom-menu ul > li > a > span {
    vertical-align: middle;
}
.sidebar-bottom-menu ul > li > a i,
.sidebar-bottom-menu ul > li > a svg {
    display: inline-block;
    line-height: 1.0625rem;
    margin: 0 7px 0 3px;
    text-align: center;
    vertical-align: middle;
    width: 16px;
    font-size: 1rem;
}
.sidebar-bottom-menu ul > li > a:hover,
.sidebar-bottom-menu ul > li > a:focus,
.sidebar-bottom-menu ul > li > a:active {
    color: #537aef;
    text-decoration: none;
}
.sidebar-bottom-menu .menu-title {
    padding: 8px 20px;
    letter-spacing: .05em;
    pointer-events: none;
    font-weight: 600;
    cursor: default;
    font-size: .6875rem;
    text-transform: uppercase;
    color: #2f384f;
    opacity: .75;
}
.sidebar-bottom-menu .menuitem-active > a,
.sidebar-bottom-menu .menuitem-active .active {
    color: #537aef;
}
/* Dark mode */
body[data-menu-color="dark"] .sidebar-bottom-menu {
    border-top-color: rgba(255, 255, 255, 0.1);
}
body[data-menu-color="dark"] .sidebar-bottom-menu ul > li > a {
    color: #7d8099;
}
body[data-menu-color="dark"] .sidebar-bottom-menu ul > li > a:hover,
body[data-menu-color="dark"] .sidebar-bottom-menu ul > li > a:focus,
body[data-menu-color="dark"] .sidebar-bottom-menu ul > li > a:active {
    color: #e0e3ea;
}
body[data-menu-color="dark"] .sidebar-bottom-menu .menu-title {
    color: #7d8099;
}

/* Kanban board */
.kanban-column {
    min-height: 200px;
}
.kanban-card.dragging {
    opacity: 0.5;
}
.cursor-pointer {
    cursor: pointer;
}

/* Password strength indicator */
.strength-bar {
    height: 4px;
    border-radius: 2px;
    transition: background-color 0.3s;
}

/* ─── Rich Text Editor ─── */
.rich-editor-wrapper {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    overflow: hidden;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.rich-editor-wrapper:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}
.rich-editor-wrapper.is-invalid {
    border-color: #dc3545;
}

.rich-editor-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 6px 8px;
}
.rich-editor-toolbar .btn-light {
    border-color: transparent;
    background: transparent;
    color: #495057;
    padding: 3px 7px;
    line-height: 1;
}
.rich-editor-toolbar .btn-light:hover {
    background: #e9ecef;
    color: #212529;
}
.rich-editor-toolbar .btn-light.active {
    background: #537aef;
    color: #fff;
    border-color: #537aef;
}
.rich-editor-toolbar .vr {
    opacity: .25;
}

.rich-editor-body {
    min-height: 80px;
}
.rich-editor-body .tiptap {
    padding: 8px 12px;
    min-height: 80px;
    outline: none;
    font-size: .875rem;
    line-height: 1.5;
    color: #212529;
}
.rich-editor-body .tiptap:focus {
    outline: none;
}
.rich-editor-body .tiptap p {
    margin-bottom: .35em;
}
.rich-editor-body .tiptap p:last-child {
    margin-bottom: 0;
}
.rich-editor-body .tiptap h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: .35em;
}
.rich-editor-body .tiptap h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .35em;
}
.rich-editor-body .tiptap ul,
.rich-editor-body .tiptap ol {
    padding-left: 1.25em;
    margin-bottom: .35em;
}
.rich-editor-body .tiptap blockquote {
    border-left: 3px solid #dee2e6;
    padding-left: .75em;
    color: #6c757d;
    margin: .35em 0;
}
.rich-editor-body .tiptap hr {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: .75em 0;
}

/* Toggle link */
.rich-editor-toggle {
    opacity: .6;
    transition: opacity .2s;
}
.rich-editor-toggle:hover {
    opacity: 1;
    color: #537aef !important;
}

/* Color picker */
.rich-color-btn {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 2px 7px 4px !important;
}
.rich-color-indicator {
    display: block;
    width: 14px;
    height: 3px;
    border-radius: 1px;
    margin-top: -1px;
}
.rich-color-palette {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    width: 180px;
}
.rich-color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform .1s, border-color .1s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rich-color-swatch:hover {
    transform: scale(1.15);
    border-color: #adb5bd;
}
.rich-color-swatch.ring {
    border-color: #212529;
    box-shadow: 0 0 0 1px #fff, 0 0 0 2.5px #212529;
}
.rich-color-reset {
    background: #fff;
    border-color: #dee2e6;
    color: #adb5bd;
}
.rich-color-reset:hover {
    border-color: #adb5bd;
    color: #495057;
}

/* ─── Email Editor ─── */
.email-editor-wrapper .rich-editor-body {
    min-height: 250px;
}
.email-editor-wrapper .rich-editor-body .tiptap {
    min-height: 250px;
}

/* Link input popover */
.email-editor-link-input {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    padding: 8px;
    width: 320px;
}
.email-editor-link-input .form-control {
    font-size: .8125rem;
    padding: 4px 8px;
}
.email-editor-link-input .btn {
    font-size: .75rem;
    padding: 3px 10px;
}

/* Variable insertion buttons */
.variable-insert-btn {
    cursor: pointer;
    transition: background-color .15s, transform .1s;
    font-size: .8125rem;
}
.variable-insert-btn:hover {
    transform: scale(1.05);
}

/* Email preview: highlight variables */
.email-preview-var {
    background: #fff3cd;
    border-radius: 3px;
    padding: 1px 4px;
    font-weight: 500;
    color: #664d03;
}

/* Tiptap link styling in editor */
.rich-editor-body .tiptap a {
    color: #537aef;
    text-decoration: underline;
    cursor: pointer;
}

/* ─── Send Email Modal ─── */
.email-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.email-modal-container {
    background: #fff;
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.email-modal-container > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.email-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.email-modal-header h5 {
    margin: 0;
    font-weight: 600;
}
.email-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.email-modal-footer {
    padding: 12px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.email-modal-container .email-editor-wrapper .rich-editor-body {
    min-height: 200px;
}
.email-modal-container .email-editor-wrapper .rich-editor-body .tiptap {
    min-height: 200px;
}
.email-modal-section-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f3f4f6;
}

/* Rendered rich content on show pages */
.rich-content p { margin-bottom: .35em; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: .35em; }
.rich-content h3 { font-size: 1rem; font-weight: 600; margin-bottom: .35em; }
.rich-content ul,
.rich-content ol { padding-left: 1.25em; margin-bottom: .35em; }
.rich-content blockquote {
    border-left: 3px solid #dee2e6;
    padding-left: .75em;
    color: #6c757d;
    margin: .35em 0;
}
.rich-content hr {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: .75em 0;
}

/* ─── Quote Editor ─── */
.quote-paper {
    background: #fff;
    max-width: 1060px;
    padding: 40px 48px;
    box-shadow: 0 2px 20px rgba(0,0,0,.08);
    border-radius: 4px;
    margin-bottom: 24px;
}

/* Toolbar sticky top */
.quote-toolbar {
    position: sticky;
    top: 70px;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 20px 10px;
    margin: -20px -20px 50px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

/* Save indicator */
.quote-save-indicator {
    font-size: .8125rem;
    transition: opacity .3s;
}
.quote-save-indicator.saving {
    color: #f59e0b;
}
.quote-save-indicator.saved {
    color: #10b981;
}

/* Editable fields on A4 */
.quote-paper .editable-field {
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 6px;
    margin: -2px -6px;
    transition: border-color .2s, background .2s;
    cursor: text;
}
.quote-paper .editable-field:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}
.quote-paper .editable-field:focus-within {
    border-color: #537aef;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(83,122,239,.15);
}

/* Lines table in editor */
.quote-lines-table {
    font-size: .875rem;
    width: 100%;
}
.quote-lines-table thead th {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    font-weight: 600;
    padding: 8px 6px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}
.quote-lines-table tbody td {
    padding: 8px 4px;
    vertical-align: top;
}
.quote-lines-table .form-control,
.quote-lines-table .form-select {
    font-size: .8125rem;
    padding: 6px 8px;
    border-color: transparent;
    background: transparent;
}
.quote-lines-table .form-control:focus,
.quote-lines-table .form-select:focus {
    border-color: #537aef;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(83,122,239,.15);
}
.quote-lines-table .form-control:hover,
.quote-lines-table .form-select:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* Designation column — title input */
.quote-lines-table .quote-line-title {
    font-size: .875rem;
    font-weight: 500;
    padding: 6px 10px;
}
/* Description sub-field */
.quote-lines-table .quote-line-desc {
    font-size: .75rem;
    color: #6b7280;
    padding: 4px 10px;
}
.quote-line-desc-editor .rich-editor-body-compact {
    font-size: .75rem;
    color: #6b7280;
}

/* Section row */
.quote-section-row td {
    background: #f3f4f6;
    font-weight: 600;
    font-size: .875rem;
    padding: 8px 10px !important;
    border: none;
}

/* Text row */
.quote-text-row td {
    color: #6b7280;
    font-style: italic;
    padding: 4px 10px !important;
}

/* VAT summary block */
.quote-vat-summary {
    max-width: 320px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    background: #fff;
}
.quote-vat-summary .table td,
.quote-vat-summary .table th {
    padding: 4px 0;
    border: none;
}

/* Totals block */
.quote-totals {
    margin-left: auto;
    max-width: 320px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    background: #f9fafb;
}
.quote-totals .table td {
    padding: 4px 0;
    border: none;
}

/* Drag handle — only the handle is draggable */
.quote-drag-handle {
    cursor: grab;
    color: #9ca3af;
    transition: color .2s;
    display: inline-flex;
    padding: 2px;
    border-radius: 3px;
}
.quote-drag-handle:hover {
    color: #4b5563;
    background: #f3f4f6;
}
.quote-drag-handle:active {
    cursor: grabbing;
}
.quote-line-dragging {
    opacity: 0.4;
    background: #e5e7eb;
}

/* Add line button */
.quote-add-line-btn {
    border: 2px dashed #d1d5db;
    color: #6b7280;
    background: transparent;
    border-radius: 6px;
    padding: 8px;
    width: 100%;
    font-size: .8125rem;
    transition: all .2s;
}
.quote-add-line-btn:hover {
    border-color: #537aef;
    color: #537aef;
    background: rgba(83,122,239,.04);
}

/* Product search dropdown */
.quote-product-search {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    min-width: 320px;
    width: 100%;
}
.quote-product-search-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: .8125rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background .15s;
}
.quote-product-search-item:hover {
    background: #f3f4f6;
}
.quote-product-search-item:last-child {
    border-bottom: none;
}

/* Signature pad */
.quote-signature-pad {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: crosshair;
}

/* Sender block hover */
.quote-sender-block {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: border-color .2s, background .2s;
}
.quote-sender-block:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* Rich editor compact for text lines */
.rich-editor-body-compact {
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    font-size: .8125rem;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}
.rich-editor-body-compact .ProseMirror {
    outline: none;
    min-height: 30px;
}
.rich-editor-body-compact .ProseMirror p {
    margin-bottom: 2px;
}

/* Text line editor wrapper */
.quote-text-line-editor {
    width: 100%;
}
.quote-text-line-editor .btn.active {
    background: #e5e7eb;
}

/* Line transitions */
.quote-line-enter {
    animation: quoteLineSlideIn .3s ease-out;
}
@keyframes quoteLineSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.quote-line-leave {
    animation: quoteLineSlideOut .2s ease-in forwards;
}
@keyframes quoteLineSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); height: 0; padding: 0; overflow: hidden; }
}

/* ═══════════════════════════════════════════════════════
   Material Symbols (Google) — helpers
   Usage : <span class="ms">receipt_long</span>
   Modifiers : .ms-fill, .ms-sm/.ms-lg, .ms-w300 .. .ms-w700
   ═══════════════════════════════════════════════════════ */
.ms,
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    font-size: 20px;
}
/* Tailles */
.ms-sm { font-size: 16px; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20; }
.ms-md { font-size: 20px; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.ms-lg { font-size: 28px; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 40; }
.ms-xl { font-size: 36px; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48; }

/* Override pour les icônes Material Symbols dans la sidebar — match la taille des SVG Feather */
#sidebar-menu .tp-link > .ms,
#sidebar-menu a[data-bs-toggle="collapse"] > .ms,
#side-menu-bottom .tp-link > .ms {
    font-size: 22px;
    margin-right: 12px;
    width: 22px;
    text-align: center;
}
/* Variantes */
.ms-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.ms-w300 { font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.ms-w500 { font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.ms-w600 { font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24; }
.ms-w700 { font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 24; }
