/* Gestion360 – thème Maison DV, accents dorés */

:root {
    --bg-dark:      #0f1219;
    --bg-card:      #181c24;
    --bg-sidebar:   #0d1017;
    --text:         #e8eaed;
    --text-muted:   #7a8394;
    --accent:       #c9a84c;
    --accent-hover: #b8973b;
    --accent-glow:  rgba(201, 168, 76, 0.18);
    --accent-faint: rgba(201, 168, 76, 0.07);
    --input-bg:     #1e2330;
    --input-border: #2c3347;
    --error:        #f87171;
    --gold-line:    1px solid rgba(201, 168, 76, 0.18);
}

/* ══ Animation globale lévitation (inspirée logo connexion) ═ */
@keyframes dv-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}
@keyframes dv-shimmer {
    0%   { opacity: .6; }
    50%  { opacity: 1; }
    100% { opacity: .6; }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse 60% 40% at 10% 20%, rgba(201,168,76,.04) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 90% 80%, rgba(201,168,76,.03) 0%, transparent 70%);
    color: var(--text);
    min-height: 100vh;
}

.messages {
    list-style: none;
    margin: 0;
    padding: 0.4rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.message {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.message-success { background: #065f46; color: #a7f3d0; }
.message-error { background: #7f1d1d; color: #fecaca; }
.message-info { background: #1e3a5f; color: #bfdbfe; }

/* ----- Page de connexion ----- */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.login-title {
    margin: 0 0 1.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-errors {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0.75rem;
    background: rgba(248, 113, 113, 0.15);
    border-radius: 8px;
    color: var(--error);
    font-size: 0.9rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.22);
}

.field-error {
    font-size: 0.85rem;
    color: var(--error);
}

.form-group-checkbox {
    gap: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
}

.checkbox-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-left: 1.6rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #c9a84c 0%, #b8973b 100%);
    color: #0f1219;
    font-weight: 700;
    letter-spacing: .02em;
    margin-top: 0.5rem;
    box-shadow: 0 2px 12px rgba(201,168,76,.25);
    transition: background .2s, box-shadow .2s, transform .15s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d4b55a 0%, #c9a84c 100%);
    box-shadow: 0 4px 20px rgba(201,168,76,.4);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
}

.link-forgot {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
}

.link-forgot:hover {
    text-decoration: underline;
}

/* ----- Page d'accueil (connecté) ----- */
.workspace {
    display: flex;
    min-height: 100vh;
    height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #0d1017 0%, #0b0f16 100%);
    border-right: var(--gold-line);
    display: flex;
    flex-direction: column;
    width: 280px;
    flex: 0 0 280px;
    min-width: 280px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.2s ease, min-width 0.2s ease, flex 0.2s ease;
}

.sidebar.sidebar-expanded {
    width: 340px;
    flex: 0 0 340px;
    min-width: 340px;
}

.sidebar-top {
    padding: 1rem;
    border-bottom: var(--gold-line);
}

.workspace-name {
    background: linear-gradient(135deg, rgba(201,168,76,.12) 0%, rgba(201,168,76,.05) 100%);
    border: var(--gold-line);
    color: #e8d89a;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: .03em;
    margin-bottom: 0.75rem;
}

.global-search {
    width: 100%;
    border: 1px solid #252e40;
    background: rgba(201,168,76,.04);
    color: #d9dde4;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    transition: border-color .2s, box-shadow .2s;
}
.global-search:focus {
    outline: none;
    border-color: rgba(201,168,76,.5);
    box-shadow: 0 0 0 3px rgba(201,168,76,.1);
}

.sidebar-nav {
    padding: 0.8rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.menu-group {
    margin-bottom: 1.1rem;
}

.menu-title {
    margin: 0 0 0.45rem;
    font-size: 0.73rem;
    color: #838da0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.menu-link {
    display: block;
    color: #d7dce5;
    text-decoration: none;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.menu-link-heading {
    flex: 1;
}
.menu-link-active {
    background: rgba(201,168,76,.13);
    color: #e8d89a;
    border-left: 2px solid var(--accent);
    padding-left: calc(0.55rem - 2px);
}

.menu-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.menu-link:hover {
    background: rgba(201,168,76,.07);
    color: #e8d89a;
}

.menu-link:visited {
    color: #d7dce5;
}

.menu-empty {
    display: block;
    color: #8390a5;
    font-size: 0.85rem;
    padding: 0.3rem 0.55rem;
}

.accordion-group {
    margin-top: 0.5rem;
}

.accordion-toggle {
    width: 100%;
    background: transparent;
    border: 0;
    color: #d7dce5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.15rem;
    cursor: pointer;
}

.mini-toggle {
    width: 28px;
    min-width: 28px;
    padding: 0.25rem;
}

.accordion-chevron {
    color: #8f9bb2;
    transition: transform 0.2s;
}

.accordion-toggle.open .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-panel {
    display: none;
    margin-top: 0.25rem;
}

.accordion-panel.open {
    display: block;
}

.service-accordion {
    margin: 0.15rem 0 0.2rem;
}

.service-toggle {
    width: 100%;
    background: transparent;
    border: 0;
    color: #d7dce5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.service-toggle:hover {
    background: rgba(201,168,76,.07);
    color: #e8d89a;
}

.service-toggle.open {
    background: rgba(201,168,76,.09);
    color: #e8d89a;
}

.service-panel {
    display: none;
    margin: 0.15rem 0 0.35rem 0.7rem;
    border-left: 1px solid rgba(201,168,76,.2);
    padding-left: 0.45rem;
}

.service-panel.open {
    display: block;
}

.submenu-link {
    display: block;
    color: #b8c3d9;
    text-decoration: none;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    font-size: 0.84rem;
}

.submenu-link:hover {
    background: rgba(201,168,76,.07);
    color: #e8d89a;
}

.submenu-link:visited {
    color: #b8c3d9;
}

.sidebar-footer {
    margin-top: auto;
    border-top: var(--gold-line);
    padding: 0.9rem;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.profile-button {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    padding: 0.3rem;
    border-radius: 8px;
    cursor: pointer;
}

.profile-button:hover {
    background: rgba(201,168,76,.07);
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
}

.profile-avatar-fallback {
    background: linear-gradient(135deg, #c9a84c, #b8973b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0f1219;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-meta strong {
    font-size: 0.9rem;
}

.profile-meta span {
    font-size: 0.75rem;
    color: #97a0b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.76rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    font-weight: 700;
}

.main-panel {
    background: #0f1219;
    background-image:
        radial-gradient(ellipse 55% 35% at 80% 5%, rgba(201,168,76,.035) 0%, transparent 65%),
        radial-gradient(ellipse 40% 50% at 5% 90%, rgba(201,168,76,.025) 0%, transparent 65%);
    padding: 1rem 1.25rem;
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: var(--gold-line);
}

.panel-tags {
    display: flex;
    gap: 0.5rem;
}

.tag {
    background: rgba(201,168,76,.07);
    border: 1px solid rgba(201,168,76,.2);
    color: #c9b97a;
    border-radius: 6px;
    font-size: 0.78rem;
    padding: 0.35rem 0.55rem;
}

a.tag.tag-link {
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background .2s, border-color .2s;
}

a.tag.tag-link:hover {
    background: rgba(201,168,76,.14);
    border-color: rgba(201,168,76,.4);
    color: #e8d48a;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(201,168,76,.45);
    transition: background .2s, border-color .2s, box-shadow .2s;
}

.btn-outline:hover {
    background: var(--accent-faint);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(201,168,76,.15);
}

.discussion-card {
    background: #111620;
    border: var(--gold-line);
    border-radius: 10px;
    padding: 1rem;
    flex: 1;
    min-height: 0;
}

.discussion-card h1 {
    margin: 0 0 0.6rem;
    font-size: 2rem;
}

.discussion-card h2 {
    margin: 0;
    font-size: 1.4rem;
}

.discussion-card p {
    color: #929cb0;
}

.facturation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* KPI facturation (style v1) */
.facturation-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
    .facturation-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .facturation-kpis { grid-template-columns: 1fr; }
}
.facturation-kpi-card {
    background: linear-gradient(135deg, #161b26 0%, #111620 100%);
    border: var(--gold-line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    position: relative;
    transition: border-color .2s, box-shadow .2s;
}
.facturation-kpi-card:hover {
    border-color: rgba(201,168,76,.35);
    box-shadow: 0 4px 20px rgba(201,168,76,.08);
}
.facturation-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e8d89a;
}
.facturation-kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 100%;
}
.facturation-kpi-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Filtres facturation (style v1) */
.facturation-filters-form {
    background: var(--bg-card);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.facturation-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.facturation-filters-row:last-of-type { margin-bottom: 0; }
.facturation-filter-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.facturation-filter-select,
.facturation-filter-input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: var(--text);
    font-size: 0.9rem;
    min-width: 120px;
}
.facturation-filter-input { min-width: 140px; }
.facturation-filter-date { min-width: 100px; }
.facturation-filters-search-row {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--input-border);
}
.facturation-filter-search {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-size: 0.9rem;
}
.facturation-filter-reset {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}
.facturation-filter-reset:hover {
    background: var(--input-border);
    color: var(--text);
}

.facturation-table-wrap {
    border: var(--gold-line);
    border-radius: 8px;
    overflow: auto;
    background: #0d1017;
}

.facturation-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}

.facturation-table th,
.facturation-table td {
    border-bottom: 1px solid #222b3b;
    padding: 0.55rem 0.6rem;
    text-align: left;
    font-size: 0.84rem;
}

.facturation-table th {
    background: #192133;
    color: #b8c4dd;
    font-weight: 700;
}

.facturation-table td {
    color: #dbe4f6;
}

.cell-tag {
    display: inline-block;
    padding: 0.18rem 0.45rem;
    border-radius: 6px;
    font-size: 0.78rem;
    border: 1px solid #394356;
    background: #1e2738;
}

.table-empty {
    text-align: center;
    color: #93a0b8;
}

.societe-dv { background: #1d4ed8; color: #fff; border-color: #1e40af; }
.societe-pp { background: #15803d; color: #fff; border-color: #166534; }
.societe-cds { background: #d97706; color: #fff; border-color: #b45309; }

.action-reunion { background: #78350f; color: #fde68a; border-color: #92400e; }
.action-catalogue { background: #14532d; color: #bbf7d0; border-color: #166534; }
.action-perso { background: #7c2d12; color: #fed7aa; border-color: #9a3412; }
.action-creation { background: #1e3a8a; color: #bfdbfe; border-color: #1d4ed8; }
.action-divers { background: #581c87; color: #e9d5ff; border-color: #7e22ce; }
.action-photo { background: #155e75; color: #a5f3fc; border-color: #0e7490; }
.action-communication { background: #14532d; color: #86efac; border-color: #15803d; }

.pj-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #c9a84c;
    color: #0f1219;
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

.pj-link {
    display: inline-block;
    margin-right: 0.3rem;
    color: #93c5fd;
    font-size: 0.75rem;
    text-decoration: underline;
}

.task-status {
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.76rem;
    border: 1px solid transparent;
}

.task-status-a_faire {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
}

.task-status-pas_fini {
    background: #7c2d12;
    color: #fdba74;
    border-color: #9a3412;
}

.task-status-fini {
    background: #14532d;
    color: #86efac;
    border-color: #166534;
}

.messages-box {
    margin-top: 1rem;
    border: var(--gold-line);
    border-radius: 8px;
    flex: 1;
    min-height: 200px;
    background: #0c1018;
    overflow-y: auto;
    padding: 0.8rem;
}

.composer {
    display: flex;
    gap: 0.7rem;
    margin-top: 1rem;
    align-items: center;
}

.composer-input-wrap {
    position: relative;
    flex: 1;
}

.composer input {
    width: 100%;
    border: 1px solid #2f3648;
    background: #111620;
    border-radius: 8px;
    color: #e3e7ef;
    padding: 0.75rem;
}

.chat-message {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 34px;
}

.chat-avatar-fallback {
    background: linear-gradient(135deg, #c9a84c, #b8973b);
    color: #0f1219;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.chat-bubble {
    background: #131820;
    border: var(--gold-line);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    min-width: 0;
    max-width: 92%;
    transition: border-color .15s;
}
.chat-bubble:hover {
    border-color: rgba(201,168,76,.3);
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.chat-meta strong {
    font-size: 0.85rem;
}

.chat-meta time {
    font-size: 0.72rem;
    color: #93a0b8;
}

.chat-bubble p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.mention-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    background: #0f1520;
    border: var(--gold-line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    display: none;
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
}

.mention-suggestions.open {
    display: block;
}

.mention-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #d7dce5;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    font-size: 0.88rem;
}

.mention-item small {
    color: #99a6bc;
}

.mention-item:hover {
    background: rgba(201,168,76,.08);
    color: #e8d89a;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 18, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal-overlay[aria-hidden="true"] {
    display: none !important;
    pointer-events: none;
}

.profile-modal {
    width: min(900px, 96vw);
    max-height: 90vh;
    background: #0f1520;
    border: var(--gold-line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(201,168,76,.06);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    border-bottom: var(--gold-line);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: transparent;
    border: 0;
    color: #b7c0d2;
    font-size: 1.1rem;
    cursor: pointer;
}

.modal-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.65rem 1rem;
    border-bottom: var(--gold-line);
    overflow-x: auto;
}

.modal-tab {
    background: rgba(201,168,76,.04);
    color: #c0cad8;
    border: 1px solid rgba(201,168,76,.14);
    border-radius: 7px;
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.modal-tab:hover:not(.active) {
    background: rgba(201,168,76,.09);
    border-color: rgba(201,168,76,.3);
}

.modal-tab.active {
    background: linear-gradient(135deg, #c9a84c, #b8973b);
    border-color: #c9a84c;
    color: #0f1219;
    font-weight: 700;
}

.modal-content {
    padding: 1rem;
    overflow-y: auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.profile-form .form-group input[type="text"],
.profile-form .form-group input[type="password"],
.profile-form .form-group input[type="email"],
.profile-form .form-group input[type="file"] {
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 0.93rem;
    background: #111620;
    border: 1px solid #2f3648;
    border-radius: 8px;
    color: #e3e7ef;
}

.profile-form .form-group input[type="date"],
.profile-form .form-group input[type="number"],
.profile-form .form-group select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 0.93rem;
    background: #111620;
    border: 1px solid #2f3648;
    border-radius: 8px;
    color: #e3e7ef;
}

.modal-separator {
    border: 0;
    border-top: 1px solid #2a3040;
    margin: 1rem 0;
}

.inline-form {
    margin-bottom: 0.8rem;
}

.history-list {
    display: grid;
    gap: 0.7rem;
}

.history-item {
    border: 1px solid #2b3344;
    background: #131926;
    border-radius: 8px;
    padding: 0.7rem;
}

.history-item-unread {
    border-color: rgba(201,168,76,.5);
    box-shadow: 0 0 8px rgba(201,168,76,.1);
}

.history-item h4 {
    margin: 0 0 0.35rem;
}

.history-item p {
    margin: 0 0 0.35rem;
    color: #95a0b4;
}

.history-item time {
    color: #77829a;
    font-size: 0.8rem;
}

.task-modal {
    width: min(980px, 98vw);
}

.quick-actions {
    border: 1px solid #2d3546;
    background: #1b2231;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.9rem;
    color: #b9c3d8;
    font-size: 0.9rem;
    font-weight: 600;
}

.task-modal-footer {
    margin-top: 1rem;
    display: flex;
    gap: 0.55rem;
    justify-content: flex-end;
}

/* Modal Nouveau projet de service (visuel V1) */
.projet-service-modal .modal-header-projet-v1 {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.projet-service-modal .modal-header-projet-v1 h3 {
    flex: 1;
    min-width: 200px;
}
.projet-service-modal .modal-header-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.projet-service-modal .modal-header-type label {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.projet-service-modal .modal-header-type select {
    min-width: 160px;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--text);
}
.form-projet-v1 .form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 2rem;
}
.form-projet-v1 .form-col {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.form-projet-v1 .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}
.form-projet-v1 .form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.form-projet-v1 .form-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--input-border);
}
.form-projet-v1 .form-section-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.form-projet-v1 .form-section-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.form-projet-v1 .form-files-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.form-projet-v1 .btn-icon-add {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #6d28d9;
    color: #fff;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.form-projet-v1 .btn-icon-add:hover {
    background: #5b21b6;
}
.form-projet-v1 .btn-enregistrer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.form-projet-v1 .btn-enregistrer::before {
    content: "✓";
    font-weight: bold;
}
.form-projet-v1 .btn-secondary {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--input-border);
}
.form-projet-v1 .btn-secondary:hover {
    background: #3c4043;
}
.hidden-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
}

/* Projets : portée, bouton déplier tâches, sous-tableau tâches */
.cell-tag-commun { background: #1b4332; color: #95d5b2; border-color: #1b4332; }
.cell-tag-mon-service { background: #1e3a5f; color: #90caf9; border-color: #1e3a5f; }
.cell-tag-projet { background: #2d3748; color: #e2e8f0; border-color: #2d3748; }
.cell-tag-demande { background: #553c9a; color: #e9d8fd; border-color: #553c9a; }
.projets-table .col-toggle { width: 40px; text-align: center; }
.btn-toggle-taches {
    background: transparent;
    border: none;
    color: #8b949e;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
}
.btn-toggle-taches:hover { color: #e3e7ef; }
.btn-toggle-taches[aria-expanded="true"] .toggle-icon { transform: rotate(90deg); display: inline-block; }
.td-taches-wrap { padding: 0 !important; vertical-align: top; background: #0d1117; }
.taches-list-wrap { padding: 0.75rem 1rem 1rem 2.5rem; }
.taches-sous-table { margin: 0; font-size: 0.9rem; }
.taches-sous-table th { padding: 0.4rem 0.6rem; }
.taches-sous-table td { padding: 0.5rem 0.6rem; }
.form-group-radio ul { list-style: none; margin: 0; padding: 0; }
.form-group-radio li { margin-bottom: 0.35rem; }
.form-group-radio label { font-weight: normal; margin-left: 0.35rem; }

/* Champs avec liste de suggestions : flèche visible pour indiquer la liste */
.input-with-list {
    position: relative;
    display: block;
}
.input-with-list input {
    padding-right: 2rem;
    width: 100%;
}
.input-with-list .input-list-arrow {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8b949e;
    font-size: 0.75rem;
    pointer-events: none;
    user-select: none;
}
.profile-form .form-group .input-with-list input[type="text"],
.profile-form .form-group .input-with-list input[type="number"] {
    width: 100%;
}

.fournisseur-table th,
.fournisseur-table td {
    white-space: nowrap;
    min-width: 130px;
}

/* Espace fournisseur (portail) */
.page-espace-fournisseur .espace-fournisseur-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.page-espace-fournisseur .espace-fournisseur-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.page-espace-fournisseur .espace-fournisseur-card {
    border: 1px solid #2b3344;
    border-radius: 8px;
    overflow: hidden;
    background: #151d2e;
}
.page-espace-fournisseur .espace-fournisseur-card-image {
    aspect-ratio: 1;
    background: #1a2332;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-espace-fournisseur .espace-fournisseur-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.page-espace-fournisseur .espace-fournisseur-card-image .no-image {
    color: #5a6b85;
    font-size: 0.85rem;
}
.page-espace-fournisseur .espace-fournisseur-card-body {
    padding: 0.6rem;
}
.page-espace-fournisseur .espace-fournisseur-card-body .code-barre {
    font-size: 0.8rem;
    color: #8a9bb5;
    margin: 0.2rem 0;
}
.page-espace-fournisseur .espace-fournisseur-thumb {
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    vertical-align: middle;
}
.page-espace-fournisseur .mb-3 { margin-bottom: 0.75rem; }

.page-extranet .extranet-layout {
    min-height: 100vh;
}

.page-extranet .extranet-sidebar {
    background: linear-gradient(180deg, #0d1320 0%, #0b1222 100%);
}

.page-extranet .extranet-main {
    background: radial-gradient(circle at top right, #1a2d42 0%, #101827 38%, #0d1422 100%);
}

.extranet-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    margin: 0 1rem;
}

.extranet-action-bubble {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: rgba(14, 165, 164, 0.15);
    border: 1px solid #0ea5a4;
    color: #a7f3f2;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.extranet-action-bubble:hover {
    background: rgba(14, 165, 164, 0.3);
    color: #fff;
}

.page-extranet .extranet-hero {
    margin-bottom: 0.9rem;
}

.page-extranet .extranet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.page-extranet .extranet-card h2 {
    margin: 0 0 0.45rem;
    color: #e8edf9;
    font-size: 1.05rem;
}

.page-extranet .extranet-card p {
    margin: 0;
    color: #9fb0cb;
}

.page-extranet .extranet-card-stats {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.page-extranet .extranet-card-stats span {
    font-size: 0.82rem;
    background: #1c2a3f;
    border: 1px solid #2f3f5b;
    color: #c8d6ee;
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
}

.page-extranet .extranet-message-box {
    margin-top: 0.65rem;
    max-height: 160px;
}

.page-extranet .service-subnav {
    padding-left: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}
.page-extranet .service-subnav .submenu-link {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.9rem;
}
.page-extranet .service-subnav .submenu-link-active {
    font-weight: 600;
    color: var(--accent, #c9a84c);
}
.page-extranet .menu-hint {
    font-size: 0.8rem;
    color: #7a8ba8;
    margin: 0.35rem 0 0;
    padding: 0 0 0 0.25rem;
}
.page-extranet .form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-extranet .form-group-checkbox input[type="checkbox"] {
    width: auto;
}
.page-extranet .message-visibility-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}
.page-extranet .form-group-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}
.page-extranet .msg-magasins-list {
    margin-top: 0.75rem;
    padding-left: 0.25rem;
}
.page-extranet .msg-magasins-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 12rem;
    overflow-y: auto;
    margin-top: 0.35rem;
}
.page-extranet .form-row-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 520px) {
    .page-extranet .form-row-two { grid-template-columns: 1fr; }
}
.message-importance-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.message-importance-badge-informatif { background: #475569; color: #fff; }
.message-importance-badge-important { background: #0ea5e9; color: #fff; }
.message-importance-badge-urgent { background: #f59e0b; color: #1e293b; }
.message-importance-badge-critique { background: #dc2626; color: #fff; }
.message-communautaire-content {
    margin: 0.35rem 0;
    white-space: pre-wrap;
}
.message-communautaire-pj {
    margin-top: 0.35rem;
}
.message-communautaire-pj a {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}
.form-hint {
    font-size: 0.85rem;
    color: #7a8ba8;
    margin: 0.5rem 0;
}

.page-extranet .espace-information-action {
    margin: 0.75rem 0;
}
.page-extranet .espace-information-action .btn {
    display: inline-block;
    margin-bottom: 0.35rem;
}
.page-extranet .espace-information-action #info-btn-msg {
    display: block;
    margin-top: 0.25rem;
}
.message-communautaire-no-right {
    padding: 0.5rem 0;
}
.message-communautaire-no-right p {
    margin: 0.5rem 0;
}
.message-communautaire-no-right .btn {
    margin-top: 0.75rem;
}

.page-extranet-catalogue .extranet-catalogue-shell {
    min-height: 74vh;
}

.catalogue-tree {
    border: 1px solid #24344c;
    border-radius: 10px;
    background: #0f1a2a;
    padding: 0.75rem;
    min-height: 66vh;
    display: flex;
    flex-direction: column;
}

.catalogue-tree h2 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
}

.catalogue-breadcrumbs {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
    color: #8fa4c3;
    font-size: 0.82rem;
}

.catalogue-crumb {
    color: #9fb8dd;
    text-decoration: none;
}

.catalogue-crumb.active {
    color: #e5edf9;
    font-weight: 600;
}

.catalogue-article-fournisseur {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.catalogue-fournisseur-link {
    color: #5ec4e8;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.catalogue-fournisseur-link:hover,
.catalogue-fournisseur-link:focus-visible {
    color: #9ee4ff;
    border-bottom-color: #36c1be;
    outline: none;
}

.catalogue-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    align-content: start;
}

.catalogue-univers-list {
    display: grid;
    gap: 0.45rem;
}

.catalogue-univers-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.52rem 0.65rem;
    border: 1px solid #2b405f;
    border-radius: 8px;
    text-decoration: none;
    color: #d3def0;
    background: #141f31;
}

.catalogue-univers-item:hover {
    border-color: #36c1be;
}

.catalogue-univers-item span {
    color: #8ea4c4;
    font-size: 0.78rem;
}

.catalogue-card {
    display: block;
    border: 1px solid #28405e;
    border-radius: 10px;
    overflow: hidden;
    background: #121f31;
    text-decoration: none;
    color: #dbe6f7;
}

.catalogue-card:hover {
    border-color: #36c1be;
    transform: translateY(-1px);
}

.catalogue-card-image {
    width: 100%;
    height: 146px;
    object-fit: cover;
    display: block;
    background: #1b2a3f;
}

.catalogue-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    font-weight: 700;
    color: #6f86aa;
}

.catalogue-card-body {
    padding: 0.55rem 0.65rem 0.65rem;
    display: grid;
    gap: 0.2rem;
}

.catalogue-card-body span {
    color: #8ea3c2;
    font-size: 0.78rem;
}

.catalogue-tree-item {
    margin-bottom: 0.55rem;
}

.catalogue-link,
.catalogue-sublink {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #ced9ea;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

.catalogue-link span,
.catalogue-sublink span {
    font-size: 0.78rem;
    color: #8ca0bf;
}

.catalogue-link:hover,
.catalogue-sublink:hover {
    border-color: #2a425f;
    background: #16263b;
}

.catalogue-link.active,
.catalogue-sublink.active {
    border-color: #0ea5a4;
    color: #ffffff;
    background: #15303f;
}

.catalogue-subtree {
    margin: 0.3rem 0 0.3rem 0.8rem;
    border-left: 1px solid #23344f;
    padding-left: 0.45rem;
}

.catalogue-filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.catalogue-filter-bar-compact {
    margin-top: auto;
    margin-bottom: 0;
    max-width: 620px;
    width: 100%;
}

.catalogue-filter-bar input[type="text"] {
    flex: 1;
    min-width: 180px;
}

.extranet-catalogue-table td code {
    color: #89d6f1;
}

.catalogue-article-thumb {
    width: 54px;
    height: 54px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #2b405f;
    display: block;
}

.catalogue-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.catalogue-pagination {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.2rem 0 0.9rem;
}

.catalogue-article-card {
    border: 1px solid #2b405f;
    border-radius: 10px;
    overflow: hidden;
    background: #111c2d;
}

.catalogue-article-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #1c2a3f;
}

.catalogue-article-body {
    padding: 0.6rem;
    display: grid;
    gap: 0.28rem;
}

.catalogue-article-body h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #e7eef9;
}

.catalogue-article-body p {
    margin: 0;
    font-size: 0.78rem;
    color: #9db0cc;
}

.catalogue-article-metrics {
    margin-top: 0.2rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.28rem;
}

.catalogue-article-metrics span {
    font-size: 0.74rem;
    color: #c7d4e8;
}

.catalogue-order-form {
    margin-top: 0.45rem;
    display: flex;
    align-items: end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.catalogue-order-form label {
    display: grid;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: #9fb0cb;
}

.catalogue-order-form input[type="number"],
.catalogue-order-form input.catalogue-qty-input {
    width: 96px;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    border: 1px solid #2f3648;
    background: #111620;
    color: #e3e7ef;
}

.catalogue-qty-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.catalogue-qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #2f3648;
    border-radius: 6px;
    background: #111620;
    overflow: hidden;
}

.catalogue-qty-controls input[type="number"] {
    width: 4rem;
    min-width: 4rem;
    border: none;
    border-left: 1px solid #2f3648;
    border-right: 1px solid #2f3648;
    border-radius: 0;
    text-align: center;
}

.catalogue-qty-btn {
    width: 2rem;
    min-width: 2rem;
    padding: 0.35rem;
    border: none;
    background: #1e293b;
    color: #e3e7ef;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.catalogue-qty-btn:hover {
    background: #334155;
}

.catalogue-qty-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #0ea5a4;
}

.catalogue-qty-tooltip {
    flex-basis: 100%;
    font-size: 0.72rem;
    color: #7dd3fc;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    min-height: 1em;
}

.catalogue-qty-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.catalogue-back-to-top-fab {
    position: fixed;
    right: 18px;
    bottom: 64px;
    z-index: 49;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.catalogue-order-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 50;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.catalogue-order-grid h4 {
    margin: 0.6rem 0 0.45rem;
}

/* Modal commande catalogue : redimensionnable + plein écran */
.catalogue-order-modal {
    min-width: min(720px, 92vw);
    width: min(980px, 95vw);
    max-width: 95vw;
    min-height: 320px;
    max-height: 88vh;
    resize: both;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
.catalogue-order-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.catalogue-order-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.catalogue-order-modal-content {
    flex: 1;
    overflow: auto;
    min-height: 0;
}
.catalogue-order-modal.catalogue-order-modal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0;
    resize: none;
    border-radius: 0;
}
.catalogue-line-qty-input {
    width: 4.5rem;
    padding: 0.25rem 0.35rem;
    border: 1px solid #2f3648;
    border-radius: 4px;
    background: #111620;
    color: #e3e7ef;
    font-size: 0.9rem;
}
.catalogue-line-qty-cell,
.catalogue-line-marge-cell {
    white-space: nowrap;
}
.catalogue-order-lines-table td,
.catalogue-order-lines-table th {
    vertical-align: middle;
}

.catalogue-order-tabs-shell .modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #2f3648;
    padding-bottom: 0.5rem;
}
.catalogue-order-tabs-shell .modal-tab.catalogue-order-tab {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid #2f3648;
    background: #1e293b;
    color: #c7d4e8;
    cursor: pointer;
}
.catalogue-order-tabs-shell .modal-tab.catalogue-order-tab:hover {
    background: #334155;
    color: #e3e7ef;
}
.catalogue-order-tabs-shell .modal-tab.catalogue-order-tab.active {
    background: #0ea5a4;
    border-color: #0ea5a4;
    color: #fff;
}
.catalogue-tab-franco-warning {
    display: inline-block;
    color: #facc15;
    font-size: 0.9rem;
    margin-right: 0.35rem;
    line-height: 1;
    vertical-align: middle;
}
.catalogue-order-tab.active .catalogue-tab-franco-warning {
    color: #fde047;
}
.catalogue-order-tab-pane {
    display: none;
}
.catalogue-order-tab-pane.active {
    display: block;
}
.catalogue-order-supplier-franco {
    margin-bottom: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    background: #0f2f3b;
    border: 1px solid #1c6f6f;
    font-size: 0.85rem;
    color: #d6fbff;
}
.catalogue-order-supplier-franco .cell-ok,
.catalogue-order-supplier-franco .cell-ko {
    margin-left: 0.5rem;
}

.cell-ok {
    color: #86efac;
    font-weight: 700;
}

.cell-ko {
    color: #fca5a5;
    font-weight: 700;
}

@media (max-width: 980px) {
    .workspace {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        flex-basis: auto;
        border-right: 0;
        border-bottom: 1px solid var(--input-border);
        max-height: 45vh;
    }

    .main-panel {
        height: auto;
        min-height: 55vh;
    }

    .panel-header {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .composer {
        flex-wrap: wrap;
    }

    .composer .btn {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-extranet .extranet-grid {
        grid-template-columns: 1fr;
    }

    .page-extranet-catalogue .extranet-catalogue-shell {
        min-height: auto;
    }

    .catalogue-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .catalogue-articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* ----- Formulaire création article Cegid (extranet) ----- */
.page-extranet-article-creer .article-cegid-form-card {
    max-width: 900px;
}
.article-cegid-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #2a3040;
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}
.article-cegid-tab {
    background: #202635;
    color: #cbd3e0;
    border: 1px solid #354057;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
}
.article-cegid-tab.active {
    background: linear-gradient(135deg, #c9a84c, #b8973b);
    border-color: #c9a84c;
    color: #0f1219;
    font-weight: 700;
}
.article-cegid-tab-pane {
    display: none;
}
.article-cegid-tab-pane.active {
    display: block;
}
.article-cegid-section-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #e8edf9;
}
.article-cegid-form .form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.article-cegid-form .form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.article-cegid-form .form-group {
    margin-bottom: 0.75rem;
}
.article-cegid-form .form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: #b8c4dd;
}
.article-cegid-form .form-hint {
    display: block;
    font-size: 0.75rem;
    color: #8a9bb5;
    margin-top: 0.2rem;
}
.article-cegid-form .checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.article-cegid-form .checkbox-group label {
    margin-bottom: 0;
    order: 2;
}
.article-cegid-form .form-section-label {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.82rem;
    color: #9fb0cb;
    font-weight: 600;
}
.article-code-article-readonly,
.article-cegid-form input[readonly] {
    background: #2d3748;
    color: #9ca3af;
    cursor: not-allowed;
}
/* ── Icône ⓘ dans le label ── */
.libelle-group-wrap label { display: flex; align-items: center; gap: 0.4rem; }
.libelle-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #475569;
    color: #e2e8f0;
    font-size: 0.72rem;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    line-height: 1;
    padding: 0;
}
.libelle-info-icon:hover,
.libelle-info-icon.active { background: #c9a84c; color: #0f1219; }

/* ── Conteneur champ + tooltip ── */
.libelle-field-row { position: relative; }

/* ── Tooltip flottant ── */
.libelle-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 0;
    width: 300px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.55);
    z-index: 900;
    font-size: 0.8rem;
    color: #e2e8f0;
    line-height: 1.5;
}
/* Petite flèche à gauche */
.libelle-tooltip::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 14px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 7px solid #334155;
}
.libelle-tooltip::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 6px solid #0f172a;
}
/* Sur écran étroit : tooltip en dessous */
@media (max-width: 860px) {
    .libelle-tooltip {
        left: 0;
        top: calc(100% + 8px);
        width: 100%;
    }
    .libelle-tooltip::before, .libelle-tooltip::after { display: none; }
}

/* Contenu du tooltip */
.lt-context {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #1e293b;
}
.lt-context-vin { color: #f87171; }
.lt-section { margin-bottom: 0.65rem; }
.lt-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #60a5fa;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.lt-steps {
    margin: 0;
    padding-left: 1.1rem;
    color: #cbd5e1;
    font-size: 0.78rem;
}
.lt-steps li { margin-bottom: 0.15rem; }
.lt-steps em { color: #94a3b8; font-style: normal; }
.lt-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; }
.lt-chips span {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.72rem;
    color: #cbd5e1;
}
.lt-example { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid #1e293b; }
.lt-example code {
    display: block;
    margin-top: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: #1e293b;
    border-radius: 4px;
    font-size: 0.72rem;
    color: #34d399;
    font-family: monospace;
    word-break: break-all;
}
.message-vin-prix {
    padding: 0.5rem 0.75rem;
    background: rgba(245, 158, 11, 0.15);
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
}
.page-extranet-calcul-reductions .calcul-reductions-card { margin-bottom: 1rem; }
.page-extranet-calcul-reductions .calcul-result { margin-top: 0.5rem; padding: 0.35rem 0; }
.page-extranet-calcul-reductions .calcul-multi-table input { width: 100%; max-width: 120px; }
.article-cegid-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #2a3040;
}
.search-select-wrapper {
    position: relative;
}
.search-select-wrapper::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #94a3b8;
    pointer-events: none;
}
.search-select-input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    padding-right: 2rem;
    font-size: 0.9rem;
    background: #111620;
    border: 1px solid #2f3648;
    border-radius: 6px;
    color: #e3e7ef;
}
.search-select-input::placeholder {
    color: #64748b;
}
.search-select-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    max-height: 200px;
    overflow-y: auto;
    background: #1b2232;
    border: 1px solid #32415a;
    border-radius: 6px;
    z-index: 100;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.search-select-dropdown.open {
    display: block;
}
.search-select-item {
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: #d7dce5;
}
.search-select-item:hover {
    background: #2a3346;
}

/* ----- Mobile : menu plein écran + modales ----- */
@media (max-width: 768px) {
    .page-home .workspace,
    .workspace {
        position: relative;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .page-home .sidebar,
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: none;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
    body.sidebar-menu-open {
        overflow: hidden;
    }
    .sidebar-top {
        flex-shrink: 0;
        padding: 1rem 1.15rem;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.65rem;
    }
    .sidebar-top .workspace-name {
        flex: 1;
        min-width: 0;
        order: 1;
    }
    .sidebar-top .sidebar-close {
        order: 2;
        margin-left: auto;
    }
    .sidebar-top .global-search,
    .sidebar-top .menu-empty {
        order: 3;
        width: 100%;
    }
    .sidebar-top .global-search {
        font-size: 1rem;
        padding: 0.65rem 0.75rem;
    }
    .sidebar-nav {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.85rem 1.15rem 1.25rem;
    }
    .sidebar-footer {
        flex-shrink: 0;
        padding: 1rem 1.15rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    .menu-title {
        font-size: 0.82rem;
        margin-bottom: 0.55rem;
    }
    .menu-link {
        font-size: 1.05rem;
        padding: 0.8rem 0.75rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    .submenu-link {
        font-size: 1rem;
        padding: 0.72rem 0.65rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .service-toggle,
    .accordion-toggle {
        min-width: 44px;
        min-height: 44px;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 1000;
    }
    .sidebar-overlay.sidebar-overlay-open {
        display: block;
    }
    .sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        padding: 0;
        border: 1px solid #2a2f3a;
        background: #1e2532;
        color: #d7dce5;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.35rem;
        line-height: 1;
    }
    .sidebar-close:hover {
        background: #252c39;
    }
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 1px solid #2a2f3a;
        background: #1e2532;
        color: #d7dce5;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.35rem;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
    .sidebar-toggle:hover {
        background: #252c39;
    }
    .sidebar-toggle-fab {
        position: fixed;
        top: max(0.65rem, env(safe-area-inset-top));
        left: max(0.65rem, env(safe-area-inset-left));
        z-index: 999;
        margin: 0;
        box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    }
    .page-home .main-panel,
    .main-panel {
        width: 100%;
        min-width: 0;
        padding: 0.75rem;
        padding-top: max(0.75rem, env(safe-area-inset-top));
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .panel-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }
    .panel-header .btn {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }
    /* Modales : scroll sur petit ecran */
    .modal-overlay {
        align-items: flex-start;
        padding: 0.5rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .profile-modal {
        max-height: min(90vh, 600px);
        margin: auto 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .profile-modal .modal-content {
        overflow-y: auto;
        flex: 1;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    /* Résumé de réunion : boutons tactiles */
    .meeting-record-row .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.6rem 0.9rem;
    }
    .meeting-summary-generate {
        min-height: 48px;
        padding: 0.75rem 1rem;
        width: 100%;
    }
    .meeting-summary-text {
        min-height: 120px;
    }
}
.sidebar-toggle,
.sidebar-close {
    display: none;
}
@media (min-width: 769px) {
    .sidebar-toggle,
    .sidebar-close { display: none !important; }
}
@media (max-width: 768px) {
    .sidebar-toggle { display: inline-flex !important; }
    .sidebar-close { display: inline-flex !important; }
}

/* ══════════════════════════════════════════════════════════
   MAISON DV — Finitions typographiques & dorées globales
   ══════════════════════════════════════════════════════════ */

/* Titres principaux dans le contenu */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    letter-spacing: .015em;
}

/* Titres de panneaux et sections */
.panel-title,
.facturation-header h2,
.discussion-card h1,
.discussion-card h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: #e8d89a;
    letter-spacing: .02em;
}

/* Focus inputs global — accent doré */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(201,168,76,.55) !important;
    box-shadow: 0 0 0 3px rgba(201,168,76,.14) !important;
}

/* Sélecteurs et inputs globaux */
select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text);
    border-radius: 6px;
    padding: .4rem .65rem;
}

/* Liens globaux */
a {
    color: #c9b97a;
}
a:hover {
    color: #e8d89a;
}

/* Scrollbar globale thème doré */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,.45); }

/* Ligne de séparation décorative */
hr {
    border: none;
    border-top: var(--gold-line);
    margin: 1rem 0;
}

/* Toast / messages système */
.message-success { background: rgba(20,83,45,.7); color: #86efac; border-left: 3px solid #22c55e; }
.message-error   { background: rgba(127,29,29,.7); color: #fecaca; border-left: 3px solid #ef4444; }
.message-info    { background: rgba(30,58,138,.7); color: #bfdbfe; border-left: 3px solid #3b82f6; }

/* Bouton secondaire / danger */
.btn-danger {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    color: #fff;
    border: none;
    transition: background .2s, transform .15s;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

/* Fond des inputs en cohérence avec le thème */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text);
    border-radius: 6px;
}
