/* =============================================================================
   topbar.css — Esthetique "Prune & Rose poudre", feminine et tres pro.
   Tons plum + rose corail doux + ivoire chaud, typographie systeme.
   Registre cabinet RH / coaching / formation B2B haut de gamme.
   ============================================================================= */

:root {
    --bg-page: #faf6f5;          /* ivoire chaud */
    --bg-card: #ffffff;
    --bg-topbar: #3a1f3d;        /* prune profond */
    --fg-topbar: #faf6f5;
    --fg-muted: #c4a8b8;          /* rose mauve doux pour texte secondaire en topbar */
    --accent: #d97a8a;            /* rose corail doux */
    --accent-hover: #c0586a;      /* rose corail plus profond */
    --accent-soft: #f5e2e6;       /* rose pale pour backgrounds subtils */
    --gold: #c8a878;              /* touche doree pour separateurs / etats */
    --plum-text: #3a1f3d;         /* titres et headings */
    --body-text: #3d2a3a;         /* texte courant, charcoal teinte plum */
    --danger: #c0392b;
    --ok: #5d8a6a;                /* vert sauge plutot que vert vif */
    --border: #ead8d8;            /* bordure douce rose-beige */
    --radius: 6px;
    --shadow-sm: 0 1px 2px rgba(58, 31, 61, 0.06);
    --shadow-md: 0 4px 16px rgba(58, 31, 61, 0.10);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    color: var(--body-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* -----------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
    background: var(--bg-topbar);
    color: var(--fg-topbar);
    border-bottom: 1px solid #2a1530;
    box-shadow: var(--shadow-sm);
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    height: 56px;
}

.topbar-home {
    color: var(--fg-topbar);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity .15s ease;
}
.topbar-home:hover { opacity: 1; }

.topbar-brand {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-right: 12px;
}
.topbar-brand .brand-main { color: var(--fg-topbar); }
.topbar-brand .brand-accent { color: var(--accent); margin-left: 4px; }

.topbar-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.topbar-link {
    color: var(--fg-topbar);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: background .15s ease;
}
.topbar-link:hover, .topbar-link.active {
    background: rgba(255, 255, 255, 0.08);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-client {
    color: var(--fg-muted);
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.topbar-client .topbar-switch {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}
.topbar-client .topbar-switch:hover { color: var(--accent-hover); }

.topbar-user {
    color: var(--fg-muted);
    font-size: 13px;
}

.topbar-logout {
    color: var(--fg-topbar);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    transition: background .15s ease;
}
.topbar-logout:hover { background: rgba(255, 255, 255, 0.16); }

/* -----------------------------------------------------------------------------
   Page main
   -------------------------------------------------------------------------- */

.page-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.page-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.page-h1 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 600;
    color: var(--plum-text);
}

.page-lead {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
}

.page-footer {
    text-align: center;
    color: #9ca3af;
    padding: 20px 0 30px;
    font-size: 12px;
}

/* -----------------------------------------------------------------------------
   Login + choose-client
   -------------------------------------------------------------------------- */

.login-body {
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 36px 32px 30px;
    width: 100%;
    max-width: 420px;
}

.login-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}
.login-title .brand-main { color: var(--plum-text); }
.login-title .brand-accent { color: var(--accent); margin-left: 6px; }

.login-sub {
    margin: 0 0 24px;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}

.login-info {
    background: var(--accent-soft);
    color: var(--plum-text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    margin: 0 0 16px;
}

.login-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    margin: 0 0 16px;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#loginForm input[type=email] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
}
#loginForm input[type=email]:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-color: transparent;
}

#loginForm button {
    background: var(--accent);
    color: white;
    border: 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease;
}
#loginForm button:hover { background: var(--accent-hover); }

.login-msg {
    margin: 14px 0 0;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
    color: #6b7280;
}
.login-msg.ok { color: var(--ok); }
.login-msg.error { color: var(--danger); }

.login-foot {
    margin: 18px 0 0;
    text-align: center;
    font-size: 12px;
}
.login-foot a {
    color: #6b7280;
    text-decoration: none;
}
.login-foot a:hover { text-decoration: underline; }

/* Choose-client */

.client-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.client-list form { margin: 0; }

.client-btn {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    transition: border-color .15s ease, background .15s ease;
}
.client-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.client-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--plum-text);
}

.client-role {
    font-size: 12px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================================================
   Admin pages (clients/, futures pages admin)
   ============================================================================= */

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
    flex-wrap: wrap;
}

.admin-toolbar .page-h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.back-link {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: normal;
}
.back-link:hover { color: var(--accent); }

.toggle-deleted {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--body-text);
    cursor: pointer;
}
.toggle-deleted input { cursor: pointer; }

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 0 0 24px;
    box-shadow: var(--shadow-sm);
}

.admin-card h2 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--plum-text);
}

.admin-card .card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 18px;
}
.admin-card .card-head h2 { margin: 0; }

.admin-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    background: var(--accent-soft);
    color: var(--plum-text);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.admin-table thead th.num { text-align: right; }
.admin-table thead th.actions { text-align: right; }

.admin-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3e7e7;
    font-size: 14px;
    vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: 0; }

.admin-table tbody tr:hover { background: #fdf8f8; }

.admin-table tbody td.num { text-align: right; }
.admin-table tbody td.actions { text-align: right; white-space: nowrap; }
.admin-table tbody td.empty { text-align: center; color: var(--fg-muted); padding: 30px; font-style: italic; }
.admin-table tbody td.muted { color: var(--fg-muted); }

.admin-table code {
    background: #f5e2e6;
    color: var(--plum-text);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: 'Menlo', 'Monaco', monospace;
}

.row-deleted td {
    color: var(--fg-muted);
    background: #faf2f2;
    text-decoration: line-through;
    text-decoration-color: rgba(58, 31, 61, 0.25);
}
.row-deleted td.actions { text-decoration: none; }
.row-deleted strong { color: var(--fg-muted); }

/* Badges */

.badge-ok, .badge-off, .badge-deleted {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-ok    { background: #dff5e3; color: #2d6e3f; }
.badge-off   { background: #f0e6e6; color: #6b5260; }
.badge-deleted { background: #f5d4d4; color: #8a2c2c; margin-left: 8px; text-decoration: none; }

/* Buttons */

.btn-primary {
    background: var(--accent);
    color: white;
    border: 0;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
    transition: background .15s ease;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-link {
    background: transparent;
    color: var(--accent);
    border: 0;
    padding: 4px 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    font-family: inherit;
}
.btn-link:hover { text-decoration: underline; color: var(--accent-hover); }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { color: #8a2c2c; }

/* Forms */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--plum-text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-grid label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    color: var(--body-text);
}

.form-grid input[type=text],
.form-grid input[type=email],
.form-grid select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--body-text);
}
.form-grid input:focus, .form-grid select:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-color: transparent;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.inline-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
    color: var(--body-text);
}
.inline-input:focus, .inline-input:hover {
    outline: none;
    border-color: var(--border);
    background: var(--bg-card);
}
.inline-input[type=checkbox] { width: auto; }

.muted { color: var(--fg-muted); }
.small { font-size: 12px; }

.hidden { display: none !important; }
