/* ============================================================
   MainLayout.css — Structure générale : topbar + sidebar + main
   ============================================================ */

#layout {
    display: flex;
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    right: 0;
}

#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    transition: margin-right var(--transition);
}

#content.links-open {
    margin-right: 260px;
    /* Le panneau Liens réserve cette marge : le scrollbar natif de #content ne doit pas
       apparaître esseulé dans cet espace, il doit rester masqué derrière le panneau. */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#content.links-open::-webkit-scrollbar {
    display: none;
}

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 0;
    background: none;
    border-radius: 0;
}
.breadcrumb a       { color: var(--blue); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep    { opacity: .4; }

/* ── En-tête de page ───────────────────────────────────────── */
.page-header          { margin-bottom: 20px; }
.page-header h1       { font-size: 20px; font-weight: 700; color: var(--navy); }
.page-header p        { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ── Sections de settings ──────────────────────────────────── */
.settings-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}
.settings-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color var(--transition), border-color var(--transition);
}
.settings-tab:hover  { color: var(--blue); }
.settings-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.settings-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}
.settings-section .section-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.settings-section .form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.settings-section .form-control,
.settings-section .form-select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.settings-section .form-control:focus,
.settings-section .form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(46,134,193,.15);
    outline: none;
}
.settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.settings-btn:hover    { background: var(--blue-dark); }
.settings-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Boutons utilitaires ───────────────────────────────────── */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: background var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
}
.btn-icon:hover         { background: var(--bg); color: var(--blue); border-color: var(--blue); }
.btn-icon.danger:hover  { color: var(--danger); border-color: var(--danger); }
.btn-icon:disabled      { opacity: .4; cursor: not-allowed; }

/* ── Onglets ────────────────────────────────────────────────── */
.tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 16px;
    margin-bottom: -2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tab-btn:hover  { color: var(--blue); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ── Tableau de données ────────────────────────────────────── */
.data-table {
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.data-table thead th {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr:last-child td   { border-bottom: none; }
.data-table tbody tr:hover td        { background: var(--bg); }

/* ── Overlay mobile ────────────────────────────────────────── */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,27,45,.5);
    z-index: 45;
    backdrop-filter: blur(2px);
}

/* ── Blazor error UI ───────────────────────────────────────── */
#blazor-error-ui {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    bottom: 0;
    box-shadow: var(--shadow-md);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 13px;
    color: #991b1b;
}
#blazor-error-ui .dismiss { cursor: pointer; font-weight: bold; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    #content {
        padding: 14px;
        margin-right: 0 !important;
    }
}
