/* ============================================================
   LES REFUGES – ADMIN TEMPLATE CSS
   Design: NEWTEMPLATE (monolith editorial)
   ============================================================ */


/* === VARIABLES === */

:root {
    --sidebar-width: 250px;
    --bg-main: #f5f6f8;
    --bg-sidebar: #283d5f;
    --bg-card: #ffffff;
    --bg-input: #f8f9fb;
    --border: #e5e8ee;
    --border-soft: #edf0f3;
    --text-dark: #25313c;
    --text-main: #334250;
    --text-medium: #6e7b88;
    --text-light: #9ba5b1;
    --accent: #283d5f;
    --accent-dark: #5a6a7e;
    --success: #2dbd85;
    --warning: #f5a623;
    --danger: #ef5a67;
    --radius-card: 10px;
    --radius-btn: 8px;
    --radius-input: 6px;
    --shadow-soft: 0 8px 24px rgba(31, 42, 55, 0.04);
}


/* === RESET & BASE === */

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

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
}


/* === LAYOUT === */

.app {
    display: flex;
    min-height: 100vh;
}


/* === SIDEBAR === */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 32px 16px 24px;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.brand {
    padding: 0 12px 24px;
}

.brand h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: wheat;
    line-height: 1.1;
}

.brand p {
    margin: 7px 0 0;
    font-size: 12px;
    color: #6f8296;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-nav {
    margin-top: 16px;
}

.sidebar-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    margin-bottom: 2px;
    color: rgb(226, 222, 222);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 0;
    transition: color 0.15s;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-nav .nav-link.active {
    color: wheat;
    font-weight: 700;
}

.sidebar-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #77869b;
}

.sidebar-nav .nav-link:hover {
    color: wheat;
    font-weight: 700;
}

.sidebar-nav hr {
    border-color: var(--border);
    margin: 10px 0;
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 8px 0;
}

.btn-new-entry {
    display: block;
    width: 100%;
    border: none;
    border-radius: var(--radius-btn);
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 13px 14px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(75, 90, 109, 0.12);
    cursor: pointer;
    transition: background 0.15s;
}

.btn-new-entry:hover {
    background: var(--accent-dark);
    color: white;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #728297;
    font-size: 12px;
    font-weight: 500;
    padding: 10px 6px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: color 0.15s;
}

.footer-link:hover {
    color: #17222d;
}


/* === MAIN === */

.main {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}


/* === TOPBAR === */

.topbar {
    height: 74px;
    border-bottom: 1px solid var(--border);
    background: rgba(245, 246, 248, 0.96);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px 0 28px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-dark);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.search-box {
    width: 360px;
    max-width: 100%;
    position: relative;
}

.search-box>i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9eabb8;
    font-size: 13px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 38px;
    background: #eef1f5;
    border: 1px solid #eef1f5;
    border-radius: 6px;
    padding: 0 13px 0 38px;
    font-size: 14px;
    color: #32404f;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.search-box input:focus {
    background: white;
    border-color: var(--border);
}

#global-search-results {
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    border: 1px solid var(--border);
    border-top: none;
}

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

.top-icon {
    color: #506177;
    font-size: 17px;
    transition: color 0.15s;
}

.top-icon:hover {
    color: #17222d;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #243548, #6d7b92);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
}


/* === MENU OVERLAY === */

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 29, 38, 0.24);
    display: none;
    z-index: 1030;
}

.menu-overlay.show {
    display: block;
}


/* === CONTENT AREA === */

.content {
    padding: 36px 40px 48px;
}

.breadcrumbs {
    margin-bottom: 24px;
    color: #8d98a4;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.breadcrumbs a {
    color: #8d98a4;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs strong {
    color: #53667a;
    font-weight: 700;
}


/* === PAGE HERO === */

.page-title {
    margin: 0 0 8px;
    font-size: 58px;
    line-height: 0.97;
    letter-spacing: -0.055em;
    font-weight: 800;
    color: #24313c;
}

