/* PRO Panel - Modern Minimalist Design */

/* Reset and Base Styles */
:root {
    --vh: 1vh;
}

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

body {
    overflow-x: hidden;
}

.pro-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* Layout Container */
.pro-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Left Sidebar */
.pro-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.logo i {
    color: #3b82f6;
    font-size: 20px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 4px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0 24px 24px 0;
    margin-right: 12px;
    font-weight: 500;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.nav-item.active {
    background: #3b82f6;
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px 0;
    border-top: 1px solid #e2e8f0;
}

.account-expiry {
    padding: 12px 20px;
    margin-bottom: 8px;
    background: #f1f5f9;
    border-radius: 8px;
    margin: 0 20px 16px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.account-expiry i {
    color: #3b82f6;
}

.session-timer {
    padding: 8px 20px;
    margin: 0 20px 16px 20px;
    background: #fef3c7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
}

.session-timer i {
    color: #f59e0b;
}

.session-timer.warning {
    background: #fee2e2;
    color: #991b1b;
}

.session-timer.warning i {
    color: #dc2626;
}

.nav-item.logout {
    color: #ef4444;
}

.nav-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.mobile-nav-item.logout {
    color: #ef4444;
}

.mobile-nav-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
    transform: none;
}

.mobile-nav-item.logout {
    align-self: flex-start !important;
    justify-self: flex-start !important;
    width: auto !important;
    max-width: 55%;
    min-width: 160px;
    justify-content: flex-start;
    padding-left: 18px;
    padding-right: 14px;
    grid-column: 1;
}

@media (max-width: 480px) {
    .mobile-nav-item.logout {
        max-width: 60%;
    }
}

.mobile-nav-logout-container {
    display: flex;
    gap: 8px;
    align-items: stretch;
    grid-column: 1;
}

.mobile-nav-logout-container .mobile-nav-item.logout {
    flex: 0 0 auto;
    max-width: none;
    min-width: auto;
    width: auto;
}

.mobile-nav-expiry {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

.mobile-nav-expiry i {
    font-size: 16px;
    opacity: 0.9;
    flex-shrink: 0;
}

.mobile-nav-expiry span {
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-nav-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: stretch;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1f2937;
    font-weight: 600;
    text-align: left;
    width: 100%;
    font-size: 18px;
}

.mobile-nav-item i {
    font-size: 24px;
    width: 28px;
    text-align: center;
}

.mobile-nav-item.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
}

.pagination-info {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.pagination-controls .btn {
    min-width: 120px;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Main Content */
.pro-main {
    flex: 1;
    margin-left: 260px;
    margin-right: 320px;
    padding: 0;
    background: #ffffff;
    min-height: 100vh;
}

.pro-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1500;
    gap: 12px;
}

.topbar-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.topbar-btn:active {
    transform: scale(0.96);
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1e293b;
    font-size: 18px;
}

.topbar-title i {
    color: #3b82f6;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 1400;
}

.mobile-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.quick-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.15);
    transform: translateY(110%);
    transition: transform 0.3s ease;
    z-index: 1501;
    padding: 20px;
}

.quick-actions.open {
    transform: translateY(0);
}

.quick-actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.quick-actions-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.quick-actions-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 20px;
}

.quick-actions-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    font-weight: 500;
    color: #1e293b;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.quick-action-item i {
    color: #2563eb;
    font-size: 18px;
}

.quick-action-item:active {
    transform: scale(0.97);
}

.pro-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1500;
    display: flex;
    justify-content: space-around;
    padding: 0 8px;
    transition: transform 0.2s ease;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #475569;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
}

.bottom-nav-item i {
    font-size: 22px;
}

.bottom-nav-item.active {
    color: #2563eb;
}

body.overlay-open {
    overflow: hidden;
}

.mobile-nav-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.18);
    transform: translateY(110%);
    transition: transform 0.3s ease;
    z-index: 1501;
    padding: 20px;
    display: none;
}

