/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #212529;
    background-color: #f8f9fa;
    overflow-x: hidden;
    animation: fadeIn 0.2s ease-in;
}

/* Main Container Layout */
.main-container {
    display: flex;
    min-height: calc(100vh - 64px); /* Account for top header height */
}

/* Page Header - Consistent across read-only and edit modes */
.page-header {
    background: white;
    padding: 24px 40px;
    margin: -32px -40px 0 -40px;
    border-bottom: 1px solid #e5e7eb;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #0d1117;
    margin: 0;
}

.page-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 14px;
    color: #6c757d;
    position: relative;
}

/* Status Dropdown - Only interactive in edit mode */
.status-dropdown-menu {
    position: absolute;
    top: 32px;
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
    min-width: 140px;
    z-index: 1050;
}

.status-dropdown-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 14px;
    color: #212529;
}

.status-dropdown-item:hover {
    background-color: #f8f9fa;
}

.status-dropdown-item .status-badge {
    display: none;
}

#statusBadge.interactive {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}

#statusBadge.interactive:hover {
    opacity: 0.8;
}

/* Global Link Styling - No underline by default, underline on hover */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Header */
.top-header {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    height: 36px;
    width: auto;
}

.logo svg {
    flex-shrink: 0;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #1A4A72;
    letter-spacing: -0.5px;
}

.btn-sign-out {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    transition: color 0.2s;
    font-weight: 400;
}

.btn-sign-out:hover {
    color: #212529;
}

.btn-sign-out i {
    font-size: 16px;
}

/* Main Container */
.main-container {
    display: flex;
    margin-top: 64px;
    height: calc(100vh - 64px);
    will-change: opacity;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    transition: all 0.3s ease;
    will-change: transform;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
    font-size: 20px;
}

.nav-menu {
    padding: 8px 0 0 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #495057;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s;
    position: relative;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background-color: #f8f9fa;
}

.nav-item.active:not(.nav-item-expandable) {
    background-color: #e8e8e8;
    color: #0d6efd; /* Blue for active state - matches tabs */
}

.nav-item-expandable {
    justify-content: space-between;
    background-color: transparent !important;
}

.nav-icon {
    font-size: 18px;
    min-width: 20px;
    margin-right: 12px;
    color: #495057;
}

.nav-item.active:not(.nav-item-expandable) .nav-icon,
.nav-subitem.active .nav-icon {
    color: #0d6efd; /* Blue icon for active state */
}

.nav-text {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
}

.nav-arrow {
    font-size: 12px;
    transition: transform 0.2s;
    color: #495057;
}

.nav-item-expandable.active .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #fafafa;
}

.nav-submenu.expanded {
    max-height: 600px;
}

.nav-subitem {
    display: block;
    padding: 8px 12px;
    padding-left: 40px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
    margin: 2px 16px;
    border-radius: 6px;
}

.nav-subitem:hover {
    background-color: #f0f0f0;
    color: #495057;
}

.nav-subitem.active {
    background-color: #e8e8e8;
    color: #0d6efd; /* Blue for active subitem */
    font-weight: 500; /* Slightly bolder for active state */
}

/* Content Area */
.content-area {
    flex: 1;
    background: #f8f9fa;
    overflow-y: auto;
    animation: slideIn 0.25s ease-out;
}

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

.content-wrapper {
    padding: 32px 40px;
    max-width: 100%;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: nowrap;
}

.filter-left {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: nowrap;
    align-items: center;
    min-width: 0;
}

.filter-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.filter-left .form-control,
.filter-left .btn,
.filter-right .btn {
    height: 38px;
    font-size: 14px;
}

.filter-left .form-control {
    min-width: 180px;
    flex: 1;
    max-width: 280px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.filter-left .form-control[type="date"] {
    min-width: 160px;
    max-width: 180px;
}

.filter-left .form-control:focus,
.filter-left .btn:focus,
.filter-right .btn:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
}

/* Table Container */
.table-container {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    overflow-x: auto;
    overflow-y: visible;
    animation: fadeInUp 0.3s ease-out;
}

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

.table {
    margin-bottom: 0;
    font-size: 14px;
    position: relative;
}

.table-container > table {
    width: 100%;
    table-layout: auto; /* Allow columns to resize based on content */
}

.table thead {
    background-color: #fff;
}

.table thead th {
    font-weight: 600;
    color: #212529;
    padding: 14px 16px;
    border-bottom: 2px solid #dee2e6;
    vertical-align: middle;
    white-space: nowrap;
    position: relative;
    user-select: none;
    max-width: 300px; /* Prevent headers from getting too wide */
}

/* Modern Expandable Table - Telerik/AWS Style */
.ndc-link {
    color: #0066cc;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.ndc-link strong {
    font-weight: 400;
}

.ndc-link:hover {
    color: #004080;
    text-decoration: none;
}

.ndc-link .expand-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #6c757d;
    flex-shrink: 0;
}

.ndc-link.expanded .expand-icon {
    transform: rotate(90deg);
}

/* Expanded parent row visual indicator */
.table .expandable-row.expanded {
    background-color: #e8e8e8 !important;
}

.table .expandable-row.expanded:hover {
    background-color: #e8e8e8 !important;
}

.table .expandable-row.expanded td {
    background-color: #e8e8e8 !important;
}

/* Interval Badges - Intuitive Display */
.interval-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.interval-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.interval-badge i {
    font-size: 13px;
}

