/* =====================================================
   VARIABLES
===================================================== */
:root {
    --bg: #0b1220;
    --sidebar: #020617;
    --panel: #0f172a;
    --panel-light: #111827;

    --text: #e5e7eb;
    --muted: #94a3b8;

    --primary: #7c3aed;
    --danger: #dc2626;
    --warn: #f59e0b;
}

/* =====================================================
   RESET & BASE
===================================================== */
* {
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    display: flex;
    height: 100vh;
}

/* =====================================================
   SIDEBAR
===================================================== */
.sidebar {
    width: 260px;
    background: var(--sidebar);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 30px;
}

.sidebar a {
    color: var(--muted);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar a.active,
.sidebar a:hover {
    background: var(--primary);
    color: #fff;
}

/* =====================================================
   MAIN LAYOUT
===================================================== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--panel);
    padding: 20px 30px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid #1f2937;
}

.content {
    padding: 30px;
    overflow-y: auto;
}

/* =====================================================
   CARDS
===================================================== */
.card {
    background: var(--panel-light);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 24px;
}

.card h3 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #c4b5fd;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 8px;
}

/* =====================================================
   FORM STRUCTURE
===================================================== */
form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    color: var(--muted);
}

/* =====================================================
   INPUTS / SELECTS
===================================================== */
input,
select {
    background: #020617;
    color: var(--text);

    border: 1px solid #1e293b;
    border-radius: 10px;

    padding: 10px 12px;
    font-size: 14px;

    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
    color: #64748b;
}

input:hover,
select:hover {
    border-color: #334155;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}

/* SELECT ARROW */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='white' height='10' viewBox='0 0 24 24' width='10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    padding-right: 32px;
}

/* =====================================================
   TEXTAREA — CONFORT D'ÉCRITURE (LE POINT CLÉ)
===================================================== */
textarea {
    width: 100%;
    min-height: 180px;

    background: linear-gradient(to bottom, #0f172a, #020617);
    color: var(--text);

    border: 1px solid #1e293b;
    border-radius: 14px;

    padding: 18px 20px;

    font-size: 15px;
    line-height: 1.8;
    letter-spacing: 0.2px;

    font-family: Inter, system-ui, sans-serif;
    caret-color: var(--primary);

    resize: vertical;
    outline: none;

    box-shadow:
        inset 0 1px 2px rgba(0,0,0,0.5);

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

textarea::placeholder {
    color: #64748b;
    font-style: italic;
}

textarea:hover {
    border-color: #334155;
}

textarea:focus {
    background: #020617;
    border-color: var(--primary);
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.6),
        0 0 0 3px rgba(124, 58, 237, 0.25);
}

/* =====================================================
   CHECKBOX
===================================================== */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* =====================================================
   BUTTONS
===================================================== */
button {
    background: var(--primary);
    color: #fff;

    border: none;
    border-radius: 12px;

    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

button.secondary {
    background: #334155;
}

button.danger {
    background: var(--danger);
}

/* =====================================================
   TABLES
===================================================== */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px;
    border-bottom: 1px solid #1f2937;
}

th {
    text-align: left;
    color: var(--muted);
}

tr:hover {
    background: #020617;
    cursor: pointer;
}

/* =====================================================
   BADGES
===================================================== */
.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.badge.warn { background: var(--warn); }
.badge.dead { background: var(--danger); }

.badge.kine { background: #f59e0b; }
.badge.psy { background: #a855f7; }
.badge.chir { background: #3b82f6; }
.badge.ophtalmo { background: #22d3ee; }
.badge.gyneco { background: #ec4899; }

/* =====================================================
   DOSSIER STATES
===================================================== */
.row-watch {
    border-left: 4px solid var(--danger);
}

.row-unvalidated {
    background: #0b1a3a;
}

.row-dead {
    opacity: 0.45;
}

/* =====================================================
   SEARCH BAR
===================================================== */
.search-bar {
    display: flex;
    gap: 10px;
}

.search-bar input,
.search-bar select {
    flex: 1;
}
/* ===== FOOTER ===== */
.footer {
    margin-top: 30px;
    padding: 12px 20px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid #1f2937;
}

/* =====================================================
   FOOTER
===================================================== */
body .main .footer {
    margin-top: auto !important;
    padding: 14px 20px !important;

    text-align: center !important;
    font-size: 13px !important;
    color: var(--muted) !important;

    background-color: #0f172a !important;
    border-top: 1px solid #1f2937 !important;

    width: 100% !important;
    max-width: none !important;
}
