﻿/* ============================================================
   INSPIRIA DESIGN SYSTEM
   ============================================================ */

/* --------------------------
   Variables globales (partagées)
   -------------------------- */
:root {
    /* Palette de base */
    --insp-green: #27ae60;
    --insp-green-light: #4ade80;
    --insp-green-dark: #1b5e20;
    --insp-blue: #60c6fa;
    --insp-light-blue: #78cdf8;
    --insp-light-green: #a7f7c9;
    --insp-orange: #e67e22;
    --insp-purple: #ebabf7;
    --insp-yellow: #faf3a9;
    --insp-grey: #7f8c8d;
    --insp-light-grey: #bdc3c7;
    --insp-red: #c0392b;
    /* -------- Teal / Navy tokens -------- */
    --insp-teal-500: #00b8d4;
    --insp-teal-600: #00acc1;
    --insp-teal-700: #0097a7;
    --insp-teal-800: #00838f;
    --insp-navy-900: #0a1628;
    --insp-navy-800: #0d2137;
    --insp-navy-700: #1a2d42;
    --insp-navy-deep: #081220;
    --insp-gradient-primary: linear-gradient(135deg, #0097a7, #00b8d4);
    /* -------- Sizing -------- */
    --insp-radius-sm: 4px;
    --insp-radius-md: 8px;
    --insp-radius-pill: 16px;
    --insp-font-small: 0.75rem;
    --insp-font-normal: 0.875rem;
    --insp-font-title: 1rem;
    /* -------- STATUTS PATIENTS -------- */
    --insp-statut-demande: var(--insp-orange);
    --insp-statut-actif: var(--insp-green);
    --insp-statut-planifie: var(--insp-blue);
    --insp-statut-injoignable: var(--insp-red);
    --insp-statut-termine: var(--insp-grey);
    --insp-statut-autre: var(--insp-light-grey);
    /* -------- TRAITEMENTS -------- */
    --insp-o2: var(--insp-light-blue);
    --insp-ppc: var(--insp-light-green);
    --insp-vni: var(--insp-yellow);
    --insp-ppc-asv: #1abc9c;
    --insp-traitement-autre: var(--insp-grey);
}

/* --------------------------
   THEME CLAIR (Light)
   -------------------------- */
[data-theme="light"] {
    color-scheme: light;
    /* Surfaces */
    --insp-bg: #e8ecf0;
    --insp-surface: #f5f6f8;
    --insp-text: #1a2533;
    --insp-text-muted: #5d6a78;
    --insp-border: #d0d6dd;
    /* Layout */
    --insp-sidebar-bg: #eef1f5;
    --insp-topbar-bg: #eef1f5;
    --insp-topbar-fg: #00838f;
    /* Accent teal */
    --insp-teal-accent: #00838f;
    --insp-glow-bg: none;
    /* Navigation */
    --insp-nav-link: #5a6a7e;
    --insp-nav-icon: #9ca3af;
    --insp-nav-hover-bg: rgba(0, 131, 143, 0.08);
    --insp-nav-hover-fg: #00838f;
    --insp-nav-active-bg: rgba(0, 131, 143, 0.12);
    --insp-nav-active-fg: #00838f;
    --insp-nav-icon-active: #00838f;
    /* Cards */
    --insp-card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

/* --------------------------
   THEME SOMBRE (Dark)
   -------------------------- */
[data-theme="dark"] {
    color-scheme: dark;
    /* Surfaces */
    --insp-bg: #0a1628;
    --insp-surface: #0d2137;
    --insp-text: #e8ecf1;
    --insp-text-muted: #7b8fa3;
    --insp-border: #1a2d42;
    /* Layout */
    --insp-sidebar-bg: #081220;
    --insp-topbar-bg: #081220;
    --insp-topbar-fg: #00b8d4;
    /* Accent teal */
    --insp-teal-accent: #00b8d4;
    --insp-glow-bg: radial-gradient(ellipse at 50% 0%, rgba(0, 184, 212, 0.06) 0%, transparent 60%);
    /* Navigation */
    --insp-nav-link: #7b8fa3;
    --insp-nav-icon: #5a6a7e;
    --insp-nav-hover-bg: rgba(0, 184, 212, 0.08);
    --insp-nav-hover-fg: #00b8d4;
    --insp-nav-active-bg: rgba(0, 184, 212, 0.15);
    --insp-nav-active-fg: #00b8d4;
    --insp-nav-icon-active: #00b8d4;
    /* Cards */
    --insp-card-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* ============================================================
   STATUS CHIP
   ============================================================ */

.insp-chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--insp-radius-pill);
    font-size: var(--insp-font-small);
    font-weight: 600;
    letter-spacing: 0.4px;
    min-width: 80px;
    text-align: center;
}

/* Couleurs selon le statut patient – glass / translucide */
.insp-chip-a-appareiller {
    background-color: rgba(245, 124, 0, 0.85);
    color: #ffffff;
}

.insp-chip-actif {
    background-color: rgba(56, 168, 60, 0.85);
    color: #ffffff;
}

.insp-chip-injoignable {
    background-color: rgba(198, 40, 40, 0.85);
    color: #ffffff;
}

.insp-chip-termine {
    background-color: rgba(120, 144, 156, 0.85);
    color: #ffffff;
}

.insp-chip-autre {
    background-color: rgba(176, 190, 197, 0.85);
    color: #ffffff;
}

/* ============================================================
   STATUTS MATÉRIEL
   ============================================================ */

/* MATERIEL EN STOCK = bleu */
.insp-chip-en-stock {
    background-color: rgba(25, 118, 210, 0.85);
    color: #ffffff;
}

/* MATERIEL AFFECTE = vert (comme "actif") */
.insp-chip-affecte {
    background-color: rgba(56, 168, 60, 0.85);
    color: #ffffff;
}

/* MATERIEL RETIRE = gris */
.insp-chip-retire {
    background-color: rgba(120, 144, 156, 0.85);
    color: #ffffff;
}


/* ============================================================
   CHIPS TRAITEMENTS
   ============================================================ */

.insp-chip-traitement {
    font-weight: 500;
    border-radius: 999px;
}

/* Couleurs pleines et saturées, texte blanc : le contraste est identique
   en thème clair et sombre (fond fixe, pas de transparence).
   Contraste texte/fond visé >= 4.5:1 (WCAG AA). */

/* O2 – bleu */
.insp-chip-traitement-o2 {
    background-color: #1565c0;
    color: #ffffff;
}

/* PPC – vert */
.insp-chip-traitement-ppc {
    background-color: #2e7d32;
    color: #ffffff;
}

/* VNI – orange brûlé */
.insp-chip-traitement-vni {
    background-color: #b35900;
    color: #ffffff;
}

/* PPC-ASV – teal */
.insp-chip-traitement-ppc-asv {
    background-color: #00737f;
    color: #ffffff;
}

/* Aspiration – or olive */
.insp-chip-traitement-aspi {
    background-color: #7a6b00;
    color: #ffffff;
}

/* Aérosol – brun sable */
.insp-chip-traitement-aero {
    background-color: #8d6e4c;
    color: #ffffff;
}

/* Autres / défaut – gris ardoise */
.insp-chip-traitement-autre {
    background-color: #546e7a;
    color: #ffffff;
}


.insp-chip-indication {
    border-radius: var(--insp-radius-pill);
    font-size: var(--insp-font-small);
    padding: 0 8px;
}
/* SAHOS : violet */
.insp-chip-indication-sahos {
    background-color: rgba(156, 39, 176, 0.85);
    color: #ffffff;
}

/* SACS : bleu */
.insp-chip-indication-sacs {
    background-color: rgba(25, 118, 210, 0.85);
    color: #ffffff;
}

/* IRC : orange */
.insp-chip-indication-irc {
    background-color: rgba(245, 124, 0, 0.85);
    color: #ffffff;
}

/* AVF : vert */
.insp-chip-indication-avf {
    background-color: rgba(56, 168, 60, 0.85);
    color: #ffffff;
}

/* Autre : gris */
.insp-chip-indication-autre {
    background-color: rgba(120, 144, 156, 0.85);
    color: #ffffff;
}

/* ============================================================
   CHIPS FORFAITS
   ============================================================ */

.insp-chip-forfait {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--insp-radius-pill);
    font-size: var(--insp-font-small);
    font-weight: 600;
    letter-spacing: 0.4px;
    text-align: center;
}

