/* ================================================== */
/* COMPONENTS - PANELS / BUTTONS / NAV / DASHBOARD    */
/* ================================================== */

.glass-card,
.panel,
.stat,
.row,
.sheet,
.dispatch-card,
.record-card,
.patient-hero,
dialog {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(14, 35, 68, 0.94), rgba(6, 18, 38, 0.94));
    border: 1px solid rgba(100, 165, 255, 0.26);
    border-radius: 22px;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.38),
        0 0 28px rgba(23, 139, 255, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        inset 0 -16px 34px rgba(0, 0, 0, 0.20);
    backdrop-filter: blur(14px);
}

.glass-card::before,
.panel::before,
.stat::before,
.row::before,
.sheet::before,
.dispatch-card::before,
.record-card::before,
.patient-hero::before,
dialog::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 46%;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.04) 45%, transparent 100%);
}

.panel::after,
.stat::after,
.dispatch-card::after,
.patient-hero::after {
    content: "";
    position: absolute;
    top: -30%;
    right: -20%;
    width: 60%;
    height: 80%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(23,139,255,.14), transparent 65%);
}

/* ================================================== */
/* BUTTONS                                            */
/* ================================================== */

button {
    position: relative;
    overflow: hidden;
    isolation: isolate;

    border: 1px solid rgba(0, 0, 0, 0.72);
    border-radius: 14px;
    padding: 12px 18px;

    color: #ffffff;
    font-weight: 900;
    cursor: pointer;

    background:
        linear-gradient(180deg, #7cc5ff 0%, #2d8dff 42%, #0963e1 58%, #053b96 100%);

    box-shadow:
        0 0 0 1px rgba(148, 209, 255, 0.28),
        0 11px 24px rgba(23, 139, 255, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.66),
        inset 0 -10px 18px rgba(0, 0, 0, 0.26);

    text-shadow: 0 1px 2px rgba(0,0,0,.35);

    transition:
        transform .18s ease,
        filter .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

button::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 8%;
    top: 6%;
    width: 84%;
    height: 42%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.08));
    pointer-events: none;
}

button::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 10%;
    right: 10%;
    bottom: 8%;
    height: 11%;
    border-radius: 999px;
    background: rgba(0,0,0,.18);
    filter: blur(.2px);
    pointer-events: none;
}

button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08) saturate(1.08);
    border-color: rgba(0, 0, 0, 0.92);
    box-shadow:
        0 0 0 1px rgba(180, 225, 255, 0.40),
        0 0 26px rgba(23,139,255,.30),
        0 16px 34px rgba(23, 139, 255, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        inset 0 -10px 18px rgba(0, 0, 0, 0.24);
}

button:active {
    transform: translateY(1px) scale(.99);
    box-shadow:
        inset 0 5px 12px rgba(0, 0, 0, 0.38),
        0 5px 14px rgba(23,139,255,.22);
}

button.secondary {
    color: #eaf4ff;
    background:
        linear-gradient(180deg, #30445f 0%, #172a47 48%, #0c1a30 100%);
    border: 1px solid rgba(160, 190, 230, 0.24);
    box-shadow:
        0 0 0 1px rgba(255,255,255,.04),
        0 10px 20px rgba(0,0,0,.28),
        inset 0 1px 0 rgba(255,255,255,.20),
        inset 0 -10px 18px rgba(0,0,0,.22);
}

button.danger,
.danger,
.logout {
    color: #ffffff;
    background:
        linear-gradient(180deg, #ff7a84 0%, #ef3340 44%, #b31322 62%, #6d0710 100%);
    border: 1px solid rgba(0, 0, 0, 0.75);
    box-shadow:
        0 0 0 1px rgba(255, 160, 170, 0.24),
        0 11px 24px rgba(239, 51, 64, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.58),
        inset 0 -10px 18px rgba(0, 0, 0, 0.30);
}

.logout {
    width: 100%;
}

/* ================================================== */
/* BRAND / NAV / PROFILE                              */
/* ================================================== */

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px 14px 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 10% 0%, rgba(239,51,64,.20), transparent 38%),
        linear-gradient(180deg, rgba(15, 37, 70, .96), rgba(6, 18, 38, .96));
    border: 1px solid rgba(100, 165, 255, 0.28);
    box-shadow:
        0 20px 48px rgba(0,0,0,.34),
        0 0 30px rgba(23,139,255,.16),
        inset 0 1px 0 rgba(255,255,255,.12);
    overflow: hidden;
}

.brand-logo {
    width: 74px;
    height: 74px;
    object-fit: contain;
    filter:
        drop-shadow(0 0 12px rgba(255,255,255,.25))
        drop-shadow(0 0 22px rgba(23,139,255,.40))
        drop-shadow(0 0 26px rgba(239,51,64,.25));
}

.spin-logo {
    animation: spinLogo 9s linear infinite;
    transform-origin: center;
}

@keyframes spinLogo {
    to { transform: rotateY(360deg); }
}