.page-subtitle {
    max-width: 720px;
    margin: 14px 0 30px;
    font-size: 19px;
    line-height: 1.45;
    color: #667482;
}

.hero-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.hero-copy h1 {
    margin: 0;
    font-size: 58px;
    line-height: 0.96;
    letter-spacing: -0.055em;
    font-weight: 800;
    color: #22313c;
}

.hero-copy p {
    max-width: 680px;
    margin: 12px 0 0;
    color: #647381;
    font-size: 18px;
    line-height: 1.45;
}


/* === STATS GRID === */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 28px;
    border: 1px solid rgba(229, 232, 238, 0.75);
    min-height: 170px;
}

.stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    background: #edf1f4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c7a8f;
    font-size: 19px;
}

.stat-chip {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
}

.chip-green {
    background: #e8f7f0;
    color: var(--success);
}

.chip-red {
    background: #fdecef;
    color: var(--danger);
}

.chip-soft {
    background: transparent;
    color: #a2adba;
}

.stat-label {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #586879;
    margin-bottom: 5px;
    font-weight: 700;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #293742;
}


/* === DASHBOARD GRID === */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(270px, 0.85fr);
    gap: 26px;
    align-items: start;
    margin-bottom: 30px;
}

.panel {
    background: white;
    border-radius: var(--radius-card);
    border: 1px solid rgba(229, 232, 238, 0.55);
    padding: 28px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.panel-title {
    font-size: 19px;
    font-weight: 700;
    margin: 0;
    color: #222f39;
}

.panel-link {
    color: #61728a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.activity-item {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f3f5f7;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-title {
    font-size: 15px;
    font-weight: 700;
    color: #25313c;
    margin-bottom: 2px;
}

.activity-meta {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7c8794;
}

.activity-side {
    text-align: right;
    min-width: 90px;
}

.activity-time {
    font-size: 12px;
    color: #5f6e7c;
    margin-bottom: 4px;
}

.activity-status {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-complete {
    color: var(--success);
}

.status-progress {
    color: #69778a;
}


/* === TABLE CARD === */

.table-card {
    background: var(--bg-card);
    border: 1px solid rgba(229, 232, 238, 0.75);
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 30px;
}

.specimen-table {
    width: 100%;
    margin: 0;
}

.specimen-table thead th {
    padding: 18px 22px;
    color: #667586;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: #fff;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
    position: relative;
}

.specimen-table thead th[data-sortable="true"] {
    cursor: pointer;
    user-select: none;
    padding-right: 28px;
}

.specimen-table thead th.asc::after {
    content: "▲";
    position: absolute;
    right: 9px;
    font-size: 0.6em;
    top: 50%;
    transform: translateY(-50%);
}

.specimen-table thead th.desc::after {
    content: "▼";
    position: absolute;
    right: 9px;
    font-size: 0.6em;
    top: 50%;
    transform: translateY(-50%);
}

.specimen-table tbody td {
    padding: 18px 22px;
    border-bottom: 1px solid #f1f3f6;
    vertical-align: middle;
    color: #516271;
    font-size: 14px;
}

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

.specimen-table tbody tr:hover {
    background: #fafbfc;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px 14px;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px 16px;
    border-top: 1px solid var(--border-soft);
    flex-wrap: wrap;
}

.table-meta {
    color: #6d7c8d;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.table-filter input {
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    padding: 0 16px 0 40px;
    font-size: 15px;
    color: #334250;
    outline: none;
    width: 340px;
    transition: border-color 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f7d94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

.table-filter input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(68, 107, 226, 0.08);
}

.action-icon {
    color: #6f7d94;
    font-size: 14px;
}

.action-icon:hover {
    color: #24313c;
}

.action-icon.delete {
    color: #d94c55;
}

.action-icon.delete:hover {
    color: #b83840;
}


/* === HERO BUTTON === */

.btn-add-specimen {
    min-width: 190px;
    height: 50px;
    border: 0;
    border-radius: var(--radius-btn);
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 22px rgba(95, 111, 136, 0.14);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 38px;
    transition: background 0.15s;
}

.btn-add-specimen:hover {
    background: var(--accent-dark);
    color: white;
}


/* === TABS === */

.tabs-line {
    display: flex;
    align-items: flex-end;
    gap: 26px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 26px;
}

.tabs-line a {
    position: relative;
    display: inline-block;
    padding: 0 0 13px;
    color: #647383;
    font-size: 14px;
    font-weight: 500;
}

.tabs-line a.active {
    color: #1e2a35;
    font-weight: 700;
}

.tabs-line a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
}


/* === FORM CARD === */

.form-card {
    background: var(--bg-card);
    border: 1px solid rgba(229, 232, 238, 0.75);
    border-radius: var(--radius-card);
    padding: 34px 32px 28px;
    margin-bottom: 30px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #293742;
    margin: 0 0 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
    letter-spacing: 0.01em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 32px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 32px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: #677585;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-control,
.form-select {
    min-height: 42px;
    border-radius: var(--radius-input);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: #374452;
    font-size: 14px;
    padding: 8px 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(111, 125, 148, 0.1);
    background: white;
    outline: none;
}

.form-control::placeholder {
    color: #98a4b1;
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
    padding-top: 10px;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}

.form-check {
    position: relative;
    display: inline-block;
    margin: 0;
    padding-left: 0px;
}

.form-check-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.form-check-label {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border: 1.5px solid #dde3ea;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #5d6d7e;
    background: #f8f9fb;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    user-select: none;
    white-space: nowrap;
    line-height: 1;
}

.form-check:hover .form-check-label {
    border-color: var(--accent);
    color: var(--accent);
    background: #eef1fb;
}

.form-check:has(input:checked) .form-check-label {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}


/* Radio/checkbox fields: label inline with pills */

.field:has(.radio-row) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.field:has(.radio-row)>label {
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 100px;
}


/* Entente fields: full row width, pills on a single line */

.form-grid .field:has(input[name*="entente_"]) {
    grid-column: span 3;
}

.form-grid .field:has(input[name*="entente_"]) .radio-row {
    flex-wrap: nowrap;
}

/* ── Onglet Complémentaires : settings-list layout ── */

#tab-complementaire .form-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

#tab-complementaire .form-grid .field {
    padding: 14px 22px;
    margin: 0;
    border-bottom: 1px solid var(--border-soft);
    justify-content: space-between;
    min-height: 52px;
    transition: background 0.12s;
}

#tab-complementaire .form-grid .field:hover {
    background: #f9fafb;
}