/* INI / TL1 / PED – vert */
.insp-chip-forfait-ini,
.insp-chip-forfait-tl1,
.insp-chip-forfait-ped {
    background-color: rgba(56, 168, 60, 0.85);
    color: #ffffff;
}

/* TL2 – orange */
.insp-chip-forfait-tl2 {
    background-color: rgba(245, 124, 0, 0.85);
    color: #ffffff;
}

/* TL3 – rouge */
.insp-chip-forfait-tl3 {
    background-color: rgba(198, 40, 40, 0.85);
    color: #ffffff;
}

/* Autre / défaut – gris */
.insp-chip-forfait-autre {
    background-color: rgba(120, 144, 156, 0.85);
    color: #ffffff;
}

/* ============================================================
   PRESCRIPTION CHIP (pastille ronde avec icône)
   ============================================================ */

.insp-chip-prescription {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    flex-shrink: 0;
}

.insp-chip-prescription-en-cours {
    background-color: rgba(56, 168, 60, 0.85);
}

.insp-chip-prescription-a-signer {
    background-color: rgba(245, 124, 0, 0.85);
}

.insp-chip-prescription-en-retard {
    background-color: rgba(198, 40, 40, 0.85);
}

.insp-chip-prescription-autre {
    background-color: rgba(120, 144, 156, 0.85);
}

