/* ============================================
   VETSUMMARIZER - EXACT DESIGN MATCH
   Based on React/TypeScript design reference
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(to bottom right, #f8fafc 0%, rgba(224, 231, 255, 0.3) 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

#app {
    min-height: 100vh;
    display: flex;
}

/* ============================================
   SIDEBAR - EXACT DESIGN
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 256px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(to bottom right, #06b6d4 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(to right, #0891b2 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.logo-text p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link svg {
    width: 20px;
    height: 20px;
}

.nav-link:hover {
    background: rgba(241, 245, 249, 0.5);
}

.nav-link.active {
    background: linear-gradient(to right, rgba(6, 182, 212, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #0891b2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.api-cost {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-content {
    margin-left: 256px;
    min-height: 100vh;
    width: calc(100% - 256px);
    padding: 32px;
    max-width: 1600px;
}

/* ============================================
   PAGE HEADERS
   ============================================ */

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 30px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.page-header p {
    color: #64748b;
    font-size: 16px;
}

/* ============================================
   GLASSMORPHISM CARDS
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
}

.glass-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    transition: all 0.3s;
}

/* Patient History Specific Styles */
.patient-card {
    margin-bottom: 0;
}

.patient-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(to bottom right, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.patient-details {
    min-height: auto;
}

.diagnosis-section {
    margin-top: 16px;
}

.view-record-btn {
    margin-top: 16px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 9999px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    flex-shrink: 0;
    white-space: nowrap;
}

.status-badge.status-active {
    background: linear-gradient(to right, #10b981, #14b8a6);
}

.status-badge.status-follow-up {
    background: linear-gradient(to right, #f97316, #fbbf24);
}

.status-badge.status-resolved {
    background: linear-gradient(to right, #94a3b8, #64748b);
}

.patient-records-grid {
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
}

@media (min-width: 1024px) {
    .patient-records-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.patient-records-grid .patient-card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.patient-records-grid .view-record-btn {
    margin-top: auto;
    width: 100%;
    padding: 8px 16px;
    background: linear-gradient(to right, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
    border: none;
    border-radius: 12px;
    font-weight: 500;
    color: #0891b2;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.patient-records-grid .view-record-btn:hover {
    background: linear-gradient(to right, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
}

.patient-records-grid .view-record-btn svg {
    width: 16px;
    height: 16px;
}

/* Search and Filter Styles */
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    color: #1e293b;
}

.search-input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.search-input::placeholder {
    color: #94a3b8;
}

.filter-btn {
    padding: 12px 24px;
    background: #f1f5f9;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #e2e8f0;
}

.filter-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   ANALYTICS PAGE SPECIFIC STYLES
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    margin-bottom: 0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon-0 {
    background: linear-gradient(to bottom right, #06b6d4, #3b82f6);
}

.stat-icon-1 {
    background: linear-gradient(to bottom right, #10b981, #14b8a6);
}

.stat-icon-2 {
    background: linear-gradient(to bottom right, #8b5cf6, #a855f7);
}

.stat-icon-3 {
    background: linear-gradient(to bottom right, #f97316, #ec4899);
}

.stat-change {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.stat-change.change-positive {
    background: #d1fae5;
    color: #065f46;
}

.stat-change.change-negative {
    background: #dbeafe;
    color: #1e40af;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 32px;
}

@media (min-width: 1024px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.chart-card {
    margin-bottom: 0;
}

.chart-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.chart-icon svg {
    width: 24px;
    height: 24px;
}

.chart-icon-cyan {
    background: linear-gradient(to bottom right, #06b6d4, #8b5cf6);
}

.chart-icon-emerald {
    background: linear-gradient(to bottom right, #10b981, #14b8a6);
}

.chart-icon-violet {
    background: linear-gradient(to bottom right, #8b5cf6, #a855f7);
}

.chart-icon-orange {
    background: linear-gradient(to bottom right, #f97316, #ec4899);
}

.chart-container {
    position: relative;
    width: 100%;
}

.specialty-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.specialty-legend {
    margin-top: 16px;
}

.model-usage-list {
    margin-top: 0;
}

.model-usage-item {
    margin-bottom: 16px;
}

.model-usage-item:last-child {
    margin-bottom: 0;
}

.progress-bar-container {
    height: 8px;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s ease-out;
}

.progress-bar-0 {
    background: linear-gradient(to right, #10b981, #14b8a6);
}

.progress-bar-1 {
    background: linear-gradient(to right, #f97316, #ef4444);
}

.progress-bar-2 {
    background: linear-gradient(to right, #3b82f6, #6366f1);
}

.progress-bar-3 {
    background: linear-gradient(to right, #8b5cf6, #a855f7);
}

.ml-auto {
    margin-left: auto;
}

/* ============================================
   SETTINGS PAGE SPECIFIC STYLES
   ============================================ */

.settings-card {
    margin-bottom: 0;
}

.settings-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.settings-icon svg {
    width: 24px;
    height: 24px;
}

.settings-icon-cyan {
    background: linear-gradient(to bottom right, #06b6d4, #8b5cf6);
}

.settings-icon-emerald {
    background: linear-gradient(to bottom right, #10b981, #14b8a6);
}

.settings-icon-violet {
    background: linear-gradient(to bottom right, #8b5cf6, #a855f7);
}

.settings-icon-orange {
    background: linear-gradient(to bottom right, #f97316, #ec4899);
}

.settings-icon-red {
    background: linear-gradient(to bottom right, #ef4444, #ec4899);
}

.preference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
}

.model-select {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
}

.model-select:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.info-box {
    padding: 16px;
    border-radius: 12px;
    border-width: 1px;
    border-style: solid;
}

.info-box-blue {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.info-box-blue p {
    color: #1e3a8a;
}

.info-box-emerald {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.info-box-emerald p {
    color: #065f46;
}

.check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.check-icon svg {
    width: 16px;
    height: 16px;
}

.settings-action-btn {
    width: 100%;
    padding: 12px 0;
    background: #f1f5f9;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s;
    cursor: pointer;
}

.settings-action-btn:hover {
    background: #e2e8f0;
}

.save-settings-btn {
    width: 100%;
    padding: 16px 0;
    background: linear-gradient(to right, #06b6d4, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.save-settings-btn:hover {
    background: linear-gradient(to right, #0891b2, #7c3aed);
    box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3);
    transform: translateY(-2px);
}

.save-settings-btn svg {
    width: 20px;
    height: 20px;
}

.w-10 {
    width: 40px;
}

.h-10 {
    height: 40px;
}

.w-12 {
    width: 48px;
}

.h-12 {
    height: 48px;
}

.w-3 {
    width: 12px;
}

.h-3 {
    height: 12px;
}

.w-6 {
    width: 24px;
}

.h-6 {
    height: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(to bottom right, #06b6d4 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    color: #1e293b;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

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

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

.btn {
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(to right, #06b6d4 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(to right, #0891b2 0%, #7c3aed 100%);
    box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
    display: grid;
    gap: 24px;
}

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

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

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive grid - lg breakpoint */
@media (min-width: 1024px) {
    .patient-records-grid.grid-cols-1.lg\:grid-cols-2,
    .patient-records-grid[class*="lg:grid-cols-2"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   SOAP NOTE SECTIONS
   ============================================ */

.soap-section {
    margin-top: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.soap-section:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* SOAP Note Formatted Content */
.soap-content-formatted {
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    min-height: 120px;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #475569;
    line-height: 1.7;
    font-size: 14px;
}

.soap-content-formatted p {
    margin-bottom: 12px;
    color: #475569;
}

.soap-content-formatted p:last-child {
    margin-bottom: 0;
}

.soap-content-formatted strong {
    font-weight: 600;
    color: #1e293b;
}

.soap-content-formatted em {
    font-style: italic;
    color: #64748b;
}

.soap-content-formatted ul,
.soap-content-formatted ol {
    margin: 12px 0;
    padding-left: 24px;
    color: #475569;
}

.soap-content-formatted li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.soap-content-formatted h1,
.soap-content-formatted h2,
.soap-content-formatted h3,
.soap-content-formatted h4 {
    margin-top: 16px;
    margin-bottom: 12px;
    color: #1e293b;
    font-weight: 600;
}

.soap-content-formatted h1 {
    font-size: 20px;
}

.soap-content-formatted h2 {
    font-size: 18px;
}

.soap-content-formatted h3 {
    font-size: 16px;
}

.soap-content-formatted h4 {
    font-size: 14px;
}

.soap-content-formatted code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.soap-content-formatted pre {
    background: #f1f5f9;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.soap-content-formatted pre code {
    background: transparent;
    padding: 0;
}

.soap-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.soap-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.soap-icon.subjective {
    background: linear-gradient(to bottom right, #06b6d4 0%, #3b82f6 100%);
}

.soap-icon.objective {
    background: linear-gradient(to bottom right, #8b5cf6 0%, #a855f7 100%);
}

.soap-icon.assessment {
    background: linear-gradient(to bottom right, #10b981 0%, #14b8a6 100%);
}

.soap-icon.plan {
    background: linear-gradient(to bottom right, #f59e0b 0%, #ec4899 100%);
}

.soap-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 768px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    z-index: 10001;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

/* Modal Title and Icons */
.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.modal-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
    margin: 0;
}

.modal-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-title-icon-email {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

.modal-title-icon-discharge {
    background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
}

.modal-title-icon-svg {
    width: 24px;
    height: 24px;
    color: white;
    stroke-width: 2;
}

.modal-loading-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
    color: #06b6d4;
    display: block;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 180px);
}

/* Ensure content in modals is not truncated */
.modal-body pre,
.modal-body .discharge-content {
    max-height: none;
    overflow: visible;
}

.modal-body .bg-slate-50 {
    max-height: none;
    overflow: visible;
}

/* Formatted content styling */
.email-content-formatted {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #475569;
    line-height: 1.7;
    font-size: 14px;
}

.email-content-formatted p {
    margin-bottom: 12px;
}

.email-content-formatted strong {
    font-weight: 600;
    color: #1e293b;
}

.email-content-formatted ul,
.email-content-formatted ol {
    margin: 12px 0;
    padding-left: 24px;
}

.email-content-formatted li {
    margin-bottom: 8px;
}

.email-content-formatted h1,
.email-content-formatted h2,
.email-content-formatted h3 {
    margin-top: 20px;
    margin-bottom: 12px;
    color: #1e293b;
    font-weight: 600;
}

.discharge-item-formatted {
    margin-bottom: 12px;
    line-height: 1.7;
}

.discharge-item-formatted p {
    margin-bottom: 8px;
}

.discharge-item-formatted strong {
    font-weight: 600;
    color: #1e293b;
}

.discharge-item-formatted ul,
.discharge-item-formatted ol {
    margin: 8px 0;
    padding-left: 20px;
}

.discharge-item-formatted li {
    margin-bottom: 6px;
}

.discharge-item-text {
    line-height: 1.7;
}

.discharge-section-content {
    margin-top: 12px;
}

/* Discharge Modal Styles */
.discharge-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.discharge-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.discharge-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.discharge-section-number {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.discharge-section-content-formatted {
    color: #475569;
    line-height: 1.8;
    font-size: 15px;
}

.discharge-section-content-formatted p {
    margin-bottom: 12px;
    color: #475569;
}

.discharge-section-content-formatted p:last-child {
    margin-bottom: 0;
}

.discharge-section-content-formatted strong {
    font-weight: 600;
    color: #1e293b;
}

.discharge-section-content-formatted em {
    font-style: italic;
    color: #64748b;
}

.discharge-section-content-formatted ul,
.discharge-section-content-formatted ol {
    margin: 12px 0;
    padding-left: 24px;
    color: #475569;
}

.discharge-section-content-formatted li {
    margin-bottom: 10px;
    line-height: 1.8;
    color: #475569;
}

.discharge-section-content-formatted li:last-child {
    margin-bottom: 0;
}

.discharge-section-content-formatted h1,
.discharge-section-content-formatted h2,
.discharge-section-content-formatted h3,
.discharge-section-content-formatted h4 {
    margin-top: 20px;
    margin-bottom: 12px;
    color: #1e293b;
    font-weight: 600;
}

.discharge-section-content-formatted h1 {
    font-size: 22px;
}

.discharge-section-content-formatted h2 {
    font-size: 20px;
}

.discharge-section-content-formatted h3 {
    font-size: 18px;
}

.discharge-section-content-formatted h4 {
    font-size: 16px;
}

.discharge-section-content-formatted code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #1e293b;
}

.discharge-section-content-formatted pre {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid #e2e8f0;
}

.discharge-section-content-formatted pre code {
    background: transparent;
    padding: 0;
}

.discharge-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.discharge-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #475569;
    line-height: 1.6;
    font-size: 14px;
}

.discharge-bullet {
    color: #f97316;
    font-weight: bold;
    margin-top: 4px;
    flex-shrink: 0;
}

.discharge-emergency {
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
}

.discharge-emergency-text {
    font-size: 14px;
    color: #92400e;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
}

.discharge-emergency-text strong {
    color: #78350f;
}

.discharge-loading {
    text-align: center;
    padding: 48px 20px;
}

.discharge-loading-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
    color: #f97316;
}

.discharge-loading-text {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-footer-flex {
    display: flex;
    gap: 12px;
}

/* Modal Action Buttons */
.modal-action-btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-action-btn-flex {
    flex: 1;
}

.modal-action-btn-primary {
    background: linear-gradient(to right, #06b6d4 0%, #8b5cf6 100%);
    color: white;
}

.modal-action-btn-primary:hover:not(:disabled) {
    background: linear-gradient(to right, #0891b2 0%, #7c3aed 100%);
    box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3);
    transform: translateY(-2px);
}

.modal-action-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.modal-action-btn-secondary {
    background: linear-gradient(to right, #475569 0%, #334155 100%);
    color: white;
}

.modal-action-btn-secondary:hover:not(:disabled) {
    background: linear-gradient(to right, #334155 0%, #1e293b 100%);
    box-shadow: 0 10px 20px rgba(71, 85, 105, 0.3);
    transform: translateY(-2px);
}

.modal-action-btn-secondary:active:not(:disabled) {
    transform: translateY(0);
}

.modal-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.modal-btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Modal Close Button */
.modal-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f1f5f9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

.modal-close-icon {
    width: 20px;
    height: 20px;
    color: #475569;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-8 {
    margin-bottom: 32px;
}

.mt-4 {
    margin-top: 16px;
}

.text-sm {
    font-size: 14px;
}

.text-lg {
    font-size: 18px;
}

.text-xl {
    font-size: 20px;
}

.text-2xl {
    font-size: 24px;
}

.text-3xl {
    font-size: 30px;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-slate-500 {
    color: #64748b;
}

.text-slate-600 {
    color: #475569;
}

.text-slate-700 {
    color: #334155;
}

.text-slate-800 {
    color: #1e293b;
}

.text-white {
    color: white;
}

.w-full {
    width: 100%;
}

.w-4 {
    width: 16px;
}

.w-5 {
    width: 20px;
}

.w-16 {
    width: 64px;
}

.h-4 {
    height: 16px;
}

.h-5 {
    height: 20px;
}

.h-16 {
    height: 64px;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-3xl {
    max-width: 48rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.text-center {
    text-align: center;
}

.cursor-pointer {
    cursor: pointer;
}

.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

.group:hover .group-hover\:text-cyan-600,
.patient-card.group:hover h3 {
    color: #0891b2;
}

.border-2 {
    border-width: 2px;
}

.border-dashed {
    border-style: dashed;
}

.border-slate-300 {
    border-color: #cbd5e1;
}

.p-4 {
    padding: 16px;
}

.p-6 {
    padding: 24px;
}

.p-8 {
    padding: 32px;
}

.p-12 {
    padding: 48px;
}

.px-4 {
    padding-left: 16px;
    padding-right: 16px;
}

.py-2 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.py-3 {
    padding-top: 12px;
    padding-bottom: 12px;
}

.py-4 {
    padding-top: 16px;
    padding-bottom: 16px;
}

.rounded-xl {
    border-radius: 12px;
}

.rounded-2xl {
    border-radius: 16px;
}

.rounded-full {
    border-radius: 9999px;
}

.leading-relaxed {
    line-height: 1.625;
}

.whitespace-pre-wrap {
    white-space: pre-wrap;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.hover\:bg-slate-100:hover {
    background-color: #f1f5f9;
}

.hover\:bg-slate-200:hover {
    background-color: #e2e8f0;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.capitalize {
    text-transform: capitalize;
}

.flex-1 {
    flex: 1 1 0%;
}

.justify-center {
    justify-content: center;
}

.items-start {
    align-items: flex-start;
}

.bg-slate-50 {
    background-color: #f8fafc;
}

.bg-slate-100 {
    background-color: #f1f5f9;
}

.bg-emerald-50 {
    background-color: #ecfdf5;
}

.bg-yellow-50 {
    background-color: #fefce8;
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.border-emerald-200 {
    border-color: #a7f3d0;
}

.border-yellow-200 {
    border-color: #fde047;
}

.border-blue-200 {
    border-color: #bfdbfe;
}

.text-emerald-800 {
    color: #065f46;
}

.text-emerald-900 {
    color: #064e3b;
}

.text-yellow-900 {
    color: #713f12;
}

.text-blue-900 {
    color: #1e3a8a;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

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

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

.model-btn {
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    background: #f1f5f9;
    color: #334155;
}

.model-btn:hover {
    background: #e2e8f0;
}

.model-btn.active {
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.model-btn[data-color="from-emerald-500 to-teal-500"].active {
    background: linear-gradient(to right, #10b981 0%, #14b8a6 100%);
}

.model-btn[data-color="from-orange-500 to-red-500"].active {
    background: linear-gradient(to right, #f97316 0%, #ef4444 100%);
}

.model-btn[data-color="from-blue-500 to-indigo-500"].active {
    background: linear-gradient(to right, #3b82f6 0%, #6366f1 100%);
}

.model-btn[data-color="from-violet-500 to-purple-500"].active {
    background: linear-gradient(to right, #8b5cf6 0%, #a855f7 100%);
}

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

/* Quick Actions Buttons */
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.action-btn:hover {
    background: rgba(241, 245, 249, 0.6);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.action-btn:hover .action-icon-wrapper {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.action-icon-export {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
}

.action-icon-email {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}

.action-icon-discharge {
    background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
}

.action-icon-wrapper svg {
    width: 24px;
    height: 24px;
    color: white;
    stroke-width: 2;
}

.action-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    text-align: center;
}

/* ============================================
   VOICE RECORDING
   ============================================ */

#voiceRecordBtn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    background: linear-gradient(to bottom right, #06b6d4 0%, #8b5cf6 100%);
}

#voiceRecordBtn:hover {
    transform: scale(1.1);
}

#voiceRecordBtn.recording {
    background: linear-gradient(to bottom right, #ef4444 0%, #ec4899 100%);
    animation: pulse 2s infinite;
}

.recording-bar {
    height: 16px;
    width: 4px;
    background: white;
    border-radius: 2px;
    animation: recordingWave 0.6s infinite;
}

@keyframes recordingWave {
    0%, 100% { height: 8px; }
    50% { height: 16px; }
}

/* ============================================
   TOGGLE SWITCHES
   ============================================ */

.toggle-switch {
    position: relative;
    width: 56px;
    height: 32px;
    border-radius: 9999px;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.on {
    background: linear-gradient(to right, #06b6d4 0%, #8b5cf6 100%);
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch.on .toggle-slider {
    left: 28px;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card {
    animation: fadeIn 0.3s ease-out;
}

.glass-card[style*="animation-delay"] {
    animation: fadeIn 0.3s ease-out;
}

/* ============================================
   SPACING UTILITIES
   ============================================ */

.space-y-2 > * + * {
    margin-top: 8px;
}

.space-y-4 > * + * {
    margin-top: 16px;
}

.space-y-6 > * + * {
    margin-top: 24px;
}

.space-y-8 > * + * {
    margin-top: 32px;
}

/* ============================================
   POSITION UTILITIES
   ============================================ */

.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

.fixed {
    position: fixed;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.top-1\/2 {
    top: 50%;
}

.-translate-y-1\/2 {
    transform: translateY(-50%);
}

.bottom-4 {
    bottom: 16px;
}

.right-4 {
    right: 16px;
}

.bottom-20 {
    bottom: 80px;
}

.left-4 {
    left: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
        width: 100%;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .xl\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
}