#tab-complementaire .form-grid .field:last-child {
    border-bottom: none;
}

/* Entente rows: same row layout as other fields, pills on the right */
#tab-complementaire .form-grid .field:has(input[name*="entente_"]) {
    flex-direction: row;
    align-items: center;
}

#tab-complementaire .form-grid .field:has(input[name*="entente_"]) .radio-row {
    flex-wrap: nowrap;
}

/* Section divider before first entente field */
#tab-complementaire .form-grid .field:has(input[name="entente_chien"]) {
    border-top: 2px solid var(--border);
}

/* ── Onglet Médias : settings-list layout ── */

#tab-media .form-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

#tab-media .form-grid .field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 13px 22px;
    margin: 0;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.12s;
}

#tab-media .form-grid .field:last-child {
    border-bottom: none;
}

#tab-media .form-grid .field:hover {
    background: #f9fafb;
}

#tab-media .form-grid .field > label {
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
}

#tab-media .form-grid .field .form-control {
    flex: 1;
    max-width: 340px;
}

#tab-media .form-grid .img-preview-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#tab-media .form-grid .img-preview-wrap img {
    height: 44px;
    width: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.form-actions {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 110px;
    height: 44px;
    border-radius: var(--radius-btn);
    background: white;
    border: 1px solid var(--border);
    color: #708094;
    font-size: 14px;
    font-weight: 600;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-cancel:hover {
    background: #f5f6f8;
    color: #334250;
    text-decoration: none;
}

.btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 170px;
    height: 44px;
    border-radius: var(--radius-btn);
    background: var(--accent);
    border: 1px solid var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 0 20px;
    box-shadow: 0 6px 18px rgba(93, 108, 128, 0.16);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-save:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: white;
    text-decoration: none;
}


