:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --primary-dark: #0e2f44;
    --secondary: #27ae60;
    --secondary-light: #2ecc71;
    --accent: #e74c3c;
    --bg-light: #f8fafb;
    --bg-white: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #6b7c93;
    --border: #e1e8ed;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--bg-light);
}

/* ===== NAVBAR PRO ===== */
.navbar-pro {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--primary-dark);
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.navbar-pro-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-pro-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.navbar-pro-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.navbar-pro-brand span {
    font-weight: 700;
    font-size: 1rem;
}

.navbar-pro-brand .badge-pro {
    background: var(--secondary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar-pro-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-pro-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

.navbar-pro-user .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: white;
}

.navbar-pro-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-pro-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.navbar-pro-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-pro-links .btn-logout {
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-pro-links .btn-logout:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: var(--accent);
    color: white;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.4rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 900;
    transition: transform 0.3s ease;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.sidebar-nav a.active {
    background: rgba(26, 82, 118, 0.06);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav a .badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* ===== MAIN CONTENT ===== */
.pro-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 60px;
}

.pro-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    min-height: calc(100vh - 60px);
}

.pro-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.pro-page-header h1 {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.pro-page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== DASHBOARD CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-card-icon.blue { background: #ebf5fb; color: var(--primary-light); }
.stat-card-icon.green { background: #eafaf1; color: var(--secondary); }
.stat-card-icon.orange { background: #fef5e7; color: #e67e22; }
.stat-card-icon.purple { background: #f4ecf7; color: #9b59b6; }
.stat-card-icon.red { background: #fdedec; color: var(--accent); }

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== CONTENT CARDS ===== */
.content-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.content-card-header h3 {
    font-size: 1.05rem;
    color: var(--text-dark);
}

.content-card-header .btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-light);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.content-card-header .btn-sm:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.content-card-body {
    padding: 1.5rem;
}

/* ===== TABLES ===== */
.pro-table {
    width: 100%;
    border-collapse: collapse;
}

.pro-table th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
}

.pro-table td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.pro-table tr:last-child td {
    border-bottom: none;
}

.pro-table tr:hover td {
    background: var(--bg-light);
}

/* ===== ACTIVITY LIST ===== */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

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

.activity-item:first-child {
    padding-top: 0;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.activity-icon.blue { background: #ebf5fb; color: var(--primary-light); }
.activity-icon.green { background: #eafaf1; color: var(--secondary); }
.activity-icon.orange { background: #fef5e7; color: #e67e22; }

.activity-content .activity-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.activity-content .activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ===== MESSAGES LIST ===== */
.message-list {
    list-style: none;
}

.message-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.message-item:hover {
    background: var(--bg-light);
}

.message-item.unread {
    background: rgba(41, 128, 185, 0.03);
}

.message-item.unread .message-subject {
    font-weight: 600;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message-body {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-subject {
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.message-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== AGENDA ===== */
.agenda-day {
    margin-bottom: 2rem;
}

.agenda-day-header {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 1rem;
}

.agenda-event {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-left: 3px solid var(--border);
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.agenda-event:hover {
    border-left-color: var(--primary);
    background: var(--bg-light);
    border-radius: 0 8px 8px 0;
}

.agenda-event-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
}

.agenda-event-info h4 {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.agenda-event-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== DOCUMENTS ===== */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.doc-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.doc-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.doc-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.doc-card h4 {
    font-size: 0.85rem;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.doc-card .doc-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== PROTOCOLES ===== */
.protocole-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.protocole-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.protocole-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.protocole-card h3 {
    font-size: 1rem;
    color: var(--text-dark);
}

.protocole-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.protocole-tag.active { background: #eafaf1; color: var(--secondary); }
.protocole-tag.draft { background: #fef5e7; color: #e67e22; }

.protocole-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.protocole-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.protocole-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ===== EQUIPE GRID ===== */
.equipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.equipe-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
}

.equipe-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.equipe-card .equipe-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}

.equipe-card h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.equipe-card .equipe-specialty {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.equipe-card .equipe-contact {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
}

.equipe-card .equipe-contact span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 2rem;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-card .login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .login-header .logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.login-card .login-header h1 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.login-card .login-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.login-form .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: var(--transition);
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

.login-form .btn-login {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.login-form .btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 82, 118, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.85rem;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-back {
    text-align: center;
    margin-top: 1rem;
}

.login-back a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.login-back a:hover {
    color: var(--primary);
}

/* ===== FOOTER PRO ===== */
.footer-pro {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-pro a {
    color: var(--primary-light);
    text-decoration: none;
}

.footer-pro a:hover {
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ===== CHARTS GRID ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.chart-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.chart-card-header h3 {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.chart-card-body {
    padding: 1.5rem;
    height: 280px;
    position: relative;
}

/* ===== SIDEBAR MAIN LINK ===== */
.sidebar-link-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    border-left: 3px solid transparent;
    margin-bottom: 0.5rem;
}

.sidebar-link-main:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.sidebar-link-main.active {
    background: rgba(26, 82, 118, 0.06);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-link-main i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* ===== TOOLBAR ===== */
.patients-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

/* ===== DATA TABLE ===== */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    background: var(--bg-light);
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(26, 82, 118, 0.02);
}

.data-table code {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--primary);
}

.table-loading, .table-empty {
    text-align: center;
    padding: 3rem 1rem !important;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.table-loading i, .table-empty i {
    margin-right: 0.5rem;
}

.text-muted { color: var(--text-muted); }
.text-danger { color: var(--accent); font-size: 0.85rem; margin-top: 0.5rem; }

/* ===== ACTION BUTTONS ===== */
.actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 0.4rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transition);
    text-decoration: none;
}

.btn-icon-blue { background: #ebf5fb; color: var(--primary-light); }
.btn-icon-blue:hover { background: var(--primary-light); color: white; }

.btn-icon-green { background: #eafaf1; color: var(--secondary); }
.btn-icon-green:hover { background: var(--secondary); color: white; }

.btn-icon-red { background: #fdedec; color: var(--accent); }
.btn-icon-red:hover { background: var(--accent); color: white; }

.btn-icon-purple { background: #f4ecf7; color: #9b59b6; }
.btn-icon-purple:hover { background: #9b59b6; color: white; }

.btn-icon-primary { background: #e8f4fd; color: var(--primary); }
.btn-icon-primary:hover { background: var(--primary); color: white; }

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 750px; }
.modal-xl { width: 80%; max-width: 900px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.modal-header-danger {
    background: #fdedec;
}

.modal-header-danger h3 {
    color: var(--accent);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ===== FORMS ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
    background: var(--bg-white);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.input-disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-separator {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    padding: 0.75rem 0 0.5rem;
    margin: 0.5rem 0 1rem;
    border-top: 1px solid var(--border);
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-input-wrap {
    position: relative;
}

.autocomplete-input-wrap i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.autocomplete-input-wrap input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.4rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.autocomplete-input-wrap input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
    background: var(--bg-white);
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-dropdown.visible {
    display: block;
}

.autocomplete-item {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(26, 82, 118, 0.06);
    color: var(--primary);
}

.autocomplete-item mark {
    background: rgba(41, 128, 185, 0.15);
    color: var(--primary);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== BUTTON VARIANTS ===== */
.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--accent);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #c0392b;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { background: var(--secondary); }
.toast-error { background: var(--accent); }

/* ===== BADGE MODES (Facturation) ===== */
.badge-mode {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.badge-cb { background: #ebf5fb; color: var(--primary-light); }
.badge-especes { background: #eafaf1; color: var(--secondary); }
.badge-cheque { background: #fef5e7; color: #e67e22; }
.badge-virement { background: #f4ecf7; color: #9b59b6; }

/* ===== QUITTANCE PRINT ===== */
.quittance-print {
    padding: 1rem;
}

.quittance-doc {
    max-width: 100%;
}

.quittance-header-doc {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary);
}

.quittance-header-doc h2 {
    color: var(--primary);
    margin-bottom: 4px;
    font-size: 1.3rem;
}

.quittance-header-doc p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 2px 0;
}

.quittance-numero {
    text-align: right;
}

.quittance-numero h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.quittance-numero p {
    font-size: 0.9rem;
}

.quittance-patient-info {
    background: var(--bg-light);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.quittance-patient-info h4 {
    color: var(--primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.quittance-patient-info p {
    margin: 3px 0;
    font-size: 0.9rem;
}

.quittance-details table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.quittance-details th,
.quittance-details td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}

.quittance-details th {
    background: var(--primary);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.quittance-details tfoot td {
    background: var(--bg-light);
    font-weight: 600;
}

.quittance-paiement {
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin: 1rem 0;
}

.quittance-paiement p {
    margin: 4px 0;
    font-size: 0.9rem;
}

.quittance-footer-doc {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.9rem;
}

.quittance-signature {
    border-top: 1px solid var(--text-dark);
    padding-top: 6px;
    width: 180px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== CONSULTATION WIZARD ===== */
.modal-wizard {
    width: 80%;
    max-width: 1500px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
}

.wizard-header h3 {
    font-size: 1.15rem;
    color: var(--text-dark);
    font-weight: 600;
}

.wizard-cancel {
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
}

.wizard-cancel:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: #fdedec;
}

/* Stepper */
.wizard-stepper {
    padding: 1.5rem 2rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.stepper-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    min-width: 100px;
}

.stepper-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
}

.stepper-step.active .stepper-circle {
    background: var(--primary-light);
    color: white;
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.35);
}

.stepper-step.completed .stepper-circle {
    background: var(--primary-light);
    color: white;
}

.stepper-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.stepper-step.active .stepper-label {
    color: var(--primary-light);
    font-weight: 600;
}

.stepper-step.completed .stepper-label {
    color: var(--primary-light);
}

.stepper-line {
    flex: 1;
    height: 3px;
    background: #e0e0e0;
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
    transition: background 0.3s;
}

.stepper-line.completed {
    background: var(--primary-light);
}

/* Wizard content */
.wizard-step-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.wizard-step-title {
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.wizard-step-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Wizard footer */
.wizard-footer {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

.wizard-footer-spacer {
    flex: 1;
}

.btn-success {
    background: var(--secondary) !important;
}

.btn-success:hover {
    background: #219a52 !important;
}

/* Form row variants */
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1rem;
}

/* ===== ORDONNANCE TYPES GRID ===== */
.ordo-types-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.ordo-type-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    background: var(--bg-white);
}

.ordo-type-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ordo-type-card.selected {
    border-color: var(--primary);
    background: rgba(26, 82, 118, 0.04);
}

.ordo-type-card.selected .ordo-type-check {
    opacity: 1;
    transform: scale(1);
}

.ordo-type-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.ordo-type-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.ordo-type-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ordo-type-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s ease;
}

/* Ordonnance type card colors */
.ordo-medicaments { background: #f0fff4; border-color: #c6f6d5; }
.ordo-medicaments.selected { background: #e6ffed; border-color: var(--secondary); }
.ordo-imagerie { background: #ebf8ff; border-color: #bee3f8; }
.ordo-imagerie.selected { background: #dbeafe; border-color: var(--primary-light); }
.ordo-biologie { background: #fffff0; border-color: #fefcbf; }
.ordo-biologie.selected { background: #fefce8; border-color: #eab308; }
.ordo-specialiste { background: #fdf2f8; border-color: #fbcfe8; }
.ordo-specialiste.selected { background: #fce7f3; border-color: #ec4899; }
.ordo-libre { background: #f8fafc; border-color: #e2e8f0; }
.ordo-libre.selected { background: #f1f5f9; border-color: #64748b; }

/* Ordonnance form sections */
.ordo-form-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.ordo-form-header {
    background: var(--bg-light);
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.ordo-form-header h5 {
    font-size: 0.92rem;
    color: var(--primary);
    font-weight: 600;
}

.ordo-form-header h5 i {
    margin-right: 0.5rem;
}

.ordo-form-body {
    padding: 1.25rem;
}

/* Medication row */
.form-row-medicament {
    display: grid;
    grid-template-columns: 3fr 2fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

.fg-grow { }
.fg-btn { width: 40px; }

.btn-add-row {
    background: var(--bg-light);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 0.75rem;
}

.btn-add-row:hover {
    background: rgba(26, 82, 118, 0.06);
    border-color: var(--primary-light);
}

/* Checkbox grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-dark);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: var(--bg-light);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Bio category */
.bio-category {
    margin-bottom: 1.25rem;
}

.bio-category h6 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

/* ===== ORDONNANCE 3-PANEL LAYOUT ===== */
.ordo-step-content {
    padding: 0 !important;
    flex-direction: column;
    overflow: hidden !important;
}

.ordo-step-content.step-visible {
    display: flex !important;
}

.ordo-layout {
    display: grid;
    grid-template-columns: 180px 1fr 260px;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.ordo-sidebar {
    background: var(--bg-light);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ordo-sidebar-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.ordo-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.ordo-sidebar-item:hover {
    background: rgba(41, 128, 185, 0.06);
    color: var(--primary);
}

.ordo-sidebar-item.active {
    background: rgba(41, 128, 185, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.ordo-sidebar-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.ordo-sidebar-item.ordo-medicaments i { color: var(--secondary); }
.ordo-sidebar-item.ordo-imagerie i { color: var(--primary-light); }
.ordo-sidebar-item.ordo-biologie i { color: #f39c12; }
.ordo-sidebar-item.ordo-specialiste i { color: #9b59b6; }
.ordo-sidebar-item.ordo-libre i { color: var(--text-muted); }

/* Centre : formulaire */
.ordo-center {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    min-height: 300px;
}

.ordo-center-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--text-muted);
    gap: 0.75rem;
}

.ordo-center-empty i {
    font-size: 2.5rem;
    opacity: 0.3;
}

.ordo-center-empty p {
    font-size: 0.9rem;
}

/* Droite : résumé */
.ordo-summary {
    background: var(--bg-light);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.ordo-summary-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ordo-summary-title i {
    font-size: 0.85rem;
}

.ordo-summary-list {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.ordo-summary-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 2rem 0.5rem;
}

.ordo-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.7rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.ordo-summary-item:hover {
    border-color: var(--primary-light);
    background: #f0f7fc;
}

.ordo-summary-item.active {
    border-color: var(--primary-light);
    background: #e8f4fd;
}

.ordo-summary-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.ordo-summary-item-info > i {
    color: var(--primary-light);
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.ordo-summary-item-type {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dark);
}

.ordo-summary-item-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== CONFIRM MODAL (reusable) ===== */
.confirm-replace-modal .modal-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: none;
}

.confirm-replace-modal .modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.confirm-replace-modal .modal-header h3 i {
    color: var(--primary-light);
    font-size: 1rem;
}

.confirm-replace-modal .modal-body {
    padding: 0 1.5rem 1.25rem;
}

.confirm-replace-text {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.confirm-replace-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
    border-radius: 0 0 var(--radius) var(--radius);
    gap: 0.6rem;
}

.confirm-replace-modal .modal-footer .btn-primary {
    padding: 0.55rem 1.2rem;
    font-size: 0.88rem;
}

.confirm-replace-modal .modal-footer .btn-secondary {
    padding: 0.55rem 1.2rem;
    font-size: 0.88rem;
}

/* ===== ORDONNANCE INSTANCES ===== */
.ordo-instance {
    margin-bottom: 0;
    background: transparent;
}

.ordo-instance-body {
    padding: 0.5rem 0;
}

/* Ajouter l'ordonnance button (in wizard footer) */
.btn-ordo-add {
    align-items: center;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    gap: 0.5rem;
    background: var(--secondary) !important;
}

.btn-ordo-add:hover {
    background: #219a52 !important;
}

.ordo-renewal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ordo-renewal-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
}

.ordo-renewal-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

.ordo-renew-months {
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.8rem;
    background: var(--bg-white);
    color: var(--text-dark);
    cursor: pointer;
}

.ordo-urgent {
    display: flex;
    align-items: center;
}

.ordo-urgent-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ordo-urgent-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

.ordo-instance-body .checkbox-grid {
    margin-bottom: 1rem;
}

.ordo-instance-body .form-group {
    margin-bottom: 0.75rem;
}

.ordo-bio-options {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* Bio categories grid */
.bio-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.bio-cat {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.bio-cat-header {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.75rem;
    text-transform: uppercase;
}

.bio-cat-body {
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.bio-cat-body label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--text-dark);
    padding: 0.25rem 0.35rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.bio-cat-body label:hover {
    background: #f5f3ff;
}

.bio-cat-body input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #7c3aed;
    flex-shrink: 0;
}

.bio-categories-grid::-webkit-scrollbar {
    width: 5px;
}

.bio-categories-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.bio-categories-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .bio-categories-grid {
        grid-template-columns: 1fr;
    }
}

/* Imagerie form */
.imag-form {
    margin-bottom: 1rem;
}

.imag-manual-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem;
    border: 1px dashed var(--primary-light);
    border-radius: 8px;
    color: var(--primary-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
}

.imag-manual-toggle:hover {
    background: rgba(41, 128, 185, 0.06);
}

.btn-imag-add {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    font-size: 0.88rem;
}

.imag-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.imag-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 0.75rem;
}

.imag-list-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.imag-list-type {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.imag-list-zone {
    font-size: 0.82rem;
    color: var(--text-dark);
}

.imag-list-manual {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.ordo-libre-templates {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.ordo-libre-templates label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.ordo-libre-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-sm.btn-outline {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* Medication autocomplete in ordonnance */
.ordo-instance .autocomplete-container {
    position: relative;
}

.ordo-instance .med-dropdown {
    position: absolute;
    top: calc(100% - 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
}

.ordo-instance .med-dropdown .autocomplete-item {
    padding: 0.7rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.88rem;
    transition: background 0.15s;
    line-height: 1.4;
}

.ordo-instance .med-dropdown .autocomplete-item:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.ordo-instance .med-dropdown .autocomplete-item:hover {
    background: rgba(41, 128, 185, 0.06);
}

.ordo-instance .med-dropdown .autocomplete-item strong {
    display: block;
    color: var(--text-dark);
}

.ordo-instance .med-dropdown .autocomplete-item mark {
    background: rgba(41, 128, 185, 0.15);
    color: var(--primary);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.ordo-meds-list {
    margin-bottom: 0.75rem;
}

.ordo-meds-list .medicament-row {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.ordo-meds-list .medicament-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.med-row-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
    padding-left: 0.25rem;
}

.med-renew-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
}

.med-renew-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.med-renew-months {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dark);
}

/* ===== ACTE SEARCH & SELECTION ===== */
.actes-search-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.acte-selected-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.acte-selected-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.input-montant {
    background: #fef9c3 !important;
    font-weight: 600;
}

.btn-add-acte {
    width: 100%;
    padding: 0.75rem;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.btn-add-acte:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.actes-table tfoot td {
    font-weight: 600;
    background: var(--bg-light);
    padding: 0.85rem 1.25rem;
}

/* ===== CONFIRMATION ===== */
.confirmation-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.confirm-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.confirm-section-header {
    background: var(--bg-light);
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.confirm-section-header i {
    margin-right: 0.5rem;
}

.confirm-section-body {
    padding: 1.25rem;
}

.confirm-row {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.confirm-row:last-child {
    border-bottom: none;
}

.confirm-label {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 120px;
    display: inline-block;
}

.confirm-ordonnances-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.confirm-ordo-item {
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.confirm-ordo-type {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.confirm-ordo-item ul {
    padding-left: 1.25rem;
    font-size: 0.85rem;
}

.confirm-ordo-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.confirm-actes {
    font-size: 0.9rem;
}

.confirm-acte-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.confirm-acte-row code {
    background: var(--bg-light);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--primary);
}

.confirm-acte-price {
    margin-left: auto;
    font-weight: 600;
    color: var(--secondary);
}

.confirm-acte-total {
    padding: 0.75rem 0;
    font-size: 0.95rem;
    border-top: 2px solid var(--border);
    margin-top: 0.5rem;
}

.confirm-acte-paiement {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Badge ordonnance */
.badge-ordo {
    background: rgba(41, 128, 185, 0.1);
    color: var(--primary-light);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ===== RESPONSIVE PRO ===== */
@media (max-width: 968px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .pro-main {
        margin-left: 0;
    }

    .footer-pro {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .form-row, .form-row-3, .form-row-4 {
        grid-template-columns: 1fr;
    }

    .ordo-layout {
        grid-template-columns: 150px 1fr 220px;
    }

    .ordo-sidebar-item span {
        font-size: 0.8rem;
    }

    .form-row-medicament {
        grid-template-columns: 1fr 1fr;
    }

    .modal-wizard {
        width: 95%;
    }

    .wizard-step-content {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .pro-main {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .equipe-grid {
        grid-template-columns: 1fr;
    }

    .doc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-pro-user span {
        display: none;
    }

    .patients-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .data-table th,
    .data-table td {
        padding: 0.7rem 0.75rem;
        font-size: 0.82rem;
    }

    .actions-cell {
        flex-wrap: wrap;
    }

    .modal {
        margin: 0.5rem;
    }

    .quittance-header-doc {
        flex-direction: column;
        gap: 1rem;
    }

    .quittance-numero {
        text-align: left;
    }

    .quittance-footer-doc {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .ordo-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .ordo-sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .ordo-sidebar-title {
        display: none;
    }

    .ordo-sidebar-item {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.5rem 0.7rem;
        white-space: nowrap;
        font-size: 0.78rem;
    }

    .ordo-sidebar-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary);
    }

    .ordo-summary {
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: 150px;
    }

    .form-row-medicament {
        grid-template-columns: 1fr;
    }

    .stepper-label {
        font-size: 0.7rem;
    }

    .stepper-circle {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .modal-wizard {
        width: 98%;
    }

    .wizard-header, .wizard-footer, .wizard-step-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .wizard-stepper {
        padding: 1rem;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== MODAL DOSSIER PATIENT ===== */
.modal-patient-view {
    width: 85%;
    max-width: 1400px;
    max-height: 90vh;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.patient-view-body {
    overflow-y: auto;
    padding: 1.5rem;
}

.patient-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.25rem;
}

.pv-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pv-info { grid-column: 1; grid-row: 1; }
.pv-consultations { grid-column: 2; grid-row: 1; }
.pv-ordonnances { grid-column: 3; grid-row: 1; }
.pv-medical { grid-column: 1 / -1; grid-row: 2; }

.pv-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.pv-card-header i {
    color: var(--primary-light);
    font-size: 1rem;
}

.pv-card-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.pv-card-body {
    padding: 1rem 1.1rem;
    flex: 1;
    max-height: 320px;
    overflow-y: auto;
}

.pv-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Info rows */
.pv-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f0f3f5;
}

.pv-info-row:last-child { border-bottom: none; }

.pv-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pv-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

.pv-value code {
    background: #f0f3f5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Medical sections */
.pv-medical-section {
    margin-bottom: 1rem;
}

.pv-medical-section:last-child { margin-bottom: 0; }

.pv-medical-section h5 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pv-medical-section h5 i {
    font-size: 0.75rem;
}

.pv-medical-section p {
    font-size: 0.83rem;
    color: var(--text-dark);
    line-height: 1.5;
    padding-left: 1.2rem;
    white-space: pre-line;
}

/* List items (consultations / ordonnances) */
.pv-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pv-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
}

.pv-list-item:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
}

.pv-list-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.pv-list-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.pv-list-number {
    font-size: 0.72rem;
    background: var(--primary);
    color: white;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.pv-list-motif {
    font-size: 0.8rem;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pv-list-type {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.pv-type-medicaments { background: #eafaf1; color: var(--secondary); }
.pv-type-biologie { background: #fef9e7; color: #f39c12; }
.pv-type-imagerie { background: #f4ecf7; color: #9b59b6; }
.pv-type-specialiste { background: #ebf5fb; color: var(--primary-light); }
.pv-type-libre { background: #f0f3f5; color: var(--text-muted); }

.pv-list-actions {
    display: flex;
    gap: 0.35rem;
    margin-left: 0.5rem;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
    border-radius: 6px;
}

.pv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    gap: 0.5rem;
}

.pv-empty i {
    font-size: 1.5rem;
    opacity: 0.5;
}

.pv-empty span {
    font-size: 0.82rem;
}

/* Responsive patient view */
@media (max-width: 1100px) {
    .patient-view-grid {
        grid-template-columns: 1fr 1fr;
    }
    .pv-info { grid-column: 1; grid-row: 1; }
    .pv-consultations { grid-column: 2; grid-row: 1; }
    .pv-ordonnances { grid-column: 1; grid-row: 2; }
    .pv-medical { grid-column: 2; grid-row: 2; }
}

@media (max-width: 768px) {
    .modal-patient-view {
        width: 95%;
    }
    .patient-view-grid {
        grid-template-columns: 1fr;
    }
    .pv-info { grid-column: 1; grid-row: auto; }
    .pv-consultations { grid-column: 1; grid-row: auto; }
    .pv-ordonnances { grid-column: 1; grid-row: auto; }
    .pv-medical { grid-column: 1; grid-row: auto; }
}
