:root {
    --primary: #8B1538; /* Burgundy */
    --primary-light: #a91d47;
    --primary-dark: #6d102c;
    --accent-blue: #2563eb; /* Blue for accents */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --error: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #9ca3af;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --bg-light: #f8f9fa;
    --bg-hover: #f1f5f9;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-muted: #6b7280;
    --radius: 10px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --transition: all 0.2s ease;
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Inter', "Segoe UI", system-ui, sans-serif;
    background: #e5e7eb;
    color: #1f2937;
    line-height: 1.4;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 12px 14px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.pharmacy-row { display: flex; justify-content: space-between; align-items: center; }
.pharmacy-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
#workstationName { font-size: 10px; opacity: 0.85; margin-top: 4px; font-weight: 500; }
.status-area { display: flex; align-items: center; gap: 12px; }
.status-col { display: flex; flex-direction: column; gap: 3px; text-align: right; font-size: 10px; }
.status-row { display: flex; align-items: center; gap: 5px; }
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239,68,68,0.7);
    animation: pulse-red 2s ease-in-out infinite;
}
.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34,197,94,0.7);
    animation: pulse-green 2s ease-in-out infinite;
}
.connect-btn {
    background: rgba(255,255,255,0.25);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.connect-btn:hover {
    background: rgba(255,255,255,0.35);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,0.7); }
    50% { box-shadow: 0 0 12px rgba(239,68,68,0.9); }
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 8px rgba(34,197,94,0.7); }
    50% { box-shadow: 0 0 12px rgba(34,197,94,0.9); }
}

/* Agent Menu */
.agent-menu {
    position: absolute;
    top: 100%;
    right: 10px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    overflow: hidden;
    display: none;
    z-index: 1000;
    margin-top: 4px;
}
.agent-menu.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.agent-menu-header {
    background: var(--primary);
    color: white;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 12px;
}
.agent-menu-item {
    padding: 12px 14px;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}
.agent-menu-item:hover {
    background: var(--gray-100);
    padding-left: 18px;
}

/* Screen Tabs */
.screen-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 10px 6px;
    background: var(--primary);
    overflow-x: auto;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.screen-tab {
    padding: 7px 11px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    border-radius: 8px 8px 0 0;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.screen-tab.active {
    background: white;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.screen-tab:hover:not(.active) {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}
.tab-refresh {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 10px;
    opacity: 0.7;
    transition: var(--transition);
}
.tab-refresh:hover {
    opacity: 1;
    transform: rotate(180deg);
}

/* NDC Alert */
.ndc-alert {
    margin: 8px 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #28a745;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #155724;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2);
    animation: slideIn 0.3s ease-out;
}
.copy-ndc {
    background: #28a745;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 10px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.copy-ndc:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.copy-ndc:active {
    transform: translateY(0);
}

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

/* Sections Wrapper */
.sections-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px 10px;
}

/* Section Base */
.section {
    background: white;
    border-radius: var(--radius);
    margin-bottom: 7px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
}
.section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}
.section-header {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--gray-100);
    transition: background 0.2s ease;
}
.section-header:hover {
    background: var(--gray-200);
}
.section-title {
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-800);
}
.section-summary {
    font-size: 11px;
    color: var(--gray-600);
    margin-left: auto;
    margin-right: 10px;
    font-weight: 500;
}
.section-toggle {
    font-size: 11px;
    transition: transform 0.3s ease;
    color: var(--gray-500);
}
.section.expanded .section-toggle {
    transform: rotate(180deg);
}
.section-body {
    padding: 0 14px 14px;
    display: none;
    animation: fadeIn 0.3s ease-out;
}
.section.expanded .section-body {
    display: block;
}

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

/* Patient Header */
.patient-header { background: linear-gradient(135deg, #fdf2f5 0%, #fce8ee 100%); padding: 14px; margin: -14px -14px 12px -14px; }
.patient-name { font-size: 17px; font-weight: 800; color: var(--primary); }
.patient-meta { font-size: 10px; color: var(--gray-600); margin-top: 3px; display: flex; gap: 12px; }

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.info-item {
    background: var(--gray-100);
    padding: 10px;
    border-radius: 8px;
    transition: var(--transition);
}
.info-item:hover {
    background: var(--gray-200);
}
.info-label {
    font-size: 10px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}
.info-value {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-800);
}
.info-value.phone {
    color: #2563eb;
    cursor: pointer;
    transition: var(--transition);
}
.info-value.phone:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
.info-value.clickable {
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}
.info-value.clickable:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.btn:active {
    transform: translateY(0);
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-light);
}
.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}
.btn-secondary:hover {
    background: var(--gray-300);
}
.patient-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