/* === PAGE FORM HEADER (title + action buttons on same row) === */

.page-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-form-header h2 {
    margin: 0 0 4px;
    font-size: 28px;
    font-weight: 800;
    color: #24313c;
    line-height: 1.2;
}

.page-form-header .page-subtitle {
    margin: 0;
    font-size: 15px;
    color: #7d8fa4;
}

.page-form-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}


/* img preview in forms */

.img-preview-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.img-preview-wrap img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.btn-clear-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


/* === SUMMARY CARDS === */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 30px;
}

.report-card {
    border-radius: var(--radius-card);
    min-height: 185px;
    padding: 26px 26px 22px;
    background: var(--accent);
    color: white;
}

.card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.report-card .card-label {
    color: rgba(255, 255, 255, 0.82);
}

.metric-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.metric-value {
    color: #1e2d39;
    font-size: 50px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.metric-side {
    color: #19a86f;
    font-size: 14px;
    font-weight: 700;
}

.metric-side.neutral {
    color: #627284;
    font-weight: 500;
}

.metric-text {
    color: #657482;
    font-size: 14px;
    line-height: 1.45;
    max-width: 250px;
}

.report-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 17px;
    line-height: 1.4;
    max-width: 260px;
    margin: 0 0 20px;
}

.report-link {
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}


/* === FORM TABS === */

.form-tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 28px;
    padding-bottom: 0;
}

.form-tab-btn {
    position: relative;
    padding: 10px 22px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    background: none;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-tab-btn:hover {
    color: var(--text-dark);
    background: var(--border-soft);
}

.form-tab-btn.active {
    color: var(--accent-dark);
    background: #eef1f5;
}

.form-tab-btn.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

.form-tab-btn i {
    font-size: 14px;
    opacity: 0.75;
}

.form-tab-pane {
    display: none;
}

.form-tab-pane.active {
    display: block;
}


/* === PAGINATION === */

.pagination-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6a7a8c;
    font-weight: 700;
    font-size: 14px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    background: white;
    color: #7f8b98;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.page-btn:hover {
    background: #f0f2f5;
}


/* === SPOTLIGHT CARD (sidebar right) === */

.spotlight-card {
    background: var(--accent);
    color: white;
    padding: 28px 26px;
    border-radius: var(--radius-card);
    position: relative;
}

.spotlight-card h3 {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0 0 18px;
    letter-spacing: -0.02em;
}

.spotlight-card p {
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.82);
}

.btn-ghost-light {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border-radius: var(--radius-btn);
    font-weight: 700;
    padding: 12px 14px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-size: 12px;
    cursor: pointer;
}

.health-card {
    background: #eef2f4;
    border-radius: var(--radius-card);
    padding: 28px 26px;
}

.health-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.health-title {
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #59697c;
    font-weight: 700;
}

.health-dot {
    width: 8px;
    height: 8px;
    background: #34c79a;
    border-radius: 50%;
}

.health-bar {
    height: 4px;
    background: #d8dee5;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.health-bar span {
    display: block;
    height: 100%;
    background: #65758d;
    border-radius: 999px;
}