/* ============================================================
   SOURCES EXTERNES MACHINE
   ============================================================ */

.insp-chip-source-resmed {
    background-color: rgba(25, 118, 210, 0.85);
    color: #ffffff;
}

.insp-chip-source-lowenstein {
    background-color: rgba(156, 39, 176, 0.85);
    color: #ffffff;
}

.insp-chip-source-non-associe {
    background-color: rgba(176, 190, 197, 0.85);
    color: #ffffff;
}

.insp-chip-source-autre {
    background-color: rgba(245, 124, 0, 0.85);
    color: #ffffff;
}

.associations-table .mud-table-cell,
.associations-table .mud-table-head .mud-table-cell {
    font-size: 0.75rem;
    padding: 4px 8px;
}

.obs-cell {
    width: 40px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    gap:10px;
}

.obs-cell--empty {
    background: transparent;
    border: 1px dashed #ddd;
}

.obs-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.obs--bon {
    background-color: #27ae60; /* vert foncé */
    border-color: #1b5e20;
    color: #fff;
}

.obs--moyen {
    background-color: #ef9d44; /* orange foncé */
    border-color: #e65100;
    color: #fff;
}

.obs--insuffisant {
    background-color: #ee4545; /* rouge foncé */
    border-color: #8e0000;
    color: #fff;
}

.obs--pasutil {
    background-color: #bdc3c7; 
    border-color: #0d47a1;
    color: #fff;
}

.obs--nodata {
    background-color: #a6a6ff; /* gris foncé */
    border-color: #424242;
    color: #fff;
}
.obs-cell--placeholder {
    visibility: hidden;
}

/* Responsive : texte court (heures seules) masqué par défaut */
.obs-text-short {
    display: none;
}

@media (max-width: 1600px) {
    .obs-text-full {
        display: none;
    }
    .obs-text-short {
        display: inline;
    }
    .obs-cell {
        width: 28px;
        height: 24px;
        font-size: 0.7rem;
    }
    .col-hide-compact {
        display: none !important;
    }
}