.brand-text h1 {
    margin: 0;
    font-size: 40px;
    letter-spacing: 2px;
    line-height: 1;
    text-shadow:
        0 0 10px rgba(255,255,255,.72),
        0 0 22px rgba(23,139,255,.42);
}

.brand-text h1::after {
    content: " EMS";
    color: var(--blue);
    text-shadow: 0 0 18px rgba(23,139,255,.64);
}

.brand-text p {
    margin: 6px 0 2px;
    color: var(--text-soft);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.brand-text span {
    display: inline-block;
    margin-top: 3px;
    color: #ff4c5a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(239, 51, 64, 0.65);
}

.nav {
    display: grid;
    gap: 11px;
    padding-top: 26px;
}

.nav-btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    color: #dbe8f8;
    background:
        linear-gradient(180deg, rgba(17, 35, 62, .82), rgba(6, 18, 38, .90));
    border: 1px solid rgba(100, 165, 255, 0.12);
    border-radius: 16px;
    box-shadow:
        0 10px 24px rgba(0,0,0,.22),
        inset 0 1px 0 rgba(255,255,255,.07),
        inset 0 -10px 18px rgba(0,0,0,.16);
}

.nav-btn.active,
.nav-btn:hover {
    color: white;
    background:
        radial-gradient(circle at 92% 12%, rgba(255,255,255,.32), transparent 11%),
        linear-gradient(180deg, #ff5664 0%, #d51f31 48%, #8a101b 100%);
    border-color: rgba(255, 140, 150, 0.52);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 26px rgba(239, 51, 64, 0.30),
        0 12px 30px rgba(0,0,0,.34),
        inset 0 1px 0 rgba(255,255,255,.34),
        inset 0 -14px 22px rgba(0,0,0,.20);
}

.profile {
    margin-top: auto;
    padding: 18px 12px 0;
    text-align: center;
    border-top: 1px solid rgba(100,165,255,.16);
}

.profile-badge {
    width: 92px;
    height: 92px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 24px rgba(23,139,255,.36));
}

.profile strong,
.profile span {
    display: block;
}

.profile span {
    margin: 4px 0 14px;
    color: var(--muted);
    font-size: 13px;
}

/* ================================================== */
/* DASHBOARD / LISTS                                  */
/* ================================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.stat {
    min-height: 135px;
    padding: 24px;
    border-color: rgba(23,139,255,.42);
}

.stat span {
    color: var(--text-soft);
    font-weight: 800;
}

.stat b {
    display: block;
    margin-top: 10px;
    font-size: 46px;
    font-weight: 500;
    text-shadow: 0 0 20px rgba(23,139,255,.26);
}

.card-blue { box-shadow: var(--shadow-deep), 0 0 28px rgba(23,139,255,.20), inset 0 1px 0 rgba(255,255,255,.10); }
.card-red { border-color: rgba(239,51,64,.38); box-shadow: var(--shadow-deep), 0 0 28px rgba(239,51,64,.16), inset 0 1px 0 rgba(255,255,255,.10); }
.card-green { border-color: rgba(22,210,118,.32); }
.card-purple { border-color: rgba(168,85,247,.36); }
.card-dark { border-color: rgba(100,165,255,.22); }

.panel {
    padding: 22px;
    margin-bottom: 18px;
}

.panel h3 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 20px;
}

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

.dashboard-grid .wide {
    grid-column: 1 / -1;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.toolbar h3 {
    margin: 0;
    font-size: 20px;
}

.list {
    display: grid;
    gap: 10px;
}

.row {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    color: var(--text);
}

.row:hover,
.panel:hover,
.dispatch-card:hover,
.stat:hover {
    transform: translateY(-2px);
    border-color: rgba(53,215,255,.40);
    box-shadow:
        0 28px 80px rgba(0,0,0,.42),
        0 0 30px rgba(23,139,255,.18),
        inset 0 1px 0 rgba(255,255,255,.14);
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 900;
    color: #eaf4ff;
    background: linear-gradient(180deg, rgba(23,139,255,.38), rgba(4,26,58,.72));
    border: 1px solid rgba(100,165,255,.25);
}

.badge.green {
    color: #c7ffd9;
    background: linear-gradient(180deg, rgba(22,210,118,.32), rgba(8,66,35,.72));
    border-color: rgba(22,210,118,.30);
}

.badge.orange {
    color: #ffe0b7;
    background: linear-gradient(180deg, rgba(255,155,33,.34), rgba(91,48,7,.72));
    border-color: rgba(255,155,33,.34);
}

.badge.red {
    color: #ffd4d9;
    background: linear-gradient(180deg, rgba(239,51,64,.34), rgba(95,8,17,.74));
    border-color: rgba(239,51,64,.34);
}

/* ================================================== */
/* SELECTEURS / LISTES DÉROULANTES                    */
/* ================================================== */

select {
    background: #061426;
    color: #ffffff;

    border: 1px solid rgba(80, 170, 255, 0.45);
    border-radius: 10px;

    padding: 10px 12px;

    font-weight: 700;
}

select option {
    background: #061426;
    color: #ffffff;
}

select option:hover,
select option:checked {
    background: #1769e8;
    color: #ffffff;
}