.health-text {
    color: #6d7a89;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* === LOGIN PAGE === */

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

.login-card {
    width: 100%;
    max-width: 430px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 46px 42px;
    box-shadow: 0 16px 56px rgba(31, 42, 55, 0.07);
}

.login-brand {
    margin-bottom: 32px;
}

.login-brand h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #182331;
    margin: 0;
}

.login-brand p {
    color: #6f8296;
    font-size: 12px;
    margin: 5px 0 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #24313c;
    margin: 0 0 26px;
    line-height: 1.05;
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    margin-bottom: 7px;
    color: #677585;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.login-field .form-control {
    width: 100%;
    height: 44px;
}

.btn-login {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: var(--radius-btn);
    background: var(--accent);
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 8px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(93, 108, 128, 0.18);
    transition: background 0.15s;
}

.btn-login:hover {
    background: var(--accent-dark);
}


/* === UTILITY === */

.noresponsiveitem {
    /* Hidden on mobile via media query */
}

.section-panel {
    background: white;
    border-radius: var(--radius-card);
    border: 1px solid rgba(229, 232, 238, 0.75);
    padding: 28px;
    margin-bottom: 26px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #222f39;
    margin: 0 0 18px;
}

.alert-msg {
    padding: 14px 18px;
    border-radius: var(--radius-input);
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-msg.success {
    background: #e8f7f0;
    color: #1e7a54;
    border: 1px solid #c0ead8;
}

.alert-msg.error {
    background: #fdecef;
    color: #9b2c32;
    border: 1px solid #f5c0c4;
}


/* === RESPONSIVE === */

@media (max-width: 1280px) {
    .page-title,
    .hero-copy h1 {
        font-size: 46px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 24px;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main {
        width: 100%;
        margin-left: 0;
    }
    .mobile-menu-btn {
        display: inline-flex !important;
    }
    .content {
        padding: 22px 18px 30px;
    }
    .page-title,
    .hero-copy h1 {
        font-size: 38px;
    }
    .page-subtitle,
    .hero-copy p {
        font-size: 16px;
    }
    .hero-row {
        flex-direction: column;
        gap: 16px;
    }
    .btn-add-specimen {
        margin-top: 0;
        min-width: 0;
        width: 100%;
    }
    .table-card {
        overflow-x: auto;
    }
    .specimen-table {
        min-width: 700px;
    }
    .noresponsiveitem {
        display: none !important;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 767.98px) {

    /* ── Tabs animaux : icônes seules ── */
    .form-tabs-nav {
        gap: 2px;
    }
    .form-tab-btn {
        padding: 10px 14px 12px;
        font-size: 0;        /* cache le texte */
        gap: 0;
        flex: 1;
        justify-content: center;
    }
    .form-tab-btn i {
        font-size: 16px;
        opacity: 1;
    }

    /* ── Settings-list (complementaire) : colonne sur mobile ── */
    #tab-complementaire .form-grid .field {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        min-height: 0;
    }
    #tab-complementaire .form-grid .field .radio-row,
    .form-grid .field:has(input[name*="entente_"]) .radio-row,
    #tab-complementaire .form-grid .field:has(input[name*="entente_"]) .radio-row {
        flex-wrap: wrap !important;
    }
    .form-check-label {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* ── Bannière home ── */
    .home-update-banner {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 14px !important;
        padding: 18px 18px !important;
    }
    .home-update-banner-btns {
        flex-direction: row !important;
        width: 100%;
        gap: 8px !important;
    }
    .home-update-banner-btns a {
        flex: 1;
        text-align: center;
    }

    .topbar {
        padding: 0 16px;
        gap: 12px;
    }
    .search-box {
        width: 100%;
    }
    .page-title,
    .hero-copy h1 {
        font-size: 30px;
    }
    .form-grid,
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    .span-2,
    .span-3 {
        grid-column: span 1;
    }
    .form-actions {
        flex-direction: column-reverse;
    }
    .btn-cancel,
    .btn-save {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .table-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .table-filter input {
        width: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 32px 24px;
    }
}