:root {
    --sidebar-width: 250px;
    --primary-color: #1a5f7a;
    --secondary-color: #159895;
    --accent-color: #57c5b6;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: "Segoe UI", "Tahoma", Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 14px;
    padding-top: 70px; /* للتعويض عن الشريط العلوي الثابت */
}

/* Top Navigation Bar - شريط علوي ثابت */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    margin-right: 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #f0f7ff;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color)
    );
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.lab-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.spacer {
    flex-grow: 1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--accent-color),
        var(--secondary-color)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 70px; /* تحت الشريط العلوي */
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 70px);
    background: rgb(255, 255, 255);
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.sidebar-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Menu Items */
.menu-items {
    padding: 15px 0;
}

.menu-item {
    margin-bottom: 2px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
    border-left: 3px solid transparent;
}

.menu-link:hover {
    background: #f8f9fa;
    color: var(--primary-color);
    border-left-color: var(--accent-color);
}

.menu-link.active {
    background: #f0f7ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.menu-link i {
    width: 24px;
    font-size: 16px;
    text-align: center;
    margin-right: 10px;
}

.menu-badge {
    background: var(--accent-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

/* Main Content */
.main-content {
    padding: 25px;
    transition: margin-left 0.3s ease;
    margin-left: 0;
}

.main-content.expanded {
    margin-left: var(--sidebar-width);
}

/* Page Header */
.page-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    border-left: 4px solid var(--accent-color);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Create Report Button */
.btn-create {
    background: linear-gradient(
        to right,
        var(--primary-color),
        var(--secondary-color)
    );
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    box-shadow: 0 3px 8px rgba(26, 95, 122, 0.25);
    margin-left: auto;
}

.btn-create:hover {
    background: linear-gradient(
        to right,
        var(--secondary-color),
        var(--primary-color)
    );
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 95, 122, 0.35);
}

/* Filters Section */
.filters-container {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.search-box {
    position: relative;
    flex-grow: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
    background-color: #fcfdfd;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(87, 197, 182, 0.15);
    background-color: white;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    min-height: 500px;
}

.table {
    margin-bottom: 0;
    font-size: 13px;
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    vertical-align: middle;
    border-top: 1px solid #f0f0f0;
    color: var(--text-secondary);
    border-bottom: 1px solid #f8f9fa;
    white-space: nowrap;
}

.table thead th {
    background: #f8fafc;
    border: none;
    padding: 14px 15px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Patient Info */
.patient-info {
    display: flex;
    flex-direction: column;
}

.patient-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    font-size: 13px;
}

.patient-age {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Gender Badge */
.gender-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
}

.gender-m {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.gender-f {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* Specimen Number */
.specimen-no {
    background: #f0f7ff;
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
    letter-spacing: 0.5px;
    border: 1px solid #e3f2fd;
}

/* Actions */
.action-dropdown {
    position: relative;
}

.btn-action {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-action:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 6px 0;
    min-width: 140px;
    border: 1px solid var(--border-color);
    z-index: 10000;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: var(--light-bg);
    padding-left: 20px;
}

.dropdown-item i {
    width: 16px;
    font-size: 14px;
}

/* Pagination */
.pagination-container {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 12.5px;
}

.pagination {
    margin: 0;
}

.page-link {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    margin: 0 2px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 12.5px;
}

.page-link:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .top-navbar {
        height: 60px;
        padding: 0 15px;
    }

    .sidebar {
        top: 60px;
        height: calc(100vh - 60px);
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
    }

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

    .main-content.expanded {
        margin-left: 0;
    }

    .brand-name {
        font-size: 16px;
    }

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

    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-create {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .user-info {
        display: none;
    }
}

@media (min-width: 769px) {
    .main-content {
        margin-left: var(--sidebar-width);
    }

    .sidebar-toggle {
        display: none;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 15px;
    color: var(--text-secondary);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    background: white;
    margin-top: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* ///////////////////////////////////////////////////////////خاص بـــ form//////////////////////////////////////////////////// */
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */

.report-form {
    --primary-color: #1a5f7a;
    --primary-light: #e8f4fc;
    --secondary-color: #159895;
    --accent-color: #57c5b6;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --border-color: #e9ecef;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-light: 0 1px 4px rgba(0, 0, 0, 0.04);
}

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

/* body {
            font-family: "Segoe UI", "Tahoma", Geneva, Verdana, sans-serif;
            background-color: #f8fafc;
            color: var(--text-primary);
            line-height: 1.6;
            font-size: 14px;
        } */

/* Form Container */
.form-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px;
    padding-bottom: 120px;
    background-color: white;
    border-radius: 20px;
    box-shadow: #1234 1px 1px 15px;
}

/* Medical Header */
.medical-header {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border-top: 5px solid var(--primary-color);
}

.medical-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.medical-title-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(
        135deg,
        var(--primary-color),
        var(--secondary-color)
    );
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
}

.medical-title-text h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.medical-title-text .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Basic Information Form */
.basic-form-section {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    background: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    color: var(--primary-color);
    font-size: 16px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-body {
    padding: 20px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.form-label.required::after {
    content: " *";
    color: var(--danger-color);
}

.form-control,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(87, 197, 182, 0.15);
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-input {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-input:checked + .radio-custom {
    border-color: var(--accent-color);
}

.radio-input:checked + .radio-custom::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
}

.radio-label {
    font-size: 13px;
    color: var(--text-primary);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-urgent {
    background-color: #f8d7da;
    color: #721c24;
}

/* Specimen Number Display */
.specimen-display {
    display: inline-block;
    padding: 8px 12px;
    background: #f0f7ff;
    border: 1px solid #e3f2fd;
    border-radius: 6px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Grid System for Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Patient Info Section Special Styling */
.patient-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f8ff 100%);
    border-left: 4px solid var(--accent-color);
}

/* Report Sections */
.report-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

.report-section-header {
    background: linear-gradient(to right, #f8fafc, #f1f8ff);
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.report-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-section-icon {
    width: 38px;
    height: 38px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 16px;
}

.report-section-title-text h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.report-section-title-text .report-section-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.section-action-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.section-action-btn:hover {
    background: #f8f9fa;
    color: var(--primary-color);
    border-color: var(--accent-color);
}

/* Editor Container */
.editor-container {
    padding: 25px;
}

/* Quill Editor Customization */
.ql-toolbar {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px 8px 0 0 !important;
    background: #f8f9fa !important;
}

.ql-container {
    border: 1px solid var(--border-color) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    font-size: 14px;
    min-height: 150px;
}

.ql-editor {
    min-height: 150px;
    padding: 15px !important;
}

.ql-editor.ql-blank::before {
    color: #999 !important;
    font-style: normal !important;
    font-size: 14px !important;
}

/* Word Counter */
.word-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.word-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.word-count .count {
    font-weight: 600;
    color: var(--primary-color);
}

.helper-hint {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.helper-hint i {
    color: var(--warning-color);
}

/* Diagnosis Section Special Styling */
.diagnosis-section .report-section-header {
    background: linear-gradient(to right, #fff8e1, #fff3e0);
    border-left: 4px solid var(--warning-color);
}

.diagnosis-section .report-section-icon {
    background: #fff3e0;
    color: var(--warning-color);
}

.diagnosis-warning {
    background: #fff8e1;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.diagnosis-warning i {
    color: var(--warning-color);
    font-size: 18px;
}

.diagnosis-warning p {
    margin: 0;
    font-size: 13px;
    color: #856404;
}

/* Template Modal */
.template-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.template-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.template-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.template-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.template-list {
    padding: 20px;
    overflow-y: auto;
    max-height: 50vh;
}

.template-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-item:hover {
    border-color: var(--accent-color);
    background: #f8f9fa;
}

.template-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.template-preview {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.template-tag {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* Sticky Action Bar */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-bar-left {
    display: flex;
    gap: 10px;
}

.action-bar-right {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: #f8f9fa;
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(
        to right,
        var(--primary-color),
        var(--secondary-color)
    );
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(
        to right,
        var(--secondary-color),
        var(--primary-color)
    );
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 95, 122, 0.3);
}

.btn-success {
    background: linear-gradient(to right, var(--success-color), #27ae60);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(to right, #27ae60, var(--success-color));
}

.btn-telegram {
    background: linear-gradient(to right, #0088cc, #2ca5e0);
    color: white;
}

.btn-telegram:hover {
    background: linear-gradient(to right, #2ca5e0, #0088cc);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error States */
.error-message {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.has-error .form-control,
.has-error .form-select {
    border-color: var(--danger-color);
}

.has-error .error-message {
    display: block;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success-color);
}

.status-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        padding: 15px;
        padding-bottom: 180px;
    }

    .medical-header {
        padding: 20px;
    }

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

    .report-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-actions {
        width: 100%;
        justify-content: space-between;
    }

    .action-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .action-bar-left,
    .action-bar-right {
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .action-bar,
    .section-actions,
    .template-modal,
    .ql-toolbar {
        display: none !important;
    }

    .report-section,
    .basic-form-section {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .ql-editor {
        min-height: auto;
        border: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* //////////////////////////////////////////////////////////////////////////////// */
/* //////////////////////////////////////////////////////////////////////////////// */
/* //////////////////////////////////////////////////////////////////////////////// */
/* //////////////////////////////////////////////////////////////////////////////// */
/* //////////////////////////////////////////////////////////////////////////////// */
/* //////////////////////////////////////////////////////////////////////////////// */
/* //////////////////////////////////////////////////////////////////////////////// */

/* التعديل النهائي - حل بسيط وفعال */
/* تقليل حجم جميع محررات Quill الأربعة */
.report-section .ql-container {
    min-height: 50px !important;
    max-height: 80px !important;
    transition: all 0.3s ease !important;
}

.report-section .ql-editor {
    min-height: 50px !important;
    max-height: 80px !important;
    overflow-y: hidden !important;
    transition: all 0.3s ease !important;
    padding: 10px 15px !important;
}

/* توسيع المحرر عند التركيز أو التحويم */
.report-section .ql-container:hover,
.report-section .ql-container:focus-within {
    max-height: 400px !important;
}

.report-section .ql-editor:hover,
.report-section .ql-editor:focus {
    max-height: 400px !important;
    overflow-y: auto !important;
}

/* تأخير التوسيع قليلاً للتحويم */
.report-section .ql-container:hover .ql-editor,
.report-section .ql-container:focus-within .ql-editor {
    transition-delay: 0.1s;
}

/* تحديد خاص لكل محرر حسب نوعه */
#clinical-editor .ql-container:focus-within,
#clinical-editor .ql-container:hover {
    max-height: 300px !important;
}

#gross-editor .ql-container:focus-within,
#gross-editor .ql-container:hover {
    max-height: 350px !important;
}

#microscopic-editor .ql-container:focus-within,
#microscopic-editor .ql-container:hover {
    max-height: 500px !important;
}

#diagnosis-editor .ql-container:focus-within,
#diagnosis-editor .ql-container:hover {
    max-height: 200px !important;
}

/* تحسين مظهر شريط التمرير */
.report-section .ql-editor::-webkit-scrollbar {
    width: 5px;
}

.report-section .ql-editor::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

/* جعل شريط الأدوات أصغر */
.report-section .ql-toolbar {
    padding: 6px 8px !important;
    min-height: 36px !important;
}

.report-section .ql-toolbar .ql-formats {
    margin-right: 5px !important;
}

.report-section .ql-toolbar button {
    width: 24px !important;
    height: 24px !important;
    padding: 3px !important;
}

.diagnosis-cell {
    max-width: 150px;
    overflow: hidden;
    position: relative;
}

.diagnosis-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* عند المرور يتحرك النص */
.diagnosis-cell:hover .diagnosis-text {
    animation: scroll-text 5s linear infinite;
}

.diagnosis-text {
    white-space: nowrap;
    animation: scroll-text 10s linear infinite;
}

@keyframes scroll-text {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.btn-telegram_index {
    width: 50px;
    background: #0088cc;
    color: #fff;
    border-radius: 6px;
    padding: 1px;
    transition: 0.3s;
}

.btn-telegram:hover {
    background: #0077b3;
    color: #fff;
    transform: translateY(-1px);
}

.patient-name-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-ready {
    background: #2ecc71;
}

.status-not-ready {
    background: #e74c3c;
}