/* First fill badge - Blue */
.interval-badge.interval-first {
    background-color: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

/* Refill badge - Purple */
.interval-badge.interval-refill {
    background-color: #e0cffc;
    color: #6f42c1;
    border: 1px solid #d3b8f7;
}

/* All fills badge - Teal */
.interval-badge.interval-all {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* Frequency badge - Orange */
.interval-badge.interval-frequency {
    background-color: #fff3cd;
    color: #997404;
    border: 1px solid #ffe69c;
}

/* Business Rule Badges - Intuitive Display */
.rule-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.rule-badge i {
    font-size: 13px;
}

/* Age rule badge - Blue */
.rule-badge.rule-age {
    background-color: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

/* Quantity rule badge - Purple */
.rule-badge.rule-quantity {
    background-color: #e0cffc;
    color: #6f42c1;
    border: 1px solid #d3b8f7;
}

/* Default rule badge - Green */
.rule-badge.rule-default {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* Gender rule badge - Pink */
.rule-badge.rule-gender {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Location/State rule badge - Teal */
.rule-badge.rule-location {
    background-color: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

/* Condition rule badge - Red/Medical */
.rule-badge.rule-condition {
    background-color: #ffe5e5;
    color: #c92a2a;
    border: 1px solid #ffc9c9;
}

/* Language rule badge - Indigo */
.rule-badge.rule-language {
    background-color: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

/* Date/Enrollment rule badge - Orange */
.rule-badge.rule-date {
    background-color: #fff3cd;
    color: #997404;
    border: 1px solid #ffe69c;
}

/* Opt-in rule badge - Success Green */
.rule-badge.rule-opt-in {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* Nested Rows - Clean Continuation Style */
.nested-row {
    background-color: #f8f9fa !important;
}

/* Parent row when expanded */
.parent-row-expanded {
    background-color: #f0f4f8 !important;
}

/* When parent is expanded, highlight nested rows with same background to show grouping */
.table .nested-row.expanded {
    background-color: #e8e8e8 !important;
}

.table .nested-row.expanded td {
    background-color: transparent;
}

/* Hover state for nested rows (lighter when not expanded) */
.nested-row:hover {
    background-color: #f5f6f7 !important;
}

/* Hover state for expanded nested rows (slightly darker) */
.table .nested-row.expanded:hover {
    background-color: #dcdcdc !important;
}

.nested-cell {
    position: relative;
    padding-left: 40px !important;
}

.nested-indicator {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 1px;
    background-color: #d0d5dd;
}

.nested-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    top: -8px;
    width: 1px;
    height: 16px;
    background-color: #d0d5dd;
}

.nested-row td {
    border-top: 1px solid #f0f0f0 !important;
    font-size: 13px;
    color: #5a5f69;
}

.nested-row .text-muted {
    color: #6c757d !important;
    font-weight: 400;
}

/* Column Resize Handle */
.resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    border-right: 1px solid transparent;
}

.table thead th:hover .resize-handle {
    border-right: 1px solid #dee2e6;
}

.resize-handle:hover {
    background-color: rgba(13, 110, 253, 0.1);
    border-right: 2px solid #0d6efd !important;
}

.resize-handle.resizing {
    background-color: rgba(13, 110, 253, 0.2);
    border-right: 2px solid #0d6efd !important;
}

.table thead th.resizing {
    user-select: none;
}

/* Column Sorting - Telerik Style */
.table thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
}

.table thead th.sortable:hover {
    background-color: #f8f9fa;
}

.sort-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #adb5bd;
    opacity: 0;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.table thead th.sortable:hover .sort-icon {
    opacity: 1;
}

.table thead th.sortable.sort-asc .sort-icon,
.table thead th.sortable.sort-desc .sort-icon {
    opacity: 1;
    color: #212529;
}

.sort-icon i {
    display: block;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #212529;
    transition: background-color 0.15s ease;
    /* Text truncation with ellipsis */
    max-width: 250px; /* Default max width, can be overridden per column */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

/* Show full text on hover with tooltip */
.table tbody td:hover {
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
}

/* Specific column widths for better table layout */
.table tbody td:first-child {
    max-width: 200px; /* Name columns */
}

.table tbody td:nth-child(2) {
    max-width: 350px; /* Description columns - wider for more content */
}

/* Columns with badges/actions don't need truncation */
.table tbody td:has(.status-badge),
.table tbody td:has(.action-icons),
.table tbody td:last-child {
    max-width: none;
    overflow: visible;
    white-space: normal;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.table tbody tr:hover:not(:has(.empty-state)) {
    background-color: #f8f9fa;
}

.table tbody tr:hover:not(:has(.empty-state)) td {
    background-color: #f8f9fa;
}

.table tbody tr:has(.empty-state) {
    cursor: default;
}

.table tbody tr.selected {
    background-color: #f0f0f0;
}

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

.table tbody tr.selected td {
    background-color: transparent;
}

/* Campaign Name Links */
.campaign-link {
    color: #3B82F6;
    text-decoration: none;
    font-weight: 400;
}

.campaign-link:hover {
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

/* Success/Green badges - Active, Complete, Available, Delivered */
.badge-active,
.badge-complete,
.badge-available,
.badge-delivered {
    background-color: #d1e7dd;
    color: #0f5132;
}

/* Fulfilled Badge */
.badge-fulfilled {
    background-color: #cfe2ff;
    color: #0a58ca;
}

/* Cancelled Badge */
.badge-cancelled {
    background-color: #f8d7da;
    color: #842029;
}

/* Warning/Yellow badges - Test, Configured, Manually Delivered, Incomplete */
.badge-test,
.badge-configured,
.badge-manually-delivered,
.badge-incomplete {
    background-color: #fff3cd;
    color: #856404;
}

/* Info/Blue badges - Suspended, New, Pending, Not Required */
.badge-suspended,
.badge-new,
.badge-pending,
.badge-not-required {
    background-color: #cfe2ff;
    color: #0a58ca;
}

/* Draft Badge - Gray */
.badge-draft {
    background-color: #e9ecef;
    color: #495057;
}

/* Neutral/Gray badges - Disabled, Reviewed */
.badge-disabled,
.badge-reviewed {
    background-color: #e9ecef;
    color: #6c757d;
}

/* Danger/Red badges - Inactive */
.badge-inactive {
    background-color: #f8d7da;
    color: #842029;
}

/* Center any table cell that contains a badge - this ensures ALL status columns are centered */
.table tbody td:has(.badge) {
    text-align: center;
}

/* Center all badges */
.table tbody td .badge,
.table tbody td .status-badge {
    display: inline-block;
    vertical-align: middle;
}

/* Center align status columns - both header and cells */
.table thead th:has-text("Status"),
.table thead th[data-status="true"],
.table tbody td:has(.badge),
.table tbody td:has(.status-badge) {
    text-align: center;
    vertical-align: middle;
}

/* Center align Actions column and Action header in all tables */
.table thead th:last-child,
.table tbody td:last-child {
    text-align: center;
    vertical-align: middle;
}

/* Default alignment */
.table thead th {
    text-align: left;
    vertical-align: middle;
}

.table thead th:last-child {
    text-align: center;
    vertical-align: middle;
}

/* Row Action Dropdown */
.row-actions .btn {
    font-size: 13px;
    padding: 4px 12px;
}

/* Breadcrumb Header */
.breadcrumb-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.breadcrumb-link {
    color: #0d6efd;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #6c757d;
}

/* Form Section Card */
.form-section-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 28px;
}

/* Form Row Responsive */
.form-section-card .row {
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: 24px;
}

.form-section-card .row:last-child {
    margin-bottom: 0;
}

.form-section-card .row .col-12 {
    padding-left: 12px;
    padding-right: 12px;
}

/* Form Group Custom Spacing */
.form-group-custom {
    margin-bottom: 0;
}

.form-section-card > .form-group-custom {
    margin-top: 24px;
}

.form-section-card > .form-group-custom:last-child {
    margin-bottom: 0;
}

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

.form-label-custom .bi-info-circle {
    font-size: 12px;
    cursor: help;
}

/* Form Controls Enhanced */
.form-group-custom .form-control {
    height: 42px;
    padding: 8px 14px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group-custom .form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-group-custom textarea.form-control {
    height: auto;
    min-height: 120px;
    resize: vertical;
}

/* Custom Dropdown in Forms */
.form-group-custom .custom-dropdown {
    width: 100%;
}

.form-group-custom .custom-dropdown .custom-dropdown-trigger {
    height: 42px;
    padding: 8px 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group-custom .custom-dropdown .custom-dropdown-trigger:hover {
    border-color: #b3b3b3;
}

.form-group-custom .custom-dropdown.open .custom-dropdown-trigger {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-group-custom .custom-dropdown-value {
    font-size: 14px;
    color: #495057;
}

.form-group-custom .custom-dropdown .custom-dropdown-trigger .bi-chevron-down {
    font-size: 12px;
    color: #6c757d;
}

/* Responsive Form Layout */
@media (max-width: 768px) {
    .form-section-card {
        padding: 20px;
    }
    
    .form-section-card .row .col-12 {
        margin-bottom: 24px;
    }
    
    .form-section-card .row .col-12:last-child {
        margin-bottom: 0;
    }
    
    .form-section-card .row {
        margin-bottom: 0;
    }
    
    .form-section-card .row + .form-group-custom {
        margin-top: 24px;
    }
}

/* Button Link */
.btn-link-primary {
    color: #0d6efd;
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-weight: 500;
}

.btn-link-primary:hover {
    text-decoration: underline;
    color: #0a58ca;
}

/* Empty State Inline */
.empty-state-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.empty-state-inline:hover {
    border-color: #adb5bd;
    background: #f1f3f5;
}

.empty-state-inline i {
    font-size: 48px;
    color: #adb5bd;
    margin-bottom: 12px;
}

.empty-state-inline p {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 500;
    color: #495057;
}

.empty-state-inline small {
    font-size: 13px;
    color: #6c757d;
}

/* Drug Management Styles */
.drug-management-container {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.drugs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
}

.drug-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    animation: slideIn 0.3s ease;
}

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

.drug-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.1);
    transform: translateY(-2px);
}

.drug-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.drug-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.drug-item-main > i {
    font-size: 24px;
    color: #0d6efd;
    flex-shrink: 0;
}

.drug-item-details {
    flex: 1;
    min-width: 0;
}

.drug-name {
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.drug-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.drug-meta span {
    font-size: 13px;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.drug-meta span::before {
    content: '';
    width: 4px;
    height: 4px;
    background: #adb5bd;
    border-radius: 50%;
}

.drug-meta span:first-child::before {
    display: none;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6c757d;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: #fee;
    color: #dc3545;
}

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

.btn-icon i {
    font-size: 18px;
}

/* Section Title */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

/* Drug Count Badge */
.drug-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #e9ecef;
    color: #495057;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    margin-left: 8px;
}

/* Responsive Drug Management */
@media (max-width: 768px) {
    .drug-item {
        padding: 12px;
    }
    
    .drug-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .drug-item-main > i {
        font-size: 20px;
    }
    
    .drug-name {
        font-size: 14px;
    }
    
    .drug-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .drug-meta span::before {
        display: none;
    }
    
    .btn-icon {
        align-self: flex-end;
        width: 100%;
        justify-content: center;
        padding: 10px;
    }
    
    .drug-management-container {
        padding: 16px;
    }
}

/* Form Actions Footer */
.form-actions-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid #dee2e6;
}

/* Hidden Columns Bar */
.hidden-columns-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.hidden-columns-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

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

.hidden-column-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
}

.hidden-column-tag .bi-x {
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: color 0.15s ease;
}

.hidden-column-tag .bi-x:hover {
    color: #dc3545;
}

.show-all-link {
    font-size: 13px;
    font-weight: 400;
    color: #6c757d;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease;
}

.show-all-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* Column Menu Icon */
.column-menu-icon {
    margin-left: 6px;
    font-size: 16px;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.table thead th:hover .column-menu-icon {
    opacity: 1;
}

.column-menu-icon:hover {
    color: #dc3545;
}

/* Tabs */
/* =============================================================================
   SECTION NAVIGATION TABS (Universal Component)
   Used for both read-only scrolling tabs and edit mode page navigation tabs
   ============================================================================= */

.section-nav {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #e9ecef;
    margin: 0 -40px 40px -40px;
    padding: 0 40px;
    z-index: 1001;
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    box-shadow: 0 1px 0 0 white;
}

/* Fill any gap above nav when sticky - extends background upward */
.section-nav::before {
    content: '';
    position: absolute;
    top: -200px;
    left: -100%;
    right: -100%;
    height: 200px;
    background: white;
    z-index: 0;
    pointer-events: none;
}

/* Ensure nav items are above the pseudo-element */
.section-nav > * {
    position: relative;
    z-index: 1;
}

/* Sticky Edit Button - appears when scrolling in read-only mode */
.sticky-edit-button {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hide scrollbar for webkit browsers */
.section-nav::-webkit-scrollbar {
    display: none;
}

.section-nav-item {
    padding: 16px 20px;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    display: inline-block;
}

.section-nav-item:hover {
    color: #0d6efd;
    background: #f8f9fa;
}

.section-nav-item.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
}

/* Responsive adjustments for section nav */
@media (max-width: 1200px) {
    .section-nav {
        margin: 0 -32px 32px -32px;
        padding: 0 32px;
    }
}

@media (max-width: 768px) {
    .section-nav {
        margin: 0 -16px 24px -16px;
        padding: 0 16px;
        top: 0;
    }
    
    .section-nav-item {
        padding: 12px 16px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .section-nav {
        margin: 0 -12px 20px -12px;
        padding: 0 12px;
    }
    
    .section-nav-item {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Legacy class names for backward compatibility (deprecated) */
.tabs-container {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 56px;
}

.tab-item {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-block;
}

.tab-item:hover {
    color: #495057;
    font-weight: 500;
    text-decoration: none;
}

.tab-item.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    font-weight: 500;
}

a.tab-item {
    color: #6c757d;
    text-decoration: none;
}

a.tab-item:hover {
    color: #495057;
    font-weight: 500;
    text-decoration: none;
}

/* Tab Content Panes - for tab switching without page reload */
.tab-content-pane {
    display: none;
}

.tab-content-pane.active {
    display: block;
}

/* Search Input with Icon */
.search-input-with-icon {
    position: relative;
    display: inline-block;
    width: auto;
}

.search-input-with-icon .form-control {
    width: 320px;
    padding-left: 38px;
}

.search-input-with-icon .bi-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
    pointer-events: none;
}

/* Circular Status Icons */
.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
}

.status-icon-enabled {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-icon-disabled {
    background-color: #f8d7da;
    color: #842029;
}

/* Action Icons */
.action-icons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.action-icon-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #6c757d;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-icon-btn:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

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

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #dee2e6;
    background-color: #fff;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    z-index: 1;
    min-height: 64px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #495057;
}

.pagination-info .form-select {
    width: auto;
    min-width: 70px;
    padding: 4px 8px;
    font-size: 14px;
    height: 32px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    flex-wrap: nowrap;
}

.pagination-controls .btn {
    padding: 6px 12px;
    min-width: 36px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
}

.pagination-controls .btn:hover:not(:disabled) {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

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

.pagination-controls span {
    white-space: nowrap;
    color: #495057;
    font-size: 14px;
}

.page-input {
    width: 45px;
    text-align: center;
    height: 34px;
    padding: 6px 8px;
    flex-shrink: 0;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    color: #212529;
}

/* Remove spinner from number input */
.page-input::-webkit-inner-spin-button,
.page-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-input {
    -moz-appearance: textfield;
}

/* Checkbox Styling */
.form-check-input {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-wrapper {
        padding: 24px 32px;
    }
    
    .page-header {
        padding: 20px 32px;
        margin: -24px -32px 0 -32px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 64px;
        height: calc(100vh - 64px);
        z-index: 999;
        margin-left: -260px;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .content-area {
        margin-left: 0;
        width: 100%;
    }

    .filter-bar {
        flex-wrap: wrap;
    }

    .filter-left {
        flex-wrap: wrap;
        width: 100%;
    }

    .filter-left .form-control,
    .filter-left .custom-dropdown {
        flex: 1 1 calc(50% - 6px);
        min-width: 140px;
        max-width: none;
    }

    .filter-right {
        justify-content: flex-end;
        width: 100%;
    }

    .filter-right .btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }

    .content-wrapper {
        padding: 16px;
    }
    
    .page-header {
        padding: 16px 20px;
        margin: -16px -16px 0 -16px;
    }

    .logo svg {
        width: 32px;
        height: 32px;
    }

    .logo-img {
        height: 28px;
    }

    .logo-text {
        font-size: 22px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        position: relative;
        /* Add scroll shadow indicators */
        background:
            /* Shadow covers */ 
            linear-gradient(to right, white 30%, rgba(255,255,255,0)),
            linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
            /* Shadows */ 
            radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,.15), rgba(0,0,0,0)),
            radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.15), rgba(0,0,0,0)) 0 100%;
        background-repeat: no-repeat;
        background-color: white;
        background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }

    /* On mobile, reduce max-widths for cells */
    .table tbody td {
        max-width: 180px;
    }
    
    .table tbody td:first-child {
        max-width: 150px;
    }
    
    .table tbody td:nth-child(2) {
        max-width: 250px;
    }
    
    /* Make first column sticky on mobile for easier navigation */
    .table thead th:first-child,
    .table tbody td:first-child {
        position: sticky;
        left: 0;
        background-color: #fff;
        z-index: 10;
        box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    }
    
    .table thead th:first-child {
        z-index: 11;
        background-color: #fff;
    }

    /* Add visual hint for horizontal scrolling */
    .table-container::after {
        content: '← Scroll for more →';
        position: absolute;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(13, 110, 253, 0.9);
        color: white;
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 500;
        pointer-events: none;
        opacity: 0;
        animation: scrollHintFade 3s ease-in-out;
        z-index: 5;
    }
    
    @keyframes scrollHintFade {
        0%, 20% { opacity: 1; }
        80%, 100% { opacity: 0; }
    }

    .pagination-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pagination-info {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination-controls {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }
}

/* Tablet optimizations */
@media (max-width: 992px) and (min-width: 769px) {
    .table {
        font-size: 13px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 12px 12px;
    }
    
    /* Adjust max-widths for tablet */
    .table tbody td {
        max-width: 220px;
    }
    
    .table tbody td:first-child {
        max-width: 180px;
    }
    
    .table tbody td:nth-child(2) {
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    .logo svg {
        width: 28px;
        height: 28px;
    }

    .logo-img {
        height: 24px;
    }

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

    .btn-sign-out {
        padding: 4px 8px;
        font-size: 13px;
    }

    .content-wrapper {
        padding: 12px;
    }
    
    .page-header {
        padding: 12px 16px;
        margin: -12px -12px 0 -12px;
    }

    .filter-bar {
        gap: 10px;
    }

    .table thead th,
    .table tbody td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    /* Further reduce max-widths for very small screens */
    .table tbody td {
        max-width: 140px;
    }
    
    .table tbody td:first-child {
        max-width: 120px;
    }
    
    .table tbody td:nth-child(2) {
        max-width: 180px;
    }
    
    /* Make filter bar more compact */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-left,
    .filter-right {
        width: 100%;
    }
    
    /* Stack pagination items on very small screens */
    .pagination-info span {
        font-size: 12px;
    }
    
    .pagination-controls {
        gap: 4px;
    }
    
    .pagination-controls .btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .page-input {
        width: 40px;
        padding: 4px;
        font-size: 12px;
    }
}

/* Collapsed Sidebar Styles */
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-arrow {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.sidebar.collapsed .nav-submenu {
    display: none;
}

/* Ensure cards don't clip dropdown menus */
.card:has(.custom-dropdown),
.card-body:has(.custom-dropdown) {
    overflow: visible !important;
}

.card .card-body {
    overflow: visible;
}

/* Dropup variant - opens upward instead of downward */
.custom-dropdown.dropup .custom-dropdown-menu {
    top: auto;
    bottom: calc(100% + 4px);
}

/* Custom Dropdown Styling */
.custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 200px;
    z-index: 10;
}

.custom-dropdown.open {
    z-index: 1101;
}

.custom-dropdown-sm {
    min-width: 80px;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.15s ease;
    height: 38px;
    gap: 8px;
}

.custom-dropdown-sm .custom-dropdown-trigger {
    height: 32px;
    padding: 4px 8px;
}

.custom-dropdown-trigger:hover {
    border-color: #adb5bd;
    background-color: #f8f9fa;
}

.custom-dropdown.open .custom-dropdown-trigger {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
}

.custom-dropdown-value {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent !important;
    color: #212529 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

.custom-dropdown-value[data-placeholder="true"] {
    color: #6c757d !important;
    box-shadow: none !important;
    outline: none !important;
}

.custom-dropdown-trigger i {
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.custom-dropdown.open .custom-dropdown-trigger i {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

/* Dropdown inside modal needs higher z-index */
.modal-body-custom .custom-dropdown-menu {
    z-index: 10100;
}

.modal-body .custom-dropdown-menu {
    z-index: 10100;
}

.custom-dropdown-menu-right {
    left: auto;
    right: 0;
}

.custom-dropdown.open .custom-dropdown-menu,
.custom-dropdown-menu.show {
    display: block;
}

.custom-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #212529;
    transition: background-color 0.15s ease;
}

.custom-dropdown-sm .custom-dropdown-item {
    padding: 6px 10px;
}

.custom-dropdown-item:hover {
    background-color: #f8f9fa;
}

.custom-dropdown-item.active {
    background-color: #e9ecef;
    font-weight: 500;
}

/* Scrollbar for dropdown menu */
.custom-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Legacy dropdown menu styling (for row actions) */
.dropdown-menu {
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
}

.dropdown-item {
    padding: 8px 16px;
    color: #212529;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:active {
    background-color: #e9ecef;
}

/* Button styling to match design */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-danger:focus {
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25);
}

.btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
    background-color: #fff;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.btn-outline-secondary:focus {
    box-shadow: 0 0 0 0.15rem rgba(108, 117, 125, 0.25);
}

.btn-outline {
    border: 1px solid #ced4da;
    color: #495057;
    background-color: #fff;
    transition: all 0.15s ease-in-out;
}

.btn-outline:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
}

.btn-outline.active {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.btn-outline:focus {
    box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.25);
}

/* Advanced Filters Panel Animation */
#advancedFiltersPanel {
    transition: all 0.3s ease-in-out;
    transform-origin: top;
}

#advancedFiltersPanel[style*="display: none"] {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#advancedFiltersPanel[style*="display: block"] {
    max-height: 1000px;
    opacity: 1;
}

/* Bootstrap Modal Z-Index Override - Ensures modal covers everything including header */
.modal {
    z-index: 10500 !important;
}

.modal-backdrop {
    z-index: 10400 !important;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-dialog-custom {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
    position: relative;
    z-index: 100000;
    overflow: visible;
    margin: auto;
}

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

.modal-content-custom {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: visible;
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.modal-close:hover {
    background-color: #f8f9fa;
}

.modal-body-custom {
    padding: 24px;
    overflow: visible;
}

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

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

.form-label-custom {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 8px;
}

.form-label-custom i {
    font-size: 16px;
    cursor: help;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
}

.form-control::placeholder {
    color: #adb5bd;
}

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

/* Rich Text Editor */
.rich-text-editor {
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

.rich-text-editor:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
}

.rich-text-toolbar {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    gap: 4px;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-size: 16px;
}

.toolbar-btn:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.toolbar-btn:active,
.toolbar-btn.active {
    background-color: #dee2e6;
    border-color: #ced4da;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background-color: #dee2e6;
    margin: 0 4px;
}

.rich-text-content {
    min-height: 150px;
    max-height: 300px;
    padding: 12px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
}

.rich-text-content:focus {
    outline: none;
}

.rich-text-content:empty:before {
    content: attr(data-placeholder);
    color: #adb5bd;
}

/* Number Input with Spinner */
.number-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.number-input-wrapper .form-control {
    padding-right: 40px;
}

/* Hide default number input spinner */
.number-input-wrapper input[type="number"]::-webkit-inner-spin-button,
.number-input-wrapper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input-wrapper input[type="number"] {
    -moz-appearance: textfield;
}

.number-spinner {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    display: flex;
    flex-direction: column;
    width: 28px;
    border-left: 1px solid #ced4da;
    border-radius: 0 4px 4px 0;
}

.spinner-btn {
    flex: 1;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: background-color 0.15s;
    font-size: 10px;
}

.spinner-btn:hover {
    background-color: #f8f9fa;
}

.spinner-btn:active {
    background-color: #e9ecef;
}

.spinner-up {
    border-radius: 0 3px 0 0;
    border-bottom: 1px solid #ced4da;
}

.spinner-down {
    border-radius: 0 0 3px 0;
}

/* Button Styling */
.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

.btn-secondary:focus {
    box-shadow: 0 0 0 0.15rem rgba(108, 117, 125, 0.25);
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Modal body scrollbar */
.modal-body-custom::-webkit-scrollbar,
.changes-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.modal-body-custom::-webkit-scrollbar-track,
.changes-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body-custom::-webkit-scrollbar-thumb,
.changes-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body-custom::-webkit-scrollbar-thumb:hover,
.changes-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Fade effect for scrollable content */
.changes-scroll-container {
    position: relative;
}

.changes-scroll-container::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0), #f8f9fa 70%);
    pointer-events: none;
    display: block;
    margin: -40px -20px 0 -20px;
    border-radius: 0 0 8px 8px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: #6c757d;
    max-width: 400px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: #6c757d;
}

/* Rich text content scrollbar */
.rich-text-content::-webkit-scrollbar {
    width: 6px;
}

.rich-text-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.rich-text-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.rich-text-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Page Title Styles - Defined globally at line 30 */
/* Removed duplicate .page-title definition to fix font size inconsistency */

.page-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 20px;
}

/* Alert Styles */
.alert {
    display: flex;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    max-width: 800px;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
}

.alert-icon {
    font-size: 18px;
    color: #856404;
    margin-right: 10px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    color: #856404;
    margin-bottom: 2px;
    font-size: 13px;
}

.alert-text {
    font-size: 12px;
    color: #856404;
    line-height: 1.4;
}

/* Custom Select Wrapper - Maintains HTML select appearance but uses custom dropdown */
.select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
    cursor: pointer;
    width: 100%;
}

.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Custom dropdown arrow */
.select-wrapper::after {
    content: '\f282'; /* Bootstrap Icons chevron-down */
    font-family: 'bootstrap-icons';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6c757d;
    font-size: 12px;
}

/* Custom dropdown menu for select elements */
.select-custom-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.select-custom-menu.show {
    display: block;
}

.select-custom-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #212529;
    transition: background-color 0.15s ease;
}

.select-custom-item:hover {
    background-color: #f8f9fa;
}

.select-custom-item.active {
    background-color: #e9ecef;
    font-weight: 500;
}

/* Info icon styling */
.info-icon {
    color: #6c757d;
    font-size: 14px;
    margin-left: 4px;
    cursor: help;
}

/* Translation Modal Styles */
.translation-tabs {
    display: flex;
    gap: 4px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 6px;
}

.translation-tab {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.translation-tab:hover {
    color: #212529;
}

.translation-tab.active {
    background: #fff;
    color: #212529;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.json-editor {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
    border: 1px solid #3c3c3c !important;
    border-radius: 6px !important;
    padding: 16px !important;
    resize: vertical;
    min-height: 240px;
}

.json-editor:focus {
    outline: none;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.json-editor::placeholder {
    color: #6c757d;
}

.json-editor-container {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

.json-validation-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #6c757d;
    transition: background 0.2s ease;
}

.json-validation-indicator.valid {
    background: #28a745;
}

.json-validation-indicator.invalid {
    background: #dc3545;
}

.validation-status {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.translation-tab-content {
    display: none;
}

.translation-tab-content.active {
    display: block;
}

/* Toast Notification System - Telerik Style */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: all;
}

.toast {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 20px;
    min-width: 380px;
    border-left: 5px solid;
    font-size: 15px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.toast-success {
    border-left-color: #28a745;
}

.toast.toast-error {
    border-left-color: #dc3545;
}

.toast.toast-warning {
    border-left-color: #ffc107;
}

.toast.toast-info {
    border-left-color: #0078d4;
}

.toast.toast-hide {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    display: inline-block;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-error .toast-icon {
    color: #dc3545;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-info .toast-icon {
    color: #0078d4;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.toast-close:hover {
    background-color: #f8f9fa;
}

/* Info Banner Component - Telerik Style */
.info-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-left: 4px solid #0078d4;
    padding: 14px 16px;
    margin-bottom: 24px;
    border-radius: 4px;
}

.info-banner-icon {
    color: #0078d4;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 0;
}

.info-banner-content {
    font-size: 13px;
    color: #212529;
    line-height: 1.6;
    flex: 1;
}

.info-banner-title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.info-banner-item {
    margin-bottom: 8px;
}

.info-banner-item:last-child {
    margin-bottom: 0;
}

/* Info Banner Variants */
.info-banner.info-banner-info {
    background-color: #d1ecf1;
    border-left-color: #0c5460;
}

.info-banner.info-banner-info .info-banner-icon {
    color: #0c5460;
}

.info-banner.info-banner-info .info-banner-content {
    color: #0c5460;
}

.info-banner.info-banner-success {
    background-color: #d1e7dd;
    border-left-color: #0f5132;
}

.info-banner.info-banner-success .info-banner-icon {
    color: #0f5132;
}

.info-banner.info-banner-success .info-banner-content {
    color: #0f5132;
}

.info-banner.info-banner-warning {
    background-color: #fff3cd;
    border-left-color: #856404;
}

.info-banner.info-banner-warning .info-banner-icon {
    color: #856404;
}

.info-banner.info-banner-warning .info-banner-content {
    color: #856404;
}

/* Hide old modal (removed from HTML but may have JS references) */
/* Form Card Styles */
.form-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    max-width: 800px;
}

.form-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 16px;
}

.form-helper-text {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
    margin-top: 2px;
}

/* Patient Search Styles */
.patient-search-input-group {
    display: flex;
    gap: 10px;
}

.patient-search-input-group .form-control {
    flex: 1;
}

.patient-search-input-group .btn {
    white-space: nowrap;
}

.patient-search-examples-section {
    margin-top: 32px;
}

.patient-search-examples-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 16px;
}

.patient-search-examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 800px;
}

