/* ============================================================
   main.css — Base styles (layout, components, utilities)
   Theme colours are in themes/*.css
   ============================================================ */

/* ── CSS Variables (overridden per theme) ───────────────── */
:root {
    --font-sans: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: "Fira Code", "Cascadia Code", Consolas, monospace;
    --radius:    6px;
    --shadow:    0 1px 4px rgba(0,0,0,.15);
    --transition: .18s ease;
    --container: 100%;

    /* Defaults (overridden by theme files) */
    --color-bg:        #f5f5f5;
    --color-surface:   #ffffff;
    --color-border:    #d0d0d0;
    --color-text:      #1a1a1a;
    --color-text-muted:#666;
    --color-primary:   #2563eb;
    --color-primary-h: #1d4ed8;
    --color-secondary: #64748b;
    --color-danger:    #dc2626;
    --color-success:   #16a34a;
    --color-warning:   #ca8a04;
    --color-nav-bg:    #1e293b;
    --color-nav-text:  #e2e8f0;
    --color-nav-hover: #2563eb;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background:  var(--color-bg);
    color:       var(--color-text);
    line-height: 1.6;
    min-height:  100vh;
    display:     flex;
    flex-direction: column;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
.container {
    width:   100%;
    padding: 0 1.5rem;
}

.site-main {
    flex: 1;
    padding: 2rem 0;
}

/* ── Header / Nav ───────────────────────────────────────── */
.site-header {
    background:  var(--color-nav-bg);
    color:       var(--color-nav-text);
    box-shadow:  var(--shadow);
    position:    sticky;
    top:         0;
    z-index:     100;
}

.site-header .container {
    display:     flex;
    align-items: center;
    gap:         1rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
    flex-wrap:   wrap;
}

.site-title {
    font-size:   1.2rem;
    font-weight: 700;
    color:       var(--color-nav-text);
    white-space: nowrap;
}
.site-title:hover { text-decoration: none; opacity: .85; }

.site-logo {
    display:    block;
    height:     40px;
    width:      auto;
    max-width:  200px;
    object-fit: contain;
}

/* ── Upload previews ────────────────────────────────────── */
.upload-preview {
    margin-bottom: .75rem;
}
.preview-logo {
    max-height: 80px;
    max-width:  300px;
    object-fit: contain;
    border:     1px solid var(--color-border);
    border-radius: var(--radius);
    padding:    .4rem;
    background: var(--color-surface);
    display:    block;
}
.preview-favicon {
    height:     32px;
    width:      32px;
    object-fit: contain;
    border:     1px solid var(--color-border);
    border-radius: var(--radius);
    padding:    .2rem;
    background: var(--color-surface);
    display:    block;
}

.main-nav {
    display:     flex;
    align-items: center;
    flex:        1;
    min-width:   0;
}

.nav-left {
    display:     flex;
    align-items: center;
    gap:         .25rem;
    flex:        1;
}

.nav-right {
    display:     flex;
    align-items: center;
    gap:         .25rem;
    margin-left: auto;
}

.nav-right .nav-link {
    display:     flex;
    align-items: center;
    font-size:   1.05rem;
}

.nav-link {
    color:         var(--color-nav-text);
    padding:       .4rem .75rem;
    border-radius: var(--radius);
    font-size:     .9rem;
    transition:    background var(--transition);
}
.nav-link:hover,
.nav-link.active {
    background:    var(--color-nav-hover);
    text-decoration: none;
    color: #fff;
}

.nav-tools {
    display: flex;
    gap: .5rem;
    margin-left: auto;
}

/* ── Dropdowns ──────────────────────────────────────────── */
.dropdown { position: relative; }

.btn-tool {
    background: transparent;
    border:     1px solid rgba(255,255,255,.3);
    color:      var(--color-nav-text);
    padding:    .35rem .65rem;
    border-radius: var(--radius);
    cursor:     pointer;
    font-size:  .85rem;
    white-space: nowrap;
}
.btn-tool:hover { background: rgba(255,255,255,.1); }

.dropdown-menu {
    display:       none;
    position:      absolute;
    right:         0;
    top:           calc(100% + 4px);
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    list-style:    none;
    min-width:     160px;
    z-index:       200;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu { display: block; }

.dropdown-menu a {
    display: block;
    padding: .45rem .9rem;
    color:   var(--color-text);
    font-size: .9rem;
}
.dropdown-menu a:hover { background: var(--color-bg); text-decoration: none; }
.dropdown-menu a.active { font-weight: 700; color: var(--color-primary); }

/* ── Oracle DB nav (in header) ──────────────────────────── */
.oracle-nav-label, .pg-nav-label {
    cursor:      default;
    display:     flex;
    align-items: center;
    gap:         .3rem;
    padding:     .4rem .75rem;
    color:       var(--color-nav-text);
    font-size:   .9rem;
    white-space: nowrap;
}
.oracle-nav-label strong, .pg-nav-label strong { white-space: nowrap; }

.oracle-nav-sep, .pg-nav-sep {
    width:      1px;
    height:     1.4em;
    background: rgba(255,255,255,.2);
    flex-shrink: 0;
    margin:     0 .15rem;
}

.oracle-dropdown, .pg-dropdown { position: relative; display: inline-flex; }

.oracle-dropdown-btn, .pg-dropdown-btn {
    background:  none;
    border:      none;
    font-family: inherit;
    font-size:   .9rem;
    cursor:      pointer;
    color:       var(--color-nav-text);
    padding:     .4rem .75rem;
    border-radius: var(--radius);
    transition:  background var(--transition);
    display:     inline-flex;
    align-items: center;
    gap:         .35rem;
    white-space: nowrap;
}
.oracle-dropdown-btn:hover,
.pg-dropdown-btn:hover,
.oracle-dropdown-btn.active,
.pg-dropdown-btn.active,
.oracle-dropdown.open .oracle-dropdown-btn, .pg-dropdown.open .pg-dropdown-btn { background: var(--color-nav-hover); }
.oracle-dropdown-btn .arrow, .pg-dropdown-btn .arrow {
    font-size:  .7em;
    transition: transform .15s;
}
.oracle-dropdown.open .oracle-dropdown-btn .arrow, .pg-dropdown.open .pg-dropdown-btn .arrow { transform: rotate(180deg); }

.oracle-dropdown-menu, .pg-dropdown-menu {
    display:       none;
    position:      absolute;
    top:           calc(100% + 4px);
    left:          0;
    min-width:     220px;
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow:    0 6px 18px rgba(0,0,0,.18);
    z-index:       200;
    padding:       .35rem 0;
}
.oracle-dropdown.open .oracle-dropdown-menu, .pg-dropdown.open .pg-dropdown-menu { display: block; }

.oracle-dropdown-menu a, .pg-dropdown-menu a {
    display:     flex;
    align-items: center;
    gap:         .5rem;
    padding:     .5rem 1rem;
    color:       var(--color-text);
    font-size:   .9rem;
    white-space: nowrap;
}
.oracle-dropdown-menu a:hover, .pg-dropdown-menu a:hover { background: var(--color-bg); text-decoration: none; }
.oracle-dropdown-menu a.active, .pg-dropdown-menu a.active { font-weight: 600; color: var(--color-primary); }

.oracle-dropdown-sep, .pg-dropdown-sep {
    height:     1px;
    background: var(--color-border);
    margin:     .35rem 0;
}
.oracle-dropdown-switch, .pg-dropdown-switch { color: var(--color-text-muted) !important; font-style: italic; }
.oracle-dropdown-switch:hover, .pg-dropdown-switch:hover { color: var(--color-danger) !important; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
    background:  var(--color-nav-bg);
    color:       rgba(255,255,255,.6);
    text-align:  center;
    padding:     1rem;
    font-size:   .85rem;
}
.site-footer p { margin: .15rem 0; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    padding:       .85rem 1rem;
    border-radius: var(--radius);
    border-left:   4px solid transparent;
    margin-bottom: 1rem;
    position:      relative;
    display:       flex;
    align-items:   flex-start;
    gap:           .5rem;
}
.alert-close {
    position:   absolute;
    right:      .5rem;
    top:        .5rem;
    background: none;
    border:     none;
    cursor:     pointer;
    font-size:  1.1rem;
    line-height: 1;
    opacity:    .6;
}
.alert-close:hover { opacity: 1; }

.alert-success { background: #dcfce7; border-color: var(--color-success); color: #14532d; }
.alert-error   { background: #fee2e2; border-color: var(--color-danger);  color: #7f1d1d; }
.alert-warning { background: #fef9c3; border-color: var(--color-warning); color: #713f12; }
.alert-info    { background: #dbeafe; border-color: var(--color-primary); color: #1e3a8a; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    padding:       1.5rem;
    box-shadow:    var(--shadow);
}
.card h2 { margin-bottom: .75rem; font-size: 1.1rem; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ── Stats ──────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.stat-card {
    background:    var(--color-primary);
    color:         #fff;
    border-radius: var(--radius);
    padding:       1.5rem;
    text-align:    center;
}
.stat-value { display: block; font-size: 2.5rem; font-weight: 700; }
.stat-label { font-size: .9rem; opacity: .85; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display:       inline-flex;
    align-items:   center;
    gap:           .4rem;
    padding:       .5rem 1.1rem;
    border:        none;
    border-radius: var(--radius);
    cursor:        pointer;
    font-size:     .9rem;
    font-family:   inherit;
    font-weight:   500;
    text-decoration: none;
    transition:    background var(--transition), opacity var(--transition);
}
.btn:hover { opacity: .88; text-decoration: none; }

.btn-primary   { background: var(--color-primary);   color: #fff; }
.btn-secondary { background: var(--color-secondary); color: #fff; }
.btn-danger    { background: var(--color-danger);    color: #fff; }
.btn-oauth     { background: #24292e; color: #fff; }

.btn-sm  { padding: .3rem .7rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.1rem;
}
.form-group label {
    display:     block;
    font-weight: 600;
    font-size:   .9rem;
    margin-bottom: .35rem;
    color:       var(--color-text);
}
.form-group small {
    display:   block;
    color:     var(--color-text-muted);
    font-size: .8rem;
    margin-top: .2rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width:         100%;
    padding:       .5rem .75rem;
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    background:    var(--color-surface);
    color:         var(--color-text);
    font-family:   inherit;
    font-size:     .95rem;
    transition:    border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline:      none;
    border-color: var(--color-primary);
    box-shadow:   0 0 0 3px rgba(37,99,235,.15);
}
.form-group input[disabled] {
    background: var(--color-bg);
    cursor:     not-allowed;
}

.form-check {
    display:     flex;
    align-items: center;
    gap:         .5rem;
}
.form-check input[type="checkbox"] { width: auto; }
.form-check label { margin: 0; font-weight: 400; }

.form-actions {
    display:  flex;
    gap:      .75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.edit-form { max-width: 600px; }

/* ── Auth ───────────────────────────────────────────────── */
.auth-wrapper {
    display:         flex;
    justify-content: center;
    padding:         2rem 1rem;
}
.auth-box {
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    padding:       2.5rem 2rem;
    width:         100%;
    max-width:     420px;
    box-shadow:    var(--shadow);
}
.auth-box h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }
.auth-form   { margin-bottom: 1rem; }
.auth-separator {
    text-align:   center;
    margin:       1rem 0;
    color:        var(--color-text-muted);
    font-size:    .85rem;
    position:     relative;
}
.auth-separator::before,
.auth-separator::after {
    content:  '';
    position: absolute;
    top:      50%;
    width:    38%;
    height:   1px;
    background: var(--color-border);
}
.auth-separator::before { left:  0; }
.auth-separator::after  { right: 0; }

/* ── Tables ─────────────────────────────────────────────── */
.data-table {
    width:          100%;
    border-collapse: collapse;
    font-size:      .9rem;
}
.data-table th,
.data-table td {
    padding:       .6rem .8rem;
    text-align:    left;
    border-bottom: 1px solid var(--color-border);
}
.data-table th {
    background:  var(--color-bg);
    font-weight: 600;
    white-space: nowrap;
}
.data-table tr:hover td { background: rgba(37,99,235,.04); }
.data-table .row-inactive { opacity: .6; }
.data-table .actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display:       inline-block;
    padding:       .15rem .5rem;
    border-radius: 99px;
    font-size:     .75rem;
    font-weight:   600;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }

/* ── Fieldset ───────────────────────────────────────────── */
.auth-fieldset {
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    padding:       1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.auth-fieldset legend {
    padding:     0 .4rem;
    font-weight: 600;
    display:     flex;
    align-items: center;
    gap:         .4rem;
}

/* ── Page header ────────────────────────────────────────── */
.page-header {
    display:     flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap:   wrap;
    gap:         .5rem;
}

/* ── Error page ─────────────────────────────────────────── */
.error-page {
    text-align: center;
    padding:    4rem 1rem;
}
.error-page h1 { font-size: 5rem; color: var(--color-text-muted); }
.error-page p  { font-size: 1.2rem; margin: 1rem 0; }

/* ── Form row (side-by-side fields) ─────────────────────────── */
.form-row {
    display:   flex;
    gap:       1rem;
    flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 180px; }

/* ── Badges (extra) ──────────────────────────────────────────── */
.badge-warning { background: #fef9c3; color: #a16207; }

/* ── Admin layout (sidebar + content) ───────────────────────── */
.admin-layout {
    display:     flex;
    gap:         1.5rem;
    align-items: flex-start;
}

.admin-sidebar {
    width:       220px;
    flex-shrink: 0;
    position:    sticky;
    top:         4.5rem;
}

.admin-content { flex: 1; min-width: 0; }

/* Admin nav panel */
.admin-nav {
    background:    var(--color-surface);
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    overflow:      hidden;
}
.admin-nav-section {
    padding:       .35rem 0;
    border-bottom: 1px solid var(--color-border);
}
.admin-nav-section:last-child { border-bottom: none; }

.admin-nav-heading {
    padding:        .5rem 1rem .25rem;
    font-size:      .7rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color:          var(--color-text-muted);
}

.admin-nav-item {
    display:         flex;
    align-items:     center;
    gap:             .45rem;
    padding:         .42rem 1rem .42rem 1.1rem;
    color:           var(--color-text);
    font-size:       .88rem;
    text-decoration: none;
    border-left:     3px solid transparent;
    transition:      background var(--transition), color var(--transition),
                     border-color var(--transition);
}
.admin-nav-item:hover {
    background:      var(--color-bg);
    color:           var(--color-primary);
    text-decoration: none;
}
.admin-nav-item.active {
    border-left-color: var(--color-primary);
    color:             var(--color-primary);
    font-weight:       600;
    background:        rgba(37,99,235,.06);
}
.admin-nav-icon { font-size: .95rem; line-height: 1; }

/* ── Oracle subgroup grid ────────────────────────────────────── */
.oracle-subgroup-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap:                   .75rem;
}
.oracle-subgroup-card {
    display:         flex;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             .3rem;
    padding:         1rem .5rem;
    border-radius:   var(--radius);
    border:          2px solid var(--color-border);
    text-decoration: none;
    transition:      border-color var(--transition), background var(--transition);
    min-height:      80px;
}
.oracle-subgroup-card.has-dbs {
    border-color: var(--color-primary);
    background:   rgba(37,99,235,.04);
    color:        var(--color-primary);
}
.oracle-subgroup-card.empty  { color: var(--color-text-muted); }
.oracle-subgroup-card.locked { opacity: .45; cursor: default; background: var(--color-bg); }
.oracle-subgroup-card:not(.locked):hover {
    border-color:    var(--color-primary);
    background:      rgba(37,99,235,.08);
    text-decoration: none;
}
.sg-label { font-weight: 600; font-size: .85rem; }
.sg-count { font-size: 1.4rem; font-weight: 700; }

/* ── Import table row error ──────────────────────────────────── */
.row-error td { background: #fee2e2 !important; }

/* ── Module grid / cards ─────────────────────────────────────── */
.module-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap:                   1.5rem;
}
.module-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.module-icon   { font-size: 1.8rem; line-height: 1; }
.module-icon-img { display: inline-block; height: 2.4rem; width: auto; vertical-align: middle; }
/* Logo couleur du module, sur la meme ligne que le titre de sa page d'accueil */
.module-home-logo { display: inline-block; height: 1.4em; width: auto; vertical-align: -.3em; margin-right: .5rem; }
.module-badge  { margin-left: auto; }
.module-desc   { color: var(--color-text-muted); font-size: .9rem; margin-bottom: .75rem; }
.module-meta   { font-size: .85rem; }
.module-meta dt { font-weight: 600; margin-top: .5rem; }
.module-meta dd { margin: .2rem 0 0; }

/* ── Developer module pre blocks ─────────────────────────────── */
.dev-dump {
    background:    var(--color-bg);
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    padding:       1rem;
    font-family:   var(--font-mono);
    font-size:     .8rem;
    overflow-x:    auto;
    white-space:   pre-wrap;
    word-break:    break-all;
}
.dev-logs  { max-height: 22rem; overflow-y: auto; }
.log-error { color: var(--color-danger); }
.log-warn  { color: var(--color-warning); }
.log-debug { color: var(--color-text-muted); }

/* ── Oracle config / parameters report ──────────────────── */
.cfg-filter-card { padding: .75rem 1rem; }
.cfg-filter-bar {
    display:     flex;
    align-items: center;
    flex-wrap:   wrap;
    gap:         .5rem .75rem;
}
.cfg-filter-check {
    display:     inline-flex;
    align-items: center;
    gap:         .3rem;
    font-size:   .88rem;
    cursor:      pointer;
    white-space: nowrap;
}
.cfg-filter-check input[type=checkbox] { cursor: pointer; }
.cfg-filter-sep  { width: 1px; height: 1.4em; background: var(--color-border); flex-shrink: 0; margin: 0 .1rem; }
.cfg-filter-label { font-size: .82rem; color: var(--color-text-muted); white-space: nowrap; }
.cfg-filter-select, .cfg-filter-input {
    font-size:    .85rem;
    padding:      .25rem .5rem;
    border:       1px solid var(--color-border);
    border-radius: var(--radius);
    background:   var(--color-surface);
    color:        var(--color-text);
    height:       2rem;
}
.cfg-filter-input { min-width: 180px; }
.cfg-filter-count { font-size: .8rem; color: var(--color-text-muted); white-space: nowrap; }

.cfg-table { table-layout: auto; }
.cfg-table th { white-space: nowrap; }
.cfg-table th.sortable { user-select: none; }
.cfg-table th.sortable:hover { background: var(--color-bg); }
.cfg-table .sort-arrow { font-size: .7em; opacity: .6; }
.cfg-table .cfg-col-value { min-width: 180px; }

.cfg-param-name { cursor: help; }

.cfg-val-modified {
    color:           var(--color-warning);
    font-weight:     600;
}

.cfg-value-cell.editable {
    cursor: pointer;
}
.cfg-value-cell.editable:hover { background: rgba(37,99,235,.05); }
.cfg-value-cell.editable span  { border-bottom: 1px dashed var(--color-primary); }

.cfg-type-badge {
    display:       inline-block;
    font-size:     .72em;
    padding:       .1em .4em;
    border-radius: 3px;
    background:    var(--color-bg);
    border:        1px solid var(--color-border);
    white-space:   nowrap;
}

.btn-cfg-reset {
    padding:   .15rem .4rem;
    font-size: .85rem;
    line-height: 1;
}

/* Edit overlay / popup */
#cfg-edit-overlay {
    display:         none;
    position:        fixed;
    inset:           0;
    background:      rgba(0,0,0,.45);
    z-index:         1000;
    align-items:     center;
    justify-content: center;
}
#cfg-edit-popup {
    width:      420px;
    max-width:  95vw;
    padding:    1.25rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.cfg-edit-header {
    display:       flex;
    flex-direction: column;
    gap:           .2rem;
    margin-bottom: .75rem;
}
.cfg-edit-header strong { font-size: 1.05rem; }
.cfg-edit-header span   { font-size: .82rem; color: var(--color-text-muted); }
.cfg-edit-body  { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.cfg-edit-footer { display: flex; gap: .5rem; justify-content: flex-end; }

/* ── Oracle tablespace / redo log report ─────────────────── */
.section-title {
    font-size:    1.1rem;
    font-weight:  600;
    margin:       1.5rem 0 .6rem;
    color:        var(--color-text);
    padding-left: .15rem;
}
/* Tablespace sort bar */
.ts-sort-bar {
    display:     flex;
    align-items: center;
    gap:         .45rem;
    margin-bottom: .75rem;
    flex-wrap:   wrap;
}
.ts-sort-label {
    font-size:  .8rem;
    color:      var(--color-text-muted);
    white-space: nowrap;
}
.btn-sort {
    font-size:   .78rem;
    padding:     .22rem .55rem;
    border:      1px solid var(--color-border);
    border-radius: var(--radius);
    background:  transparent;
    color:       var(--color-text);
    cursor:      pointer;
    transition:  background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-sort:hover { background: var(--color-border); }
.btn-sort.active {
    background:   var(--color-primary);
    color:        #fff;
    border-color: var(--color-primary);
}

.ora-chart-container {
    min-height: 80px;
    overflow-x: auto;
}
.ora-chart-container svg { display: block; }
.ora-chart-note {
    font-size:  .85rem;
    color:      var(--color-text-muted);
    margin:     0 0 .5rem;
    font-style: italic;
}
.text-right { text-align: right !important; }

/* Redo log member file list */
.redo-member {
    display:     flex;
    align-items: center;
    gap:         .35rem;
    font-size:   .8rem;
    line-height: 1.4;
    font-family: var(--font-mono, monospace);
    color:       var(--color-text-muted);
}
.redo-member-path { word-break: break-all; }

/* NLS diff highlighting */
.nls-diff      { color: var(--color-warning); font-weight: 600; }
.nls-diff-sess { color: var(--color-danger);  font-weight: 600; }

/* Toast */
.cfg-toast {
    position:   fixed;
    bottom:     1.25rem;
    right:      1.25rem;
    z-index:    2000;
    max-width:  380px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

/* ── Memory report KPI cards ────────────────────────────── */
.mem-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: .9rem;
    margin-bottom: 1.25rem;
}
.mem-kpi-card {
    background:    var(--color-bg);
    border:        1px solid var(--color-border);
    border-radius: var(--radius);
    padding:       .85rem 1rem;
    text-align:    center;
}
.mem-kpi-label {
    font-size:      .75rem;
    color:          var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom:  .3rem;
}
.mem-kpi-value {
    font-size:   1.4rem;
    font-weight: 700;
    color:       var(--color-text);
    line-height: 1.2;
}
.mem-kpi-sub {
    font-size:   .73rem;
    color:       var(--color-text-muted);
    margin-top:  .25rem;
}
.mem-kpi-value.text-success { color: var(--color-success); }
.mem-kpi-value.text-warning { color: var(--color-warning); }
.mem-kpi-value.text-danger  { color: var(--color-danger);  }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-layout  { flex-direction: column; }
    .admin-sidebar { width: 100%; position: static; }
}

@media (max-width: 640px) {
    .main-nav { gap: 0; }
    .nav-link { padding: .35rem .5rem; font-size: .82rem; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .data-table { font-size: .8rem; }
    .oracle-subgroup-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Documentation in-app (/doc) ──────────────────────────────────────── */
.doc-content { line-height: 1.7; color: var(--color-text); }
.doc-content h1 { font-size: 1.5rem; margin: 0 0 1rem; }
.doc-content h2 { font-size: 1.25rem; margin: 1.8rem 0 .8rem; padding-bottom: .3rem; border-bottom: 1px solid var(--color-border); }
.doc-content h3 { font-size: 1.08rem; margin: 1.4rem 0 .6rem; }
.doc-content h4 { font-size: .98rem; margin: 1.1rem 0 .5rem; }
.doc-content p { margin: 0 0 .9rem; }
.doc-content ul, .doc-content ol { margin: 0 0 .9rem; padding-left: 1.5rem; }
.doc-content li { margin: .25rem 0; }
.doc-content a { color: var(--color-primary); }
.doc-content code { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 4px; padding: .1rem .35rem; font-size: .88em; }
.doc-content pre { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px; padding: .9rem 1rem; overflow-x: auto; }
.doc-content pre code { background: none; border: 0; padding: 0; }
.doc-content blockquote { margin: 0 0 .9rem; padding: .4rem 1rem; border-left: 3px solid var(--color-primary); color: var(--color-text-muted); }
.doc-content table { border-collapse: collapse; width: 100%; margin: 0 0 1rem; font-size: .9rem; }
.doc-content th, .doc-content td { border: 1px solid var(--color-border); padding: .45rem .65rem; text-align: left; vertical-align: top; }
.doc-content th { background: var(--color-bg); font-weight: 600; }
.doc-content img { max-width: 100%; height: auto; }
.doc-content hr { border: 0; border-top: 1px solid var(--color-border); margin: 1.6rem 0; }
.doc-list a { font-weight: 500; }
.doc-content .mermaid { margin: 0 0 1rem; text-align: center; overflow-x: auto; }
.doc-content .mermaid svg { max-width: 100%; height: auto; }

/* ── Oracle : menu lateral des rapports (collapsable) ─────── */
.oracle-sidebar-toggle, .pg-sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-nav-text);
    font-size: 1.15rem;
    line-height: 1;
    padding: .3rem .55rem;
    border-radius: var(--radius);
    flex-shrink: 0;
}
.oracle-sidebar-toggle:hover, .pg-sidebar-toggle:hover { background: var(--color-nav-hover); }

.oracle-sidebar, .pg-sidebar {
    position: fixed;
    top: var(--ora-header-h, 56px);
    left: 0;
    bottom: 0;
    width: 52px;
    background: var(--color-nav-bg);
    border-right: 1px solid var(--color-border);
    box-shadow: 2px 0 8px rgba(0,0,0,.10);
    z-index: 90;
    display: flex;
    flex-direction: column;
    padding: .4rem 0;
    transition: transform .2s ease;
}
.oracle-sidebar-nav, .pg-sidebar-nav { display: flex; flex-direction: column; }

/* Collapsed : on masque le rail (le contenu reprend toute la largeur) */
body.oracle-sidebar-collapsed .oracle-sidebar, body.pg-sidebar-collapsed .pg-sidebar { transform: translateX(-100%); }

/* Decalage du contenu quand le rail est present et visible */
body.has-oracle-sidebar .site-main, body.has-pg-sidebar .site-main {
    margin-left: 52px;
    transition: margin-left .2s ease;
}
body.has-oracle-sidebar.oracle-sidebar-collapsed .site-main, body.has-pg-sidebar.pg-sidebar-collapsed .site-main { margin-left: 0; }

/* Boutons verticaux : icone seule, sous-menu en flyout a droite */
.oracle-sidebar .oracle-dropdown, .pg-sidebar .pg-dropdown { display: block; width: 100%; }
.oracle-sidebar .oracle-dropdown-btn, .pg-sidebar .pg-dropdown-btn {
    width: 100%;
    justify-content: center;
    padding: .55rem 0;
    font-size: 1.2rem;
    border-radius: 0;
}
.oracle-sidebar .oracle-dropdown-menu, .pg-sidebar .pg-dropdown-menu {
    top: 0;
    left: calc(100% + 2px);
}
.oracle-sidebar-home, .pg-sidebar-home {
    margin-top: auto;
    padding: .5rem 0;
    text-align: center;
    color: var(--color-nav-text);
    opacity: .7;
    font-size: 1.1rem;
    text-decoration: none;
}
.oracle-sidebar-home:hover, .pg-sidebar-home:hover { background: var(--color-nav-hover); opacity: 1; }

/* Mobile : le rail passe en overlay (pas de decalage du contenu) */
@media (max-width: 720px) {
    body.has-oracle-sidebar .site-main, body.has-pg-sidebar .site-main { margin-left: 0; }
    .oracle-sidebar, .pg-sidebar { box-shadow: 4px 0 16px rgba(0,0,0,.28); }
}

/* Logo de module (64px) dans la liste des modules, a la place de l'emoji */
.nav-icon-img {
    display: inline-block;          /* annule le `img { display:block }` global (l.47) */
    height: 1.2em;
    width: auto;
    vertical-align: -.25em;
    border-radius: 3px;
}

/* Liste des modules : libelle a cote de l'icone (espacement), masque < 1024px */
.nav-left .nav-label { margin-left: .35rem; }
@media (max-width: 1023px) {
    .nav-left .nav-label { display: none; }
}
