/* ============================================================
   MEDICABINET - STYLES CSS COMPLETS
   Design moderne, responsive et professionnel
   ============================================================ */

/* ===== VARIABLES ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #8b5cf6;
    --info-light: #ede9fe;
    --pink: #ec4899;
    --pink-light: #fce7f3;

    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 65px;

    --bg-light: #f1f5f9;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.3s ease;
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 30px;
    color: white;
}

.login-header h1 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.login-form label i {
    color: var(--primary);
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.logo i {
    font-size: 24px;
    color: var(--success);
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-left-color: var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: capitalize;
}

.logout-btn {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

/* ===== TOP BAR ===== */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 30px;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.top-bar-actions {
    margin-left: auto;
}

.current-date {
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 8px 16px;
    border-radius: var(--radius-md);
}

/* ===== CONTENT WRAPPER ===== */
.content-wrapper {
    padding: 25px 30px;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h2, .card-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i, .card-header h3 i {
    color: var(--primary);
}

.card-body {
    padding: 25px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-blue .stat-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-green .stat-icon { background: linear-gradient(135deg, #10b981, #059669); }
.stat-orange .stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-purple .stat-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

/* ===== APPOINTMENT LIST ===== */
.appointment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.appointment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.appointment-item:hover {
    background: var(--primary-light);
}

.appt-time {
    min-width: 60px;
    text-align: center;
}

.appt-time .time {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.appt-info h4 {
    font-size: 15px;
    margin-bottom: 3px;
}

.appt-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.appt-status {
    margin-left: auto;
}

.appt-phone a {
    color: var(--success);
    font-size: 18px;
    padding: 5px;
}

/* ===== UPCOMING LIST ===== */
.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.upcoming-date {
    text-align: center;
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    min-width: 55px;
}

.upcoming-date .day {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

.upcoming-date .month {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
}

.upcoming-info h4 {
    font-size: 14px;
}

.upcoming-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.upcoming-info p i {
    margin-right: 4px;
}

/* ===== SEARCH BAR ===== */
.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ===== TABLE ===== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

.data-table td code {
    background: var(--bg-light);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-purple { background: var(--info-light); color: var(--info); }
.badge-pink { background: var(--pink-light); color: var(--pink); }
.badge-confirmed { background: var(--success-light); color: var(--success); }
.badge-en-attente { background: var(--warning-light); color: var(--warning); }
.badge-annulé { background: var(--danger-light); color: var(--danger); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: var(--secondary);
    color: white;
}
.btn-secondary:hover { background: #475569; }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #059669; }

.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-warning:hover { background: #d97706; }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-info {
    background: var(--info);
    color: white;
}
.btn-info:hover { background: #7c3aed; }

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
}

.form-group label .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.error-msg {
    display: block;
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

/* ===== FLASH MESSAGES ===== */
.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
}

.flash-close:hover { opacity: 1; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-light);
    color: var(--text-dark);
}

.page-link:hover,
.page-link.active {
    background: var(--primary);
    color: white;
}

.table-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 10px;
}

/* ===== ACTIONS ===== */
.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
}

/* ===== TIMELINE (Medical Records) ===== */
.timeline-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-date {
    min-width: 100px;
    text-align: center;
}

.timeline-date span {
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
}

.timeline-content {
    flex: 1;
}

.timeline-content h4 {
    font-size: 14px;
    color: var(--primary);
    margin: 10px 0 5px;
}

.timeline-content h4:first-child {
    margin-top: 0;
}

.timeline-content p {
    font-size: 14px;
    color: var(--text-dark);
}

.treatment-text {
    background: var(--success-light);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    color: #065f46;
}

.timeline-meta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== PRESCRIPTION ITEMS ===== */
.prescription-item {
    background: var(--bg-light);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    border-left: 4px solid var(--info);
}

.presc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.presc-header h4 {
    font-size: 16px;
    color: var(--info);
}

.prescription-item p {
    font-size: 14px;
    margin: 5px 0;
}

.presc-meta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== PATIENT CARD ===== */
.patient-card {
    border-left: 4px solid var(--primary);
}

.patient-info-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.patient-avatar-lg {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.antecedents-box {
    margin-top: 10px;
    padding: 10px 15px;
    background: var(--warning-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--warning);
}

.antecedents-box strong {
    color: #92400e;
}

.antecedents-box p {
    margin-top: 5px;
    font-size: 14px;
}

/* ===== MEDICAL GRID ===== */
.medical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

/* ===== PRESCRIPTION LAYOUT ===== */
.prescription-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 25px;
}

.prescriptions-history {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.presc-history-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--success);
}

.presc-patient-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.presc-patient-info h4 {
    font-size: 16px;
}

.presc-details p {
    font-size: 14px;
    margin: 4px 0;
    color: var(--text-dark);
}

.presc-details p i {
    color: var(--primary);
    margin-right: 5px;
    width: 16px;
}

.presc-actions {
    margin-top: 12px;
}

/* ===== DOCUMENTS ===== */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.document-item:hover {
    background: var(--primary-light);
}

.doc-icon {
    font-size: 24px;
    color: var(--danger);
}

.doc-info {
    flex: 1;
}

.doc-info h4 {
    font-size: 14px;
}

.doc-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.upload-form {
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-white);
    padding: 15px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    animation: toastIn 0.3s ease;
    border-left: 4px solid;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
    font-size: 20px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-message {
    flex: 1;
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .prescription-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .medical-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .content-wrapper {
        padding: 15px;
    }

    .top-bar {
        padding: 0 15px;
    }

    .page-title {
        font-size: 16px;
    }

    .current-date {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .stat-info h3 {
        font-size: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        padding: 15px;
    }

    .card-body {
        padding: 15px;
    }

    .patient-info-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .actions {
        flex-direction: column;
    }

    .timeline-item {
        flex-direction: column;
        gap: 10px;
    }

    .timeline-date {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .modal-content {
        margin: 10px;
    }
}

/* ===== UTILITY CLASSES ===== */
.mb-4 { margin-bottom: 25px; }
.mt-4 { margin-top: 25px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-warning { color: var(--warning); }

/* ===== VUE SECRÉTARIAT : REGROUPEMENT PAR MÉDECIN ===== */
.doctor-section {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 15px;
    border-left: 4px solid var(--primary);
}

.doctor-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.doctor-header i { color: var(--primary); }
.doctor-header .badge { margin-left: auto; }

.mb-4 { margin-bottom: 25px; }

/* ===== PAGE PARAMÈTRES ===== */
.settings-section {
    border: none;
    margin: 0 0 30px 0;
    padding: 0;
}

.settings-section legend {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    padding: 10px 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section legend i {
    color: var(--primary);
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.logo-preview {
    margin-bottom: 10px;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
}

/* Responsive pour les paramètres */
@media (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== BACKUP & RESTORE UI ===== */
.backup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.backup-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.backup-card h3 {
    margin-bottom: 8px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.backup-card .text-muted {
    margin-bottom: 15px;
    font-size: 13px;
    line-height: 1.4;
}

.backup-card code {
    background: var(--bg-white);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.restore-card {
    border-left: 4px solid var(--warning);
    background: #fffbeb;
}

.restore-card .btn-warning {
    margin-top: 10px;
}

.backup-card .form-group {
    margin-bottom: 12px;
}

.backup-card input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    cursor: pointer;
}

.backup-card input[type="file"]:hover {
    border-color: var(--primary);
}

/* ===== TAG MÉDECIN DANS LES RDV À VENIR ===== */
.upcoming-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: var(--transition);
}

.upcoming-item:hover {
    background: var(--primary-light);
    transform: translateX(3px);
}

.upcoming-date {
    text-align: center;
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    min-width: 55px;
    flex-shrink: 0;
}

.upcoming-date .day {
    display: block;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.upcoming-date .month {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.9;
}

.upcoming-info {
    flex: 1;
}

.upcoming-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.upcoming-info > p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Tag médecin */
.doctor-tag {
    margin-top: 6px !important;
    font-size: 12px;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.doctor-tag i {
    font-size: 11px;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .upcoming-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .upcoming-date {
        align-self: flex-end;
    }
}

.alert-info-custom {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== SMART DASHBOARD ===== */
.appt-completed { background: #f0fdf4; border-left: 4px solid #22c55e; opacity: 0.85; }
.appt-actions { display: flex; gap: 8px; margin-left: auto; }

.action-grid { display: grid; gap: 12px; margin-top: 15px; }
.action-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 16px; background: var(--bg-light); border: 2px dashed var(--border-color);
    border-radius: 12px; text-decoration: none; color: var(--text-dark);
    transition: all 0.2s; cursor: pointer;
}
.action-card:hover { background: var(--primary-light); border-color: var(--primary); transform: translateY(-2px); }
.action-card i { font-size: 24px; margin-bottom: 6px; color: var(--primary); }
.action-card span { font-size: 13px; font-weight: 500; text-align: center; }

.modal-sm { max-width: 420px; }
.fw-bold { font-weight: 600; }
.mb-3 { margin-bottom: 12px; }

/* ===== SMART DASHBOARD ===== */
.appt-completed { 
    background: #f0fdf4; 
    border-left: 4px solid #22c55e; 
    opacity: 0.9; 
}
.appt-actions { 
    display: flex; 
    gap: 8px; 
    margin-left: auto; 
}

/* Modal & Actions */
.modal-sm { max-width: 420px; }
.fw-bold { font-weight: 600; }
.mb-3 { margin-bottom: 12px; }

.action-grid { display: grid; gap: 12px; margin-top: 15px; }
.action-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 16px; background: var(--bg-light); border: 2px dashed var(--border-color);
    border-radius: 12px; text-decoration: none; color: var(--text-dark);
    transition: all 0.2s; cursor: pointer; font-size: 13px; font-weight: 500; text-align: center;
}
.action-card:hover { 
    background: var(--primary-light); 
    border-color: var(--primary); 
    transform: translateY(-2px); 
}
.action-card i { 
    font-size: 24px; 
    margin-bottom: 6px; 
    color: var(--primary); 
}

/* Animations toast */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.text-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}
input[style*="border-color: #ef4444"] {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===== APPOINTMENTS LIST - STYLE CARTES ===== */
.appointments-list {
    display: grid;
    gap: 12px;
}

.appointment-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.appointment-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.appointment-card.today {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
}

.appointment-card.overdue {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.appointment-card.urgent {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

/* En-tête de carte */
.appt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.appt-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.appt-time .date {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.appt-time .time {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.today-badge, .urgent-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

.today-badge {
    background: var(--primary-light);
    color: var(--primary);
}

.urgent-badge {
    background: #fee2e2;
    color: #dc2626;
}

/* Corps de carte */
.appt-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    margin-bottom: 12px;
}

.patient-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.patient-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.patient-name {
    font-weight: 600;
    margin: 0 0 4px 0;
    font-size: 1.05rem;
}

.patient-phone {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.patient-phone:hover {
    text-decoration: underline;
}

.appt-details {
    text-align: right;
}

.motif, .doctor-info {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.motif i, .doctor-info i {
    color: var(--primary);
}

/* Pied de carte */
.appt-footer {
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.actions {
    display: flex;
    gap: 6px;
}

.actions .btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Badges de statut */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-orange { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.badge-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.badge-green { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.badge-red { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-gray { background: #f9fafb; color: #4b5563; border: 1px solid #d1d5db; }

/* Responsive mobile */
@media (max-width: 768px) {
    .appt-body {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .appt-details {
        text-align: left;
    }
    
    .motif, .doctor-info {
        justify-content: flex-start;
    }
    
    .appt-footer {
        justify-content: flex-start;
    }
    
    .appointment-card {
        padding: 12px;
    }
}

/* Filtres & Recherche */
.filters-bar {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    font-size: 0.95rem;
}

.search-wrapper {
    position: relative;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 12px 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.search-clear:hover {
    color: var(--text-dark);
}

/* Pagination */
.pagination-wrapper {
    margin-top: 24px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-item .page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 500;
}

.pagination-info {
    margin-top: 12px;
    font-size: 0.85rem;
}

/* Modal */
.modal-md {
    max-width: 520px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 576px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Utilitaires */
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.text-muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.py-5 { padding: 3rem 0; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }

@media (min-width: 576px) {
    .d-sm-inline { display: inline; }
}

/* ===== FILTRES ===== */
.filters-bar {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-select, .form-control {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    font-size: 0.95rem;
    min-width: 140px;
}

.input-group {
    display: flex;
    gap: 0;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Badge filtre actif */
.text-muted.small strong {
    color: var(--primary);
    font-weight: 600;
}

/* Responsive filtres */
@media (max-width: 768px) {
    .filters-bar form {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .form-select, .form-control {
        width: 100%;
    }
}

/* Utilitaires flex */
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.flex-grow-1 { flex-grow: 1; }
.w-100 { width: 100%; }
.ms-2 { margin-left: 8px; }
.mb-0 { margin-bottom: 0; }
.p-3 { padding: 12px; }
.rounded { border-radius: 8px; }
.bg-light { background: #f8f9fa; }
.text-decoration-none { text-decoration: none; }

/* Messages d'erreur dans les formulaires */
.text-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}
.text-warning {
    color: #f59e0b;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}
.form-control-plaintext {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-muted);
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.d-flex { display: flex; }
.justify-content-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.mt-4 { margin-top: 16px; }