.patient-search-example-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 16px;
}

.patient-search-example-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #212529;
}

.patient-search-example-header i {
    font-size: 16px;
    color: #6c757d;
}

.patient-search-example-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.patient-search-example-label {
    font-size: 11px;
    color: #6c757d;
}

.patient-search-example-value {
    font-size: 12px;
    font-weight: 500;
    color: #212529;
    font-family: 'Courier New', monospace;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .patient-search-examples-grid {
        grid-template-columns: 1fr;
    }
    
    .patient-search-input-group {
        flex-direction: column;
    }
    
    .patient-search-input-group .btn {
        width: 100%;
    }
}

/* Toggle Switches */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    width: 42px;
    height: 24px;
    cursor: pointer;
    border: 2px solid #dee2e6;
    background-color: #ffffff;
}

.toggle-switch input[type="checkbox"]:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.toggle-switch input[type="checkbox"]:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Section Divider */
.section-divider {
    margin: 32px 0;
    border-top: 1px solid #dee2e6;
}

/* Info Icons */
.info-icon {
    color: #6c757d;
    font-size: 14px;
    margin-left: 4px;
    cursor: help;
}

.info-icon:hover {
    color: #495057;
}

/* Edit Page Fixed Footer */
.edit-page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 16px 24px;
    z-index: 999;
}

