/* ==========================================================================
   APP.CSS — base alignée sur flux.php
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg-page: #f3f3f3;
    --bg-panel: #ffffff;
    --bg-soft: #fff8e8;
    --text-main: #222;
    --border: #d6d6d6;
    --border-strong: #c5c5c5;
    --btn: #555;
    --btn-primary: #0d6efd;
    --btn-danger: #aa4444;
    --nav-height: 48px;
    --thumb-size: 200px;
    --card-radius: 20px;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    line-height: 1.4;
}

img {
    max-width: 100%;
}

/* ==========================================================================
   HEADER + NAV MODULES
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #ccc;
}
/* navigation */
.top-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* boutons de nav */
.nav-tab {
    display: inline-flex;
    align-items: center;

    padding: 6px 12px;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #f8f8f8;
    text-decoration: none;
    color: #222;
}

.nav-tab:hover {
    background: #eee;
}

.nav-tab--active {
    background: #e8f1ff;
    border-color: #93b7ff;
    color: #0a4fbe;
    font-weight: 600;
}
/* ==========================================================================
   BARRE D'ACTIONS
   ========================================================================== */

.forms-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 25px;
    flex-wrap: wrap;
    margin-left: auto;
    padding: 0;
    border: none;
    background: transparent;
}


/* groupes de boutons dans la barre d'actions */
.forms-bar .group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* ==========================================================================
   BOUTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    background: var(--btn);
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.05s;
}

.btn:hover {
    opacity: 0.92;
}

.btn:active {
    transform: translateY(1px);
}

.btn.primary {
    background: var(--btn-primary);
}

.btn.danger {
    background: var(--btn-danger);
}

.btn.active {
    outline: 2px solid rgba(13, 110, 253, 0.25);
    outline-offset: 1px;
}


/* Nouton de deconnexion */

.btn-logout {
    display: inline-block;
    padding: 8px 14px;
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
}

.btn-logout:hover {
    background: #c0392b;
}



/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */

#main-layout {
    width: 100%;
    padding: 12px 16px 16px;
}

#workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

#top-form-bar {
    display: none;
    width: fit-content;
    max-width: 100%;
    padding: 1px 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

#main-layout.banner-open #top-form-bar {
    display: block;
}

#content-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

#view-wrapper {
    flex: 1 1 auto;
    min-width: 0;
}



/* ==========================================================================
   LIENS / AIDES
   ========================================================================== */

a.link-to-grid,
a.link-to-preview {
    color: var(--btn-primary);
    text-decoration: none;
}

a.link-to-grid:hover,
a.link-to-preview:hover {
    text-decoration: underline;
}


/* Pager */

.preview-pager {
    display: grid;
    grid-template-columns: 48px auto 48px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 12px auto 20px auto;
}

.pager-slot {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pager-arrow {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #555;
    color: #fff;
    text-decoration: none;
    font-size: 34px;
    line-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.pager-arrow:hover {
    background: #333;
}

.pager-count {
    min-width: 80px;
    text-align: center;
    font-weight: bold;
}