.mobile-nav-sheet.open {
    display: block;
    transform: translateY(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mobile-nav-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 24px;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1f2937;
    font-weight: 600;
    text-align: left;
    font-size: 18px;
}

.mobile-nav-item i {
    font-size: 24px;
    width: 28px;
    text-align: center;
}

.mobile-nav-item.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Section Styles */
.pro-section {
    display: none;
    padding: 32px;
    min-height: 100vh;
}

.pro-section.active {
    display: block;
}

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

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

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 20px;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-content p {
    color: #64748b;
    font-size: 14px;
}

/* Chat Container */
.chat-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    height: max(360px, calc((var(--vh) * 100) - 200px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.2s ease;
}

.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr;
    height: 100%;
    gap: 24px;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-height: max(280px, calc((var(--vh) * 100) - 180px));
    transition: max-height 0.2s ease, padding 0.2s ease;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.message.user-message .message-avatar {
    background: #3b82f6; /* niebieskie tło dla awatara użytkownika */
}

.message.user-message .message-avatar i {
    color: #ffffff; /* biały symbol ludzika */
}

.message.assistant-message .message-avatar {
    background: transparent; /* brak koła, sam listek */
    width: 24px;
    height: 24px;
    border-radius: 0;
}

.message.assistant-message .message-avatar i {
    color: #64748b; /* stonowany kolor listka jak w logo */
    font-size: 18px;
}

.message-content {
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
}

.message.user-message .message-content {
    background: #3b82f6;
    color: white;
}

/* Wymuszenie białego koloru tekstu i czasu w dymku użytkownika */
.message.user-message .message-content p {
    color: #ffffff !important;
}
.message.user-message .message-time {
    color: rgba(255, 255, 255, 0.9) !important;
}

.message-content p {
    margin: 0 0 0.25rem 0;
    font-size: 14px;
    line-height: 1.5;
}

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

/* Code formatting */
.message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
}

.message.user-message .message-content code {
    background: rgba(255, 255, 255, 0.2);
}

.message-content pre {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    word-wrap: break-word;
}

.message.user-message .message-content pre {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.message-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 1em;
    line-height: 1.5;
}

/* List formatting */
.message-content .message-list {
    margin: 0.4rem 0;
    padding-left: 1.5rem;
}

.message-content .message-list:first-child {
    margin-top: 0;
}

.message-content .message-list:last-child {
    margin-bottom: 0;
}

.message-content .message-list li {
    margin: 0.2rem 0;
    font-size: 14px;
    line-height: 1.5;
}

.message-content ol.message-list {
    list-style-type: decimal;
}

.message-content ul.message-list {
    list-style-type: disc;
}

/* Text formatting */
.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

/* Chat Input */

/* Chat Input Styles - copied from Basic style.css */
.input-area {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
    transition: padding-bottom 0.2s ease;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 1.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    max-width: 800px;
    width: 100%;
}

.input-container:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#messageInput {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 24px;
    max-height: 120px;
    padding: 0.5rem 0;
    color: #374151;
}

#messageInput::placeholder {
    color: #9ca3af;
}

.send-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

.input-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    max-width: 800px;
    width: 100%;
    padding: 0 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#generateChatPDF {
    padding: 4px 8px;
    font-size: 11px;
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

#generateChatPDF:hover {
    background: #dc2626;
    border-color: #dc2626;
}