.edit-page-footer-content {
    display: flex;
    justify-content: flex-end !important;
    gap: 12px;
    max-width: 100%;
    margin-left: auto;
}

/* Adjust layout when edit footer exists */
body:has(.edit-page-footer) .content-area {
    padding-bottom: 0;
}

body:has(.edit-page-footer) .content-wrapper {
    padding-bottom: 100px;
    min-height: calc(100vh - 64px);
}

@media (max-width: 768px) {
    .edit-page-footer {
        padding: 12px 16px;
    }
    
    .edit-page-footer-content {
        width: 100%;
    }
    
    .edit-page-footer-content .btn {
        flex: 1;
    }
}

/* ========================================
   READ-ONLY VIEW MODE
   ======================================== */

/* Read-Only Field Container */
.read-only-field {
    margin-bottom: 0;
}

/* Read-Only Label */
.read-only-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Read-Only Value */
.read-only-value {
    font-size: 14px;
    color: #212529;
    line-height: 1.6;
    font-weight: 400;
}

/* Read-Only Tables (cleaner, no interactive elements) */
#readOnlyView .table-container {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

#readOnlyView .table {
    margin-bottom: 0;
}

#readOnlyView .table thead th {
    background-color: #f8f9fa;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 2px solid #dee2e6;
}