/* Stats Grid */
#dashboardSection .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}
.stat-item {
    background: var(--gray-100);
    padding: 10px 6px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-item:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.stat-item.has-alert {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
}
.stat-item.has-alert .stat-value {
    color: #d97706;
}
/* AI Calls stat highlight */
.ai-calls-stat {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    border: 1px solid #93c5fd;
}
.ai-calls-stat:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%) !important;
}
.ai-calls-stat .stat-value {
    color: #1d4ed8;
}
.stat-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    display: block;
    line-height: 1.1;
}
.stat-label {
    font-size: 9px;
    color: var(--gray-600);
    margin-top: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

/* Documents Stats Section */
.docs-stats-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.2s ease;
}
.docs-stats-section:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    box-shadow: 0 3px 8px rgba(14, 165, 233, 0.2);
}
.docs-stats-header {
    font-size: 11px;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.docs-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.docs-stat {
    text-align: center;
    padding: 6px 4px;
    border-radius: 6px;
    background: white;
}
.docs-stat.up-to-date { border-left: 3px solid #10b981; }
.docs-stat.near-expiry { border-left: 3px solid #f59e0b; }
.docs-stat.expired { border-left: 3px solid #ef4444; }
.docs-stat.missing { border-left: 3px solid #6b7280; }
.docs-stat-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
}
.docs-stat.up-to-date .docs-stat-value { color: #10b981; }
.docs-stat.near-expiry .docs-stat-value { color: #f59e0b; }
.docs-stat.expired .docs-stat-value { color: #ef4444; }
.docs-stat.missing .docs-stat-value { color: #6b7280; }
.docs-stat-label {
    display: block;
    font-size: 8px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-top: 2px;
}

/* Chat Bar */
.chat-bar {
    flex-shrink: 0;
    background: white;
    border-top: 2px solid var(--primary);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
}
.chat-tabs {
    display: flex;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
}
.chat-tab {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--gray-600);
    transition: all 0.2s ease;
    position: relative;
}
.chat-tab:hover:not(.active) {
    background: var(--gray-200);
    color: var(--gray-800);
}
.chat-tab.active {
    background: white;
    color: var(--primary);
}
.chat-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}
.chat-channels {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    background: var(--gray-100);
    overflow-x: auto;
}
.chat-channel {
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.chat-channel:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.chat-channel.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.chat-messages {
    height: 80px;
    overflow-y: auto;
    padding: 10px;
    font-size: 11px;
    background: #fafafa;
}
.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: white;
    border-top: 1px solid var(--gray-200);
}
.chat-input-row input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 11px;
    transition: border-color 0.2s ease;
}
.chat-input-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.1);
}
.chat-input-row button {
    padding: 9px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.chat-input-row button:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.chat-input-row button:active {
    transform: translateY(0);
}

/* Toast */
.toast { position: fixed; bottom: 200px; left: 50%; transform: translateX(-50%); background: #1f2937; color: white; padding: 10px 20px; border-radius: 50px; font-size: 12px; box-shadow: var(--shadow-md); z-index: 1000; opacity: 0; transition: all 0.3s ease; }
.toast.show { opacity: 1; }

/* Screen tab states */
.screen-tab.has-data {
    background: var(--success-light, #dcfce7);
    border-color: var(--success, #22c55e);
}

.screen-tab.focused {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.screen-tab .tab-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    margin-right: 4px;
}

.screen-tab.focused .tab-indicator {
    background: white;
    color: var(--primary);
}

/* Delivery Section */
.delivery-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.delivery-stats {
    display: flex;
    justify-content: space-between;
    background: #f3f4f6;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.stat-mini {
    text-align: center;
    font-size: 12px;
}

.stat-mini span {
    font-weight: 600;
    font-size: 16px;
    display: block;
}

.delivery-list {
    max-height: 300px;
    overflow-y: auto;
}

.delivery-item {
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.delivery-item:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.delivery-item.completed {
    border-left: 3px solid #22c55e;
}

.delivery-item.pending {
    border-left: 3px solid #f59e0b;
}

.delivery-item.failed {
    border-left: 3px solid #ef4444;
}

.delivery-name {
    font-weight: 600;
    font-size: 13px;
}

.delivery-address {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.delivery-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: #888;
}

.delivery-driver {
    color: var(--primary);
}

.delivery-status {
    font-weight: 500;
}

.delivery-status.success { color: #22c55e; }
.delivery-status.pending { color: #f59e0b; }
.delivery-status.fail { color: #ef4444; }

.delivery-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.delivery-actions button {
    flex: 1;
    padding: 4px 8px;
    font-size: 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.delivery-actions button:hover {
    background: #f3f4f6;
}

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

.delivery-modal.show {
    display: flex;
}

.delivery-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
}

.delivery-modal img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

/* Calendar Widget */
.calendar-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 15px;
    color: white;
    margin-bottom: 12px;
}

.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cal-nav-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.cal-nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.cal-month-year {
    font-weight: 600;
    font-size: 15px;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 10px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.cal-day:hover {
    background: rgba(255,255,255,0.2);
}

.cal-day.other-month {
    opacity: 0.4;
}

.cal-day.today {
    background: white;
    color: #667eea;
    font-weight: 700;
}

.cal-day.selected {
    background: rgba(255,255,255,0.3);
    font-weight: 600;
}

.cal-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: #fbbf24;
    border-radius: 50%;
}

.cal-day.has-deliveries::after {
    background: #22c55e;
}

/* Calendar Events */
.cal-events {
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
}

.cal-events-header {
    background: #e2e8f0;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 12px;
    color: #475569;
}

.cal-events-list {
    padding: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.cal-no-events {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 15px;
}

.cal-event-item {
    display: flex;
    align-items: flex-start;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: white;
    border-left: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.2s;
}

.cal-event-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cal-event-item.delivery {
    border-left-color: #22c55e;
}

.cal-event-item.pa {
    border-left-color: #f59e0b;
}

.cal-event-item.medsync {
    border-left-color: #8b5cf6;
}

.cal-event-time {
    font-size: 10px;
    color: #667eea;
    font-weight: 600;
    min-width: 45px;
}

.cal-event-info {
    flex: 1;
}

.cal-event-title {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
}

.cal-event-desc {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

/* Patient and Drug name styling - bigger and bold */
.patient-name, #patientName {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1e293b;
}

.drug-name, #rxDrugName {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1e293b;
}

.section-summary {
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Make patient and drug summaries bigger and bolder */
#patientSection .section-summary,
#rxSection .section-summary,
#prescriptionSection .section-summary {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

/* Quick Links Bar */
.quick-links {
    background: var(--gray-100, #f3f4f6);
    padding: 6px 10px;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
}
.quick-links-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.quick-links-row::-webkit-scrollbar { display: none; }
.quick-link {
    font-size: 18px;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.2s;
    cursor: pointer;
}
.quick-link:hover {
    background: var(--gray-200, #e5e7eb);
}
.quick-divider {
    color: var(--gray-300, #d1d5db);
    font-size: 14px;
}

/* Quick Links with logos */
.quick-link img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

/* Wide logos for ABC and IPC */
.quick-link-wide img {
    width: 50px;
    height: 24px;
}

/* Larger logos for ABC and IPC */
.quick-link-lg img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

/* Debug Logs Section */
.log-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}
.log-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: var(--gray-200);
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}
.log-tab.active {
    background: var(--primary);
    color: white;
}
.log-tab:hover:not(.active) {
    background: var(--gray-300);
}
.log-panel {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--gray-100);
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
}
.log-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
}
.log-refresh:hover {
    background: var(--gray-200);
}
.log-content {
    padding: 10px;
    font-size: 11px;
    max-height: 300px;
    overflow-y: auto;
}
.log-entry {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.log-time {
    font-size: 10px;
    color: var(--gray-600);
    margin-bottom: 4px;
}
.log-item {
    padding: 4px 0;
    border-bottom: 1px solid var(--gray-100);
}
.log-item:last-child {
    border-bottom: none;
}

/* Chat channel tabs */
.chat-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.chat-tab {
    padding: 4px 10px;
    border: none;
    background: #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
}
.chat-tab:hover {
    background: #d1d5db;
}
.chat-tab.active {
    background: #3b82f6;
    color: white;
}

/* Minimalist Icon Styling */
.sidebar-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  margin-right: 12px;
  transition: transform 0.2s ease;
}

/* Sidebar Item Polish */
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #4b5563; /* Subtle grey text */
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: rgba(139, 21, 56, 0.05); /* Very light burgundy tint */
  color: var(--primary);
}

.nav-item.active {
  background-color: var(--primary);
  color: white;
}

.nav-item:hover .sidebar-icon {
  transform: translateX(2px);
}

/* Section Icon Styling */
.section-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  vertical-align: middle;
  margin-right: 6px;
}

.toggle-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Widget Icon Styling */
.widget-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  vertical-align: middle;
  margin-right: 4px;
}

/* Stat Icon Styling */
.stat-icon {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  vertical-align: middle;
  margin-right: 3px;
}

/* Button Icon Styling */
.btn-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  vertical-align: middle;
  margin-right: 4px;
}

/* Action Icon Styling */
.action-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Tab Icon Styling */
.tab-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  vertical-align: middle;
  margin-right: 4px;
}

/* MedSync Portal Widget */
.medsync-portal-widget {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 1px solid #d8b4fe;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
}

.medsync-portal-widget:hover {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    box-shadow: 0 3px 8px rgba(147, 51, 234, 0.2);
}

.medsync-portal-header {
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
}

.medsync-portal-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.medsync-stat {
    text-align: center;
    background: white;
    padding: 8px;
    border-radius: 8px;
    border-left: 3px solid #a855f7;
}

.medsync-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #7c3aed;
}

.medsync-stat-label {
    display: block;
    font-size: 9px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-top: 2px;
}

.medsync-portal-link {
    font-size: 10px;
    color: #7c3aed;
    text-align: center;
    font-weight: 500;
}

/* Vaultwarden Password Manager Widget */
.vault-widget {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
}

.vault-widget:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.25);
}

.vault-widget-header {
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
}

.vault-widget-desc {
    font-size: 10px;
    color: #92400e;
    margin-bottom: 6px;
}

.vault-widget-link {
    font-size: 10px;
    color: #b45309;
    text-align: center;
    font-weight: 500;
}

/* Authentik SSO Widget */
.auth-widget {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #60a5fa;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
}

.auth-widget:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.25);
}