/* Buttons */
.btn {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-pdf {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-pdf:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Search and Forms */
.search-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.search-input.large {
    padding: 16px 20px;
    font-size: 16px;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Client Cards */
.clients-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.client-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.client-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.client-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.client-info p {
    color: #64748b;
    font-size: 14px;
}

.client-actions {
    display: flex;
    gap: 8px;
}

.client-actions [data-action="pdf"] {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.client-actions [data-action="pdf"]:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Notes */
.notes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.notes-filters {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.note-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.note-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.note-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.note-date {
    color: #64748b;
    font-size: 12px;
}

.note-preview p {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

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

.tag {
    padding: 4px 8px;
    background: #f1f5f9;
    color: #3b82f6;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Search Results */
.search-form {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.search-results {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-placeholder {
    color: #64748b;
    font-style: italic;
}

/* Settings */
.settings-content {
    max-width: 600px;
}

.settings-group {
    margin-bottom: 32px;
}

.settings-group h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.setting-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Right Sidebar - AI Notes */
.pro-sidebar-right {
    width: 320px;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    position: fixed;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

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

.notes-sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.ai-notes-list {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-note-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-note-item:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
}

.note-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.note-summary {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.4;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-confidence {
    background: #dcfce7;
    color: #166534;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* Note Preview Modal */
.note-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background: #f1f5f9;
}

.modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Mobile Topbar */
.pro-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px;
    z-index: 1000;
}

/* Mobile Overlay */
.pro-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Quick Actions */
.quick-actions {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 12px;
    z-index: 1000;
}

/* Bottom Nav */
.pro-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 12px;
    z-index: 1000;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .pro-main {
        margin-right: 0;
    }
}

@media (max-width: 1024px) {
    .pro-topbar {
        display: flex;
    }

    .pro-main {
        margin-left: 260px;
        padding-top: 60px;
    }

    .pro-sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .pro-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .pro-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .pro-main {
        margin-left: 0;
        padding-top: 60px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
    
    .pro-topbar {
        padding: 12px 16px;
        gap: 12px;
    }

    .pro-topbar .topbar-title {
        gap: 8px;
        font-size: 16px;
    }

    .pro-topbar .topbar-btn {
        display: none !important;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .notes-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .pro-bottom-nav {
        display: flex;
    }

    .quick-actions-list {
        grid-template-columns: 1fr;
    }

    .chat-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
        height: max(320px, calc((var(--vh) * 100) - 140px));
    }

    .chat-messages {
        padding: 20px 16px 12px;
        max-height: max(220px, calc((var(--vh) * 100) - 220px));
    }

    .input-area {
        padding: 1rem 1.25rem;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, #ffffff 35%);
    }

    .chat-input-focused .pro-bottom-nav {
        transform: translateY(100%);
    }

    .chat-input-focused .quick-actions {
        transform: translateY(110%);
    }

    .chat-input-focused .input-area {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 12px));
    }

    .chat-input-focused .chat-container {
        height: max(320px, calc((var(--vh) * 100) - 110px));
    }

    .chat-input-focused .chat-messages {
        max-height: max(220px, calc((var(--vh) * 100) - 180px));
        padding-bottom: 16px;
    }

    .client-chat-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

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

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .section-header h1 {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pro-section {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .client-card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .client-actions {
        justify-content: flex-start;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animation for smooth transitions */
.pro-section {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Focus states for accessibility */
.nav-item:focus,
.btn:focus,
.search-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Compare Drugs Section */
.compare-content {
    max-width: 800px;
}

.compare-form {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.drug-selector {
    margin-bottom: 20px;
}

.drug-selector label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.drug-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.drug-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comparison-results {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    min-height: 200px;
}

.comparison-placeholder {
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Cross Search Section */
.cross-search-content {
    max-width: 900px;
}

.cross-search-form {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.search-criteria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.criteria-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.criteria-input,
.criteria-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.criteria-input:focus,
.criteria-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cross-search-results {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    min-height: 300px;
}

.cross-search-placeholder {
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Chat Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #64748b;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Error Message Styles */
.error-message {
    border-left: 4px solid #ef4444;
}

.error-message .message-content {
    background-color: #fef2f2;
}

.error-message .message-content p {
    color: #dc2626;
}

/* Session Summary Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9000;
    pointer-events: none;
}

.modal-dialog {
    position: relative;
    z-index: 9001;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
    pointer-events: auto;
}

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

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: #6366f1;
}

.modal-header .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #64748b;
    font-size: 20px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-header .close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 24px;
}

.modal-description {
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.6;
}

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

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

.form-group .input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-group .input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f8fafc;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    accent-color: #6366f1;
    margin: 0;
    appearance: auto;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
}

.checkbox-label input[type="checkbox"]:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    flex-shrink: 0;
}

.checkbox-label .checkbox-text {
    color: #475569;
    font-size: 14px;
    user-select: none;
    cursor: pointer;
}

.checkbox-label:hover .checkbox-text {
    color: #1e293b;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.summary-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.summary-status i {
    font-size: 16px;
}

.summary-status--loading {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.summary-status--message {
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #1e293b;
}

.summary-status--message.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.6;
}

.summary-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
}

.summary-section h4 {
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1d4ed8;
}

.summary-section ul {
    padding-left: 18px;
    margin: 8px 0 0;
    list-style: disc;
}

.summary-section li {
    margin-bottom: 6px;
}

.summary-section p {
    margin-bottom: 8px;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #64748b;
    text-align: left;
}

.option-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.option-toggle.active {
    background: #eff6ff;
    border-color: #6366f1;
    color: #1e293b;
}

.option-toggle i {
    font-size: 18px;
    color: #cbd5e1;
    transition: color 0.2s;
}

.option-toggle.active i {
    color: #6366f1;
}

.option-toggle span {
    flex: 1;
    font-weight: 500;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
}

.alert-info i {
    color: #3b82f6;
    margin-top: 2px;
}

.alert-info span {
    color: #1e40af;
    font-size: 14px;
    line-height: 1.5;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Button in section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h1 {
    margin: 0;
}

.client-chat-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.client-chat-actions .btn {
    white-space: nowrap;
}

.btn-secondary {
    background: #ffffff;
    color: #6366f1;
    border: 1px solid #6366f1;
}

.btn-secondary:hover {
    background: #6366f1;
    color: #ffffff;
}

.btn-secondary i {
    margin-right: 8px;
}

/* Chat Search Styles */
.search-highlight {
    background-color: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.current-search-result {
    background-color: #dbeafe !important;
    border-left: 3px solid #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

mark {
    background-color: #fde047;
    color: #000;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 500;
}