#readOnlyView .table tbody tr {
    cursor: default;
}

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

#readOnlyView .table tbody td {
    padding: 12px 16px;
    font-size: 14px;
    color: #212529;
}

/* Remove interactive table elements in read-only mode */
#readOnlyView .resize-handle {
    display: none;
}

#readOnlyView .sort-icon {
    display: none;
}

#readOnlyView th.sortable {
    cursor: default;
}

/* Status Badge Styling */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.status-suspended {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-test {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-configured {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-new {
    background-color: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

.status-disabled {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Enhanced spacing for read-only mode */
#readOnlyView .card-body {
    padding: 24px;
}

#readOnlyView .row {
    margin-bottom: 0;
}

#readOnlyView .row:not(:last-child) {
    margin-bottom: 24px;
}

/* Smooth transitions for mode switching */
#readOnlyView,
#campaignEditForm {
    animation: fadeInContent 0.3s ease-in;
}

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

/* Edit Mode Toggle Button */
#editModeToggle {
    transition: all 0.2s ease;
    font-weight: 500;
}

#editModeToggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Empty state in read-only mode */
#readOnlyView .empty-state {
    padding: 0;
    text-align: center;
}

/* Responsive adjustments for read-only mode */
@media (max-width: 768px) {
    .read-only-label {
        font-size: 11px;
    }
    
    .read-only-value {
        font-size: 13px;
    }
    
    #readOnlyView .card-body {
        padding: 16px;
    }
    
    #readOnlyView .row:not(:last-child) {
        margin-bottom: 20px;
    }
    
    #editModeToggle {
        font-size: 13px;
        padding: 5px 12px !important;
    }
}