.itt-tile {
    height: 64px; /* ~2cm */
    min-width: 120px;
    border-radius: 10px;
    border: 0px solid;
    display: inline-flex;    
}

.itt--row {
    width: 100%;
    height: 100%;
    padding: 8px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.itt__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.itt__icon {
    opacity: 0.85;
}


.itt__value {
    line-height: 1.1;
    font-weight: 700;
}

.itt__caption {
    line-height: 1.0;
    opacity: 0.8;
}

.itt-tile--empty {
    opacity: 0.45;
}

/* pastille 28j (sans texte) - rectangles */
.itt-dot {
    width: 40px;
    height: 24px;
    min-width: 36px;
    min-height: 20px;
    border-radius: 4px;
    display: inline-flex;
}

.obs-28j-row {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* aligné à droite */
    width: 100%;
    gap: 4px;
}

/* ============================================================
   DATAGRID – en-tête centré (à utiliser via HeaderClass)
   ============================================================ */
.insp-header-center {
    text-align: center !important;
    justify-content: center !important;
}

.insp-header-center > * {
    justify-content: center !important;
}

/* ============================================================
   MUDBLAZOR OVERRIDES – Teal/Navy theme
   ============================================================ */

.mud-typography {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mud-paper {
    border-radius: 12px;
}

.mud-chip {
    border-radius: 8px;
}

.mud-button-filled.mud-button-filled-primary,
.mud-button-filled.mud-button-filled-primary:hover,
.mud-button-filled.mud-button-filled-primary:focus-visible,
.mud-button-filled.mud-button-filled-primary:active {
    background: linear-gradient(135deg, #1b8a5a, #27ae60, #2ecc71) !important;
    background-color: #27ae60 !important;
    border: none !important;
    color: #ffffff !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    filter: brightness(1.1);
}

.mud-button-filled.mud-button-filled-primary .mud-icon-root {
    color: #ffffff !important;
}

.mud-fab-primary {
    background: linear-gradient(135deg, #1b8a5a, #27ae60, #2ecc71) !important;
    border: none !important;
    color: #ffffff !important;
}

.mud-fab-primary .mud-icon-root {
    color: #ffffff !important;
}

.mud-fab-primary:hover {
    filter: brightness(1.1);
}

/* -------- Accordions InspirIA -------- */
.expansion-header-primary {
    border-radius: var(--insp-radius-md, 8px) !important;
    overflow: hidden;
    margin-bottom: 4px;
}

.expansion-header-primary > .mud-expand-panel-header {
    border-bottom: none !important;
    border-radius: var(--insp-radius-md, 8px) var(--insp-radius-md, 8px) 0 0 !important;
}

/* Dark theme */
[data-theme="dark"] .expansion-header-primary > .mud-expand-panel-header {
    background: linear-gradient(to right, #0097a7, #1a1a2e) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .expansion-header-primary > .mud-expand-panel-header .mud-icon-root,
[data-theme="dark"] .expansion-header-primary > .mud-expand-panel-header .mud-typography {
    color: #ffffff !important;
}

[data-theme="dark"] .expansion-header-primary > .mud-expand-panel-header .mud-expand-panel-icon {
    color: #ffffff !important;
}

/* Light theme */
[data-theme="light"] .expansion-header-primary > .mud-expand-panel-header {
    background: linear-gradient(to right, #0097a7, #ffffff) !important;
    color: #ffffff !important;
}

[data-theme="light"] .expansion-header-primary > .mud-expand-panel-header .mud-icon-root,
[data-theme="light"] .expansion-header-primary > .mud-expand-panel-header .mud-typography {
    color: #ffffff !important;
}

[data-theme="light"] .expansion-header-primary > .mud-expand-panel-header .mud-expand-panel-icon {
    color: #424242 !important;
}