.auth-widget-header {
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
}

.auth-widget-desc {
    font-size: 10px;
    color: #1e40af;
    margin-bottom: 6px;
}

.auth-widget-link {
    font-size: 10px;
    color: #1d4ed8;
    text-align: center;
    font-weight: 500;
}

/* Browser Extension Section */
.extension-section {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
}

.extension-header {
    font-size: 10px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.extension-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.ext-btn {
    flex: 1;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chrome-btn {
    background: #4285f4;
    color: white;
}

.chrome-btn:hover {
    background: #3367d6;
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.4);
}

.firefox-btn {
    background: #ff7139;
    color: white;
}

.firefox-btn:hover {
    background: #e65100;
    box-shadow: 0 2px 6px rgba(255, 113, 57, 0.4);
}

.edge-btn {
    background: #0078d4;
    color: white;
}

.edge-btn:hover {
    background: #005a9e;
    box-shadow: 0 2px 6px rgba(0, 120, 212, 0.4);
}

.extension-note {
    font-size: 9px;
    color: #6b7280;
    text-align: center;
}

.extension-note strong {
    color: #374151;
}

/* =============================================================================
   QUOTE BANNER
============================================================================= */
.quote-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 0 8px 6px;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-radius: 8px;
    border: 1px solid #c4b5fd;
}

body.collapsed .quote-banner {
    display: none;
}

.quote-icon {
    flex-shrink: 0;
}

.quote-text {
    flex: 1;
    font-size: 11px;
    font-weight: 500;
    color: #5b21b6;
    font-style: italic;
    line-height: 1.4;
    transition: opacity 0.3s ease;
}

/* =============================================================================
   APP FOOTER - Patent Notice
============================================================================= */
.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border-top: 1px solid var(--gray-300);
    flex-shrink: 0;
}

body.collapsed .app-footer {
    display: none;
}

.app-footer .footer-brand {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
}

.app-footer .patent-notice {
    font-size: 11px;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