/* SMS Guide Section Styles */
.sms-guide-section {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.sms-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.sms-guide-header:hover {
    background: #f1f5f9;
}

.sms-guide-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.sms-guide-left i {
    color: #64748b;
    font-size: 16px;
}

.sms-guide-chevron {
    color: #64748b;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.sms-guide-section.expanded .sms-guide-chevron {
    transform: rotate(180deg);
}

.sms-guide-content {
    display: none;
    padding: 0 24px 16px;
    max-height: 220px;
    overflow-y: auto;
}

.sms-guide-section.expanded .sms-guide-content {
    display: block;
}

.sms-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sms-guide-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 8px;
}

.sms-guide-variables {
    background: #fff;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.sms-variable {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.sms-variable:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sms-variable:first-of-type {
    padding-top: 0;
}

.sms-variable code {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 12px;
    font-weight: 500;
    min-width: 32px;
    text-align: center;
}

.sms-variable span {
    color: #64748b;
}

.sms-guide-example {
    background: #fff;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e2e8f0;
}

.sms-example-text {
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 12px;
    color: #713f12;
    line-height: 1.5;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.sms-example-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    background: #eff6ff;
    border-radius: 4px;
    font-size: 11px;
    color: #1e40af;
}

.sms-example-note i {
    color: #3b82f6;
    font-size: 14px;
    margin-top: 1px;
}

@media (max-width: 768px) {
    .sms-guide-grid {
        grid-template-columns: 1fr;
    }
}

/* SMS Modal Form Styles */
.sms-modal-form {
    padding: 20px 24px;
}

.sms-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
}

.sms-form-row-single {
    grid-template-columns: 1fr;
    max-width: 50%;
}

.sms-form-field {
    display: flex;
    flex-direction: column;
}

.sms-form-field .form-label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.sms-form-field .custom-dropdown {
    width: 100%;
}

.sms-form-field .custom-dropdown-trigger {
    width: 100%;
    min-height: 38px;
}

.sms-form-field textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

@media (max-width: 640px) {
    .sms-form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .sms-form-row-single {
        max-width: 100%;
    }
    
    .sms-modal-form {
        padding: 16px 20px;
    }
}

/* Edit SMS Modal Guide Styles */
.sms-edit-guide-section {
    border-bottom: 1px solid #e2e8f0;
}

.sms-edit-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1e293b;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.sms-edit-guide-header:hover {
    background: #334155;
}

.sms-edit-guide-header i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.sms-edit-guide-section.expanded .sms-edit-guide-header i {
    transform: rotate(180deg);
}

.sms-edit-guide-content {
    display: none;
    padding: 16px 20px;
    background: #f8fafc;
}

.sms-edit-guide-section.expanded .sms-edit-guide-content {
    display: block;
}

.sms-edit-guide-content .sms-variable {
    padding: 5px 0;
    border-bottom: 1px solid #e2e8f0;
}

.sms-edit-guide-content .sms-variable:last-child {
    border-bottom: none;
}

/* SMS Guide Popover Styles */
.sms-label-with-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sms-guide-popover-wrapper {
    position: relative;
}

.sms-guide-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sms-guide-trigger:hover {
    background: #e2e8f0;
    color: #475569;
}

.sms-guide-trigger i {
    font-size: 13px;
}

.sms-guide-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.sms-guide-popover.show {
    display: block;
    animation: popoverFadeIn 0.15s ease;
}

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

.sms-guide-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.sms-guide-popover-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}

.sms-guide-popover-close:hover {
    color: #fff;
}

.sms-guide-popover-body {
    padding: 10px 12px;
}

.sms-variable-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #475569;
}

.sms-variable-compact code {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    font-weight: 500;
}

.sms-guide-popover-tip {
    padding: 8px 12px;
    background: #fefce8;
    border-top: 1px solid #fef08a;
    font-size: 11px;
    color: #854d0e;
}

/* SMS Info Banner (compact, always visible) */
.sms-info-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 12px;
    color: #0369a1;
}

.sms-info-banner i {
    font-size: 14px;
    color: #0ea5e9;
}

.sms-info-banner code {
    background: #e0f2fe;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
}

.sms-info-expand {
    margin-left: auto;
    background: none;
    border: none;
    color: #0369a1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.sms-info-expand:hover {
    color: #0284c7;
}

/* SMS Guide Panel (overlay style) */
.sms-guide-panel {
    display: none;
    position: absolute;
    top: 60px;
    left: 24px;
    right: 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 100;
    overflow: hidden;
}

.sms-guide-panel.show {
    display: block;
    animation: panelSlideIn 0.2s ease;
}

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

.sms-guide-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1e293b;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.sms-guide-panel-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.sms-guide-panel-close:hover {
    color: #fff;
}

.sms-guide-panel-body {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
}

.sms-guide-panel-example {
    padding: 10px 16px;
    background: #fefce8;
    border-top: 1px solid #fef08a;
    font-size: 11px;
    color: #854d0e;
}

.sms-guide-panel-example strong {
    font-weight: 600;
}

/* ============================================
   REUSABLE: Info Banner & Panel Overlay Pattern
   Use for contextual help that overlays rather than expands
   ============================================ */

/* Info Banner - compact inline helper */
.info-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    font-size: 12px;
    color: #0369a1;
}

.info-banner i {
    font-size: 14px;
    color: #0ea5e9;
    flex-shrink: 0;
}

.info-banner code {
    background: #e0f2fe;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
}

.info-banner-expand {
    margin-left: auto;
    background: none;
    border: none;
    color: #0369a1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    white-space: nowrap;
}

.info-banner-expand:hover {
    color: #0284c7;
}

/* Panel Overlay - floats over content */
.panel-overlay {
    display: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 100;
    overflow: hidden;
}

.panel-overlay.show {
    display: block;
    animation: panelSlideIn 0.2s ease;
}

.panel-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1e293b;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.panel-overlay-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.panel-overlay-close:hover {
    color: #fff;
}

.panel-overlay-body {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
}

.panel-overlay-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}

.panel-overlay-item code {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    font-weight: 500;
}

.panel-overlay-footer {
    padding: 10px 16px;
    background: #fefce8;
    border-top: 1px solid #fef08a;
    font-size: 11px;
    color: #854d0e;
}

/* Popover Trigger Button */
.popover-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.popover-trigger:hover {
    background: #e2e8f0;
    color: #475569;
}

.popover-trigger i {
    font-size: 13px;
}

/* Popover Dropdown - small floating panel */
.popover-dropdown {
    display: none;
    width: 260px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.popover-dropdown.show {
    display: block;
    animation: popoverFadeIn 0.15s ease;
}

.popover-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.popover-dropdown-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}

.popover-dropdown-close:hover {
    color: #fff;
}

.popover-dropdown-body {
    padding: 10px 12px;
}

.popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #475569;
}

.popover-item code {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    font-weight: 500;
}

.popover-dropdown-tip {
    padding: 8px 12px;
    background: #fefce8;
    border-top: 1px solid #fef08a;
    font-size: 11px;
    color: #854d0e;
}

/* Popover Wrapper for positioning */
.popover-wrapper {
    position: relative;
}

/* Search with Campaign Dropdown Styles */
.search-with-campaigns {
    position: relative;
}

.input-with-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-dropdown .form-control {
    padding-right: 40px;
}

.dropdown-toggle-btn {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 38px;
    background: #f8f9fa;
    border: none;
    border-left: 1px solid #dee2e6;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: all 0.15s ease;
}

.dropdown-toggle-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.dropdown-toggle-btn.active {
    background: #e9ecef;
}

.dropdown-toggle-btn.active i {
    transform: rotate(180deg);
}

/* ========================================
   Campaign Search Dropdown
   Combined input + dropdown pattern for selecting campaigns
   Kendo UI: ComboBox with filtering and custom template
======================================== */
.campaign-search-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.campaign-search-dropdown .form-control {
    padding-right: 40px;
}

.campaign-dropdown-toggle {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 36px;
    background: #f8f9fa;
    border: none;
    border-left: 1px solid #dee2e6;
    border-radius: 0 5px 5px 0;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.campaign-dropdown-toggle:hover {
    background: #e9ecef;
    color: #495057;
}

.campaign-dropdown-toggle i {
    transition: transform 0.2s ease;
}

.campaign-dropdown-toggle.active i {
    transform: rotate(180deg);
}

.campaign-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1100;
    max-height: 300px;
    overflow: hidden;
}

.campaign-dropdown-header {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.campaign-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
}

.campaign-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f1f3f4;
}

.campaign-dropdown-item:last-child {
    border-bottom: none;
}

.campaign-dropdown-item:hover {
    background: #f8f9fa;
}

.campaign-dropdown-item .campaign-name {
    font-size: 14px;
    color: #212529;
    font-weight: 500;
}

.campaign-dropdown-item .campaign-ndc-count {
    font-size: 12px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Campaign Dropdown Search */
.campaign-dropdown-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}

.campaign-dropdown-search i {
    color: #9ca3af;
    font-size: 14px;
}

.campaign-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #212529;
    background: transparent;
}

.campaign-search-input::placeholder {
    color: #9ca3af;
}

/* Campaign Item Layout */
.campaign-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Type Badges - Minimal nudge indicators */
.item-type-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.item-type-badge.type-campaign {
    background: #e0f2fe;
    color: #0369a1;
}

.item-type-badge.type-drug {
    background: #fef3c7;
    color: #92400e;
}

/* Empty state for dropdown */
.campaign-dropdown-empty {
    padding: 20px 14px;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
}

/* Hide items when filtering */
.campaign-dropdown-item.hidden {
    display: none;
}

