﻿/* ===================================
   THERAPYNOTES GLOBAL THEME
   =================================== */

/* CSS Variables for consistent theming */
:root {
    /* Primary Colors */
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;

    /* Secondary Colors */
    --secondary-color: #6b7280;
    --secondary-dark: #374151;
    --secondary-light: #f3f4f6;

    /* Status Colors */
    --success-color: #10b981;
    --success-dark: #059669;
    --success-light: #d1fae5;

    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --warning-light: #fef3c7;

    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #fee2e2;

    --info-color: #06b6d4;
    --info-dark: #0891b2;
    --info-light: #cffafe;

    /* Neutral Colors */
    --light-color: #f8fafc;
    --dark-color: #1f2937;
    --border-color: #e5e7eb;
    --text-muted: #6b7280;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Border Radius */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-size-xxs: 0.55rem;
    --font-size-xs: 0.65rem;
    --font-size-sm: 0.75rem;
    --font-size-base: 0.85rem;
    --font-size-lg: 0.95rem;
    --font-size-xl: 1.05rem;
    --font-size-2xl: 1.2rem;
    --font-size-3xl: 1.5rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===================================
   GLOBAL RESET & BASE STYLES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 90%;
    /* reduces everything to 90% of default */
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

/* ===================================
   TYPOGRAPHY
   =================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: var(--font-size-2xl);
}

h2 {
    font-size: var(--font-size-xl);
}

h3 {
    font-size: var(--font-size-lg);
}

h4 {
    font-size: var(--font-size-base);
}

h5 {
    font-size: var(--font-size-sm);
}

h6 {
    font-size: var(--font-size-xs);
}

p {
    margin-bottom: var(--spacing-md);
}

.text-muted {
    color: var(--text-muted) !important;
}

input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=color]),
select,
.input-group-text,
.input-group {
    height: 27px !important;
    line-height: 14px !important;
}

input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=color]) {
    padding: 8px 10px !important;
}

select {
    margin: 4 12px !important;
    padding-bottom: 5px !important;
}

.fw-semibold {
    font-weight: 600;
}

.fw-medium {
    font-weight: 500;
}

.fw-bold {
    font-weight: 700;
}

/* ===================================
   LAYOUT COMPONENTS
   =================================== */

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.page-title {
    color: white;
    font-weight: 700;
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

.page-header .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 10.5px;
}

/* Page-Header Buttons */
.page-header .btn-light {
    background: #fff;
    color: #2c3e50;
    border: none;
    font-size: 10px;
    padding: 4px 12px;
}

.page-header .btn-light:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.page-header .btn-outline-light {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.8);
    font-size: 10px;
    padding: 4px 12px;
}

.page-header .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Content Card */
.content-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.content-card-header {
    background: var(--light-color);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.content-card-title {
    color: var(--dark-color);
    font-weight: 600;
    font-size: var(--font-size-lg);
    margin-bottom: 0;
}

.content-card-body {
    background: white;
    padding: var(--spacing-lg);
}

.content-card-body.p-0 {
    padding: 0;
}

/* ===================================
   STATISTICS CARDS
   =================================== */

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card-body {
    padding: var(--spacing-lg);
}

.stat-card-title {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-value {
    color: var(--dark-color);
    font-weight: 700;
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-sm);
}

.stat-card-icon {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    opacity: 0.8;
}

/* Stat Card Variants */
.stat-card-primary .stat-card-icon {
    color: var(--primary-color);
}

.stat-card-success .stat-card-icon {
    color: var(--success-color);
}

.stat-card-warning .stat-card-icon {
    color: var(--warning-color);
}

.stat-card-danger .stat-card-icon {
    color: var(--danger-color);
}

.stat-card-info .stat-card-icon {
    color: var(--info-color);
}

/* ===================================
   TABLES
   =================================== */

.table {
    margin-bottom: 0;
    width: 100%;
}

.table-header {
    background: var(--light-color);
    border-bottom: 2px solid var(--border-color);
}

.table-header-cell {
    color: var(--dark-color);
    font-weight: 100;
    /* font-size: var(--font-size-xxs); */
    text-transform: uppercase;
    /* letter-spacing: 0.03em; */
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    vertical-align: middle;
}

.table-body {
    background: white;
}

.table-row {
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.table-row:hover {
    background-color: var(--light-color);
}

.table-cell {
    padding: var(--spacing-md) var(--spacing-lg);
    vertical-align: middle;
    border: none;
}

/* ===================================
   AVATARS
   =================================== */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    color: white;
}

.avatar-xs {
    width: 1.5rem;
    height: 1.5rem;
    font-size: var(--font-size-xs);
}

.avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
    font-size: var(--font-size-sm);
}

.avatar-md {
    width: 3rem;
    height: 3rem;
    font-size: var(--font-size-base);
}

.avatar-lg {
    width: 4rem;
    height: 4rem;
    font-size: var(--font-size-lg);
}

.avatar-xl {
    width: 5rem;
    height: 5rem;
    font-size: var(--font-size-xl);
}

.avatar-initial {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===================================
   BADGES
   =================================== */

.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    text-decoration: none;
}

.badge-role {
    background: var(--light-color);
    color: var(--dark-color);
    font-size: 0.6rem;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin-right: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
}

.status-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.status-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.status-info {
    background: var(--info-light);
    color: var(--info-dark);
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: var(--font-size-xs);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-base);
}

.btn-action {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: var(--spacing-xs);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.btn-action:hover {
    background: var(--light-color);
    color: var(--dark-color);
    border-color: var(--primary-color);
}

/* ===================================
   FORMS
   =================================== */



.form-control {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.15s ease;
    background: white;
    display: block;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.form-select {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.15s ease;
    background: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
    appearance: none;
    display: block;
    box-sizing: border-box;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select.is-invalid {
    border-color: #ef4444;
}

/* Small Form Controls */
.form-control.input-sm,
.form-select.input-sm,
.input-sm {
    padding: 0.4rem 0.6rem;
    font-size: 11px;
    border-radius: 4px;
    min-height: 32px;
    height: 32px;
    /* Force exact height for all controls */
    line-height: 1.4;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

/* Dropdown Options Styling - Aggressive Override */
select option,
.form-select option,
.form-select.input-sm option,
.input-group-triple select option {
    font-size: 11px !important;
    padding: 6px 10px !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 28px !important;
    display: block !important;
    white-space: nowrap !important;
    overflow: visible !important;
    background-color: white !important;
    color: #333 !important;
    border: none !important;
    margin: 0 !important;
}

/* All Form Selects Consistent Height */
.form-select {
    height: 32px;
    padding: 0.4rem 0.6rem;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    line-height: 1.4;
}

/* Ensure dropdown list has proper spacing */
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Override any conflicting Bootstrap styles for options */
select.form-select option {
    background-color: white !important;
    color: black !important;
}

/* Fix dropdown positioning and z-index issues */
.form-select {
    position: relative;
    z-index: 1;
}

.form-select:focus {
    z-index: 5;
}

/* Ensure dropdown options appear properly */
select.form-select {
    position: relative;
    z-index: 1;
    background-color: white;
    border: 1px solid var(--border-color);
}

select.form-select:focus {
    z-index: 10;
    position: relative;
}

/* Force dropdown to appear above other elements */
.form-select option {
    position: relative;
    z-index: 999;
    background-color: white;
    color: #333;
    padding: 8px 12px;
    border: none;
    display: block;
    width: 100%;
}

/* Fix for card overlapping dropdowns */
.card {
    position: relative;
    z-index: 1;
}

.form-select:focus {
    position: relative;
    z-index: 1000;
}

/* Additional dropdown fixes */
.input-group .form-select {
    z-index: 2;
}

.input-group .form-select:focus {
    z-index: 3;
}

/* Specific fix for Service Type dropdown positioning */
#service_type_id {
    position: relative;
    z-index: 10;
    /* Add size attribute to force dropdown to show more options */
    min-height: 38px;
}

#service_type_id:focus {
    position: relative;
    z-index: 1000;
    /* When focused, ensure it can expand */
    min-height: auto;
}

/* Force the Service Type dropdown to show multiple options */
#service_type_id[multiple] {
    height: auto !important;
    min-height: 150px;
}

/* Ensure Service Type dropdown options are positioned correctly */
#service_type_id option,
#service_type_id optgroup option {
    position: relative;
    z-index: 1001;
    background-color: white !important;
    color: #333 !important;
    padding: 8px 12px !important;
    border: none;
    display: block;
    width: 100%;
    min-height: 32px;
    line-height: 1.5;
    white-space: nowrap;
}

/* Force native dropdown to expand properly */
#service_type_id:focus,
#service_type_id:active {
    position: relative;
    z-index: 9999;
    transform: translateZ(0);
}

/* Service Type dropdown container needs proper stacking */
.service-code-card .mb-3:has(#service_type_id) {
    position: relative;
    z-index: 100;
    overflow: visible !important;
    /* Add extra margin bottom to give space for dropdown expansion */
    margin-bottom: 3rem !important;
    padding-bottom: 1rem;
}

/* Ensure the entire form section containing service type has proper z-index */
.service-code-card .card-body {
    position: relative;
    z-index: 2;
    overflow: visible !important;
    /* Prevent any height restrictions that might clip dropdown */
    min-height: auto;
    height: auto;
}

/* Fix parent containers that might be clipping the dropdown */
.service-code-card {
    overflow: visible !important;
}

.service-code-card .card {
    overflow: visible !important;
}

/* Alternative approach for browsers that don't support :has() */
.service-code-card .mb-3 {
    overflow: visible !important;
}

/* Ensure all parent containers allow overflow */
.container-fluid,
.row,
.col-lg-8 {
    overflow: visible !important;
}

/* Force Service Type dropdown to appear above other content */
select#service_type_id {
    position: relative;
    z-index: 50;
}

select#service_type_id:focus {
    position: relative;
    z-index: 1050;
}

/* Ensure Service Type optgroups display properly */
#service_type_id optgroup {
    background-color: #f8f9fa !important;
    color: #6b7280 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
}

/* Service Type optgroup options styling */
#service_type_id optgroup option {
    background-color: white !important;
    color: #333 !important;
    font-weight: normal !important;
    padding-left: 20px !important;
    font-size: 13px !important;
}



/* Default Form Controls (for consistency across project) */
.form-control:not(textarea),
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"] {
    height: 32px;
    padding: 0.4rem 0.6rem;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    line-height: 1.4;
}

/* Textarea Specific Styling */
textarea,
.form-control.textarea {
    height: auto;
    min-height: 25px;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    line-height: 1.4;
    resize: vertical;
}

/* Textarea Placeholder Styling */
textarea::placeholder,
.form-control.textarea::placeholder {
    font-size: 10px;
    color: #9ca3af;
    opacity: 0.8;
}

/* Input Groups Project Wide */
.input-group {
    display: flex;
    width: 100%;
}

.input-group .form-control,
.input-group .form-select,
.input-group .btn,
.input-group .input-group-text,
.form-check {
    height: 27px;
    border-radius: 0;
}

.input-group .form-control:first-child,
.input-group .form-select:first-child,
.input-group .input-group-text:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.input-group .btn:last-child,
.input-group .input-group-text:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-left: 0;
}

.input-group .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem;
}

.form-group.form-group-sm {
    margin-bottom: 12px;
}

.form-group.form-group-sm .form-label {
    margin-bottom: 4px;
    font-size: var(--font-size-xs);
}

/* Compact Form Layout */
.form-dense .form-group {
    margin-bottom: 12px;
}

.form-dense .row {
    margin-bottom: 6px;
}

.row-compact {
    margin-bottom: 6px;
}

/* Input Group Small */
.input-group.input-group-sm .form-control,
.input-group.input-group-sm .form-select,
.input-group.input-group-sm .btn {
    padding: 0.3rem 0.5rem;
    /* Consistent with input-sm */
    font-size: var(--font-size-xs);
    min-height: 30px;
    height: 30px;
    /* Force exact height */
    line-height: 1.3;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

/* Input Group Border Radius Fix */
.input-group.input-group-sm .form-control:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group.input-group-sm .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.input-group.input-group-sm .btn {
    padding: 0.3rem 0.5rem;
    /* Consistent padding for buttons */
    height: 30px;
    /* Force exact height for buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 0;
    /* Remove left border for seamless connection */
}

/* Ensure input-group-text matches input height in small groups */
.input-group.input-group-sm .input-group-text {
    padding: 0.3rem 0.5rem;
    font-size: var(--font-size-xs);
    height: 30px;
    min-height: 30px;
    line-height: 1.3;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

/* Proper border radii for small input groups */
.input-group.input-group-sm .input-group-text:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group.input-group-sm .input-group-text:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0;
}

/* Input Group Focus States */
.input-group.input-group-sm .form-control:focus {
    z-index: 2;
}

.input-group.input-group-sm .btn:focus {
    z-index: 3;
}

/* Fix Input Group Alignment Issues */
.input-group.input-group-sm {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group.input-group-sm .form-control {
    flex: 1;
    margin: 0;
}

/* Only remove the right border when the control is not the last child */
.input-group.input-group-sm .form-control:not(:last-child) {
    border-right: 0;
}

.input-group.input-group-sm .btn {
    flex: 0 0 auto;
    margin: 0;
    border-left: 0;
    font-size: var(--font-size-xs);
}

/* Remove any conflicting margins */
.input-group.input-group-sm>* {
    margin: 0 !important;
}

.form-check-input {
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    margin-right: 0.25rem;
    vertical-align: top;
    background-color: white;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid #e5e7eb;
    appearance: none;
    color-adjust: exact;
}

.form-check-input[type="checkbox"] {
    border-radius: 0.25em;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type="radio"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3ccircle cx='10' cy='10' r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    border-color: #3b82f6;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-check-label {
    margin-bottom: 0;
    cursor: pointer;
}

.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group>.form-control,
.input-group>.form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    color: #1f2937;
    text-align: center;
    white-space: nowrap;
    background-color: #f3f4f6;
    /* height: 32px; */
    /* min-height: 32px; */
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.input-group>.form-control:not(:last-child),
.input-group>.form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group>.form-control:not(:first-child),
.input-group>.form-select:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group>.input-group-text:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group>.input-group-text:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.form-label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #1f2937;
    font-size: 0.875rem;
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
    display: block;
}

.form-text {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Required field indicator */
.form-label:has(+ input[required])::after,
.form-label:has(+ select[required])::after {
    content: " *";
    color: #ef4444;
}

/* Alternative for browsers that don't support :has() */
.form-label.required::after {
    content: " *";
    color: #ef4444;
}

/* Additional form styling to ensure proper appearance */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: 0.15s ease;
    background: white;
    display: block;
    box-sizing: border-box;
}

/* Custom dropdown styling that doesn't interfere with input groups */
.dropdown-fixed {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.15s ease;
    background: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
    appearance: none;
    display: block;
    box-sizing: border-box;
}

.dropdown-fixed:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Specific styling for form-select that preserves input group layout */
.form-select:not(.input-group .form-select) {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: 0.15s ease;
    background: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
    appearance: none;
    display: block;
    box-sizing: border-box;
}

.form-select:not(.input-group .form-select):focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Specific styling for dropdowns within input groups */
.input-group .form-select {
    border: 1px solid #e5e7eb;
    background: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
    appearance: none;
}

.input-group .form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Ensure all select elements in input groups have borders */
.input-group select {
    border: 1px solid #e5e7eb;
    background: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 16px 12px;
    appearance: none;
}

.input-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Textarea Focus Styling */
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===================================
   ALERTS
   =================================== */

.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-dark);
}

.alert-danger {
    background-color: var(--danger-light);
    border-color: var(--danger-color);
    color: var(--danger-dark);
}

.alert-warning {
    background-color: var(--warning-light);
    border-color: var(--warning-color);
    color: var(--warning-dark);
}

.alert-info {
    background-color: var(--info-light);
    border-color: var(--info-color);
    color: var(--info-dark);
}

/* ===================================
   EMPTY STATES
   =================================== */

.empty-state {
    padding: var(--spacing-2xl) var(--spacing-md);
    text-align: center;
}

.empty-state i {
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.empty-state h5 {
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

/* ===================================
   EHR MEDICAL ALERT
   =================================== */

/* EHR Medical Alert Component */
.ehr-medical-alert {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.ehr-medical-alert:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.ehr-medical-alert-icon {
    width: 20px;
    height: 20px;
    background: #0ea5e9;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
    transition: var(--transition-fast);
}

.ehr-medical-alert-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.4);
}

.ehr-medical-alert-text {
    font-size: 14px;
    color: #0c4a6e;
    line-height: 1.5;
    flex-grow: 1;
}

.ehr-medical-alert-link {
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    border-bottom: 1px solid transparent;
}

.ehr-medical-alert-link:hover {
    color: #0369a1;
    text-decoration: none;
    border-bottom-color: #0369a1;
}

/* Alert Variants */
.ehr-medical-alert.success {
    background: var(--success-light);
    border-color: rgba(16, 185, 129, 0.3);
}

.ehr-medical-alert.success .ehr-medical-alert-icon {
    background: var(--success-color);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.ehr-medical-alert.success .ehr-medical-alert-text {
    color: var(--success-dark);
}

.ehr-medical-alert.success .ehr-medical-alert-link {
    color: var(--success-dark);
}

.ehr-medical-alert.warning {
    background: var(--warning-light);
    border-color: rgba(245, 158, 11, 0.3);
}

.ehr-medical-alert.warning .ehr-medical-alert-icon {
    background: var(--warning-color);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.ehr-medical-alert.warning .ehr-medical-alert-text {
    color: var(--warning-dark);
}

.ehr-medical-alert.warning .ehr-medical-alert-link {
    color: var(--warning-dark);
}

.ehr-medical-alert.danger {
    background: var(--danger-light);
    border-color: rgba(239, 68, 68, 0.3);
}

.ehr-medical-alert.danger .ehr-medical-alert-icon {
    background: var(--danger-color);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.ehr-medical-alert.danger .ehr-medical-alert-text {
    color: var(--danger-dark);
}

.ehr-medical-alert.danger .ehr-medical-alert-link {
    color: var(--danger-dark);
}

.ehr-medical-alert.info {
    background: var(--info-light);
    border-color: rgba(6, 182, 212, 0.3);
}

.ehr-medical-alert.info .ehr-medical-alert-icon {
    background: var(--info-color);
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

.ehr-medical-alert.info .ehr-medical-alert-text {
    color: var(--info-dark);
}

.ehr-medical-alert.info .ehr-medical-alert-link {
    color: var(--info-dark);
}

/* Responsive Design for EHR Alerts */
@media (max-width: 768px) {
    .ehr-medical-alert {
        padding: 12px;
        gap: 10px;
        margin-bottom: 20px;
    }

    .ehr-medical-alert-text {
        font-size: 13px;
    }

    .ehr-medical-alert-icon {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .ehr-medical-alert {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .ehr-medical-alert-icon {
        align-self: flex-start;
    }
}

/* ===================================
   UTILITIES
   =================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.d-flex {
    display: flex;
}

.d-inline-flex {
    display: inline-flex;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.flex-grow-1 {
    flex-grow: 1;
}

.flex-wrap {
    flex-wrap: wrap;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.mb-5 {
    margin-bottom: var(--spacing-xl);
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.mt-5 {
    margin-top: var(--spacing-xl);
}

.me-1 {
    margin-right: var(--spacing-xs);
}

.me-2 {
    margin-right: var(--spacing-sm);
}

.me-3 {
    margin-right: var(--spacing-md);
}

.ms-1 {
    margin-left: var(--spacing-xs);
}

.ms-2 {
    margin-left: var(--spacing-sm);
}

.ms-3 {
    margin-left: var(--spacing-md);
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: var(--spacing-xs);
}

.p-2 {
    padding: var(--spacing-sm);
}

.p-3 {
    padding: var(--spacing-md);
}

.p-4 {
    padding: var(--spacing-lg);
}

.p-5 {
    padding: var(--spacing-xl);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .page-header {
        padding: var(--spacing-md);
    }

    .stat-card-body {
        padding: var(--spacing-md);
    }

    .content-card-header {
        padding: var(--spacing-md);
    }

    .content-card-body {
        padding: var(--spacing-md);
    }

    .table-cell {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .action-buttons {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .btn-action {
        padding: var(--spacing-xs);
    }

    .stat-card-value {
        font-size: var(--font-size-2xl);
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: var(--font-size-xl);
    }

    .stat-card-value {
        font-size: var(--font-size-xl);
    }

    .table-responsive {
        font-size: var(--font-size-sm);
    }
}

/* ===================================
   PAGE LOADER STYLES
   =================================== */

@keyframes pulse-wave {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Page Loader - Semi-Light Overlay Style */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.8) 0%, rgba(59, 130, 246, 0.6) 50%, rgba(16, 185, 129, 0.4) 100%);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-loader.hide {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
}

.page-loader-content {
    text-align: center;
    color: white;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-loader-logo {
    width: 320px;
    height: 200px;
    margin: 0 auto 2rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ProgressiveDocs logo styling for page loader */
.page-loader-logo .progressivedocs-logo {
    width: 250px;
    height: auto;
    z-index: 2;
    position: relative;
    filter: brightness(0) invert(1) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% {
        filter: brightness(0) invert(1) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4)) brightness(1);
    }

    100% {
        filter: brightness(0) invert(1) drop-shadow(0 8px 20px rgba(255, 255, 255, 0.3)) brightness(1.1);
    }
}

.page-loader-logo .heartbeat-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 160px;
    height: 160px;
}

.page-loader-logo .pulse-wave {
    position: absolute;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    animation: pulse-wave 2s infinite;
    opacity: 0;
}

.page-loader-logo .pulse-wave.wave-1 {
    width: 80px;
    height: 80px;
    top: calc(50% - 40px);
    left: calc(50% - 40px);
    animation-delay: 0s;
    border-color: #3b82f6;
    border-width: 3px;
}

.page-loader-logo .pulse-wave.wave-2 {
    width: 120px;
    height: 120px;
    top: calc(50% - 60px);
    left: calc(50% - 60px);
    animation-delay: 0.5s;
    border-color: #10b981;
    border-width: 2px;
}

.page-loader-logo .pulse-wave.wave-3 {
    width: 160px;
    height: 160px;
    top: calc(50% - 80px);
    left: calc(50% - 80px);
    animation-delay: 1s;
    border-color: #1e3a8a;
    border-width: 1px;
}

.page-loader-text {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-loader-subtext {
    font-size: 1rem;
    opacity: 0.8;
    color: #e5e7eb;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===================================
   OPERATIONAL LOADER STYLES
   (for tabs, forms, and small elements)
   =================================== */

.operational-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
    transition: opacity 0.3s ease-in-out;
    /* Ensure perfect centering */
    text-align: center;
}

.operational-loader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Operational Loader Container */
.operational-loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Operational Loading Text */
.operational-loading-text {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Operational Pulse Loader */
.operational-pulse-loader {
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: operational-pulse 1.5s ease-in-out infinite;
}

.operational-pulse-loader.small {
    width: 16px;
    height: 16px;
}

.operational-pulse-loader.large {
    width: 28px;
    height: 28px;
}

@keyframes operational-pulse {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Different Size Variants */
.operational-loader-overlay.compact {
    padding: 10px;
}

.operational-loader-overlay.compact .operational-pulse-loader {
    width: 16px;
    height: 16px;
}

.operational-loader-overlay.compact .operational-loading-text {
    font-size: 10px;
    margin-top: 4px;
}

/* Theme Variants */
.operational-loader-overlay.dark {
    background-color: rgba(0, 0, 0, 0.7);
}

.operational-loader-overlay.dark .operational-loading-text {
    color: #fff;
}

.operational-loader-overlay.dark .operational-pulse-loader {
    background-color: #fff;
}

.operational-loader-overlay.light {
    background-color: rgba(255, 255, 255, 0.95);
}

/* Button/Small Element Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-loading .original-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-loading .operational-loader-overlay {
    position: relative;
    background-color: transparent;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-loading .operational-loader-container {
    flex-direction: row;
    gap: 8px;
}

.btn-loading .operational-pulse-loader {
    position: relative;
    margin: 0;
    background-color: white !important;
}

.btn-loading .operational-loading-text {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* Card/Panel Loading */
.card-loading {
    position: relative;
    overflow: hidden;
}

/* Operational Loader Utilities */
.operational-loader-hidden {
    display: none !important;
}

.operational-loader-visible {
    display: flex !important;
}

/* Mobile Responsiveness for Operational Loader */
@media (max-width: 768px) {
    .operational-loader-overlay {
        backdrop-filter: blur(1px);
        -webkit-backdrop-filter: blur(1px);
    }

    .operational-pulse-loader {
        width: 18px;
        height: 18px;
    }

    .operational-loading-text {
        font-size: 11px;
    }
}

/* Staff name link hover effect */
.hover-primary:hover {
    color: #3b82f6 !important;
    transition: color 0.2s ease;
}

/* Custom Popup System */
.custom-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-popup-overlay.show {
    display: flex;
    opacity: 1;
}

.custom-popup {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    margin: 20px;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
}

.custom-popup-overlay.show .custom-popup {
    transform: scale(1) translateY(0);
}

.custom-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-popup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: popup-shimmer 3s ease-in-out infinite;
}

@keyframes popup-shimmer {

    0%,
    100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }
}

.custom-popup-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff !important;
    margin: 0;
    position: relative;
    z-index: 1;
    padding-right: 70px;
}

.custom-popup-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 22px;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.custom-popup-close:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2);
}

.custom-popup-icon {
    display: none !important;
}

.custom-popup-body {
    padding: 20px 24px 20px;
    text-align: left;
}

.custom-popup-message {
    font-size: 0.95rem;
    color: #374151;
    margin: 0 0 16px 0;
    line-height: 1.5;
    display: block !important;
}

.custom-popup-content {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    border-left: 4px solid #3b82f6;
}

/* Appointment popup fine-tuning */
.custom-popup .appt-grid {
    margin-top: 2px;
}

.custom-popup .appt-label {
    font-size: 13px;
}

.custom-popup .appt-input,
.custom-popup .appt-select,
.custom-popup .appt-textarea {
    font-size: 13px;
}

.custom-popup-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.custom-popup-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 95px;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-popup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.custom-popup-btn:hover::before {
    left: 100%;
}

.custom-popup-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.custom-popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.custom-popup-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.custom-popup-btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.custom-popup-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.custom-popup-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.custom-popup-btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.custom-popup-btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.custom-popup-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.custom-popup-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Popup Types Header Backgrounds & Icons */
.custom-popup.confirmation .custom-popup-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.custom-popup.warning .custom-popup-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.custom-popup.danger .custom-popup-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.custom-popup.success .custom-popup-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.custom-popup.info .custom-popup-header {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* Responsive */
@media (max-width: 480px) {
    .custom-popup {
        width: 95%;
        margin: 10px;
    }

    .custom-popup-actions {
        flex-direction: column;
    }

    .custom-popup-btn {
        width: 100%;
    }
}

/* Animation for popup content */
.custom-popup-content {
    animation: popup-content-fade 0.4s ease-out;
}

@keyframes popup-content-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for buttons */
.custom-popup-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.custom-popup-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: popup-btn-spin 1s linear infinite;
}

@keyframes popup-btn-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Textarea compact height with slight expansion on focus */
.expandible-textarea {
    min-height: 2.25rem;
    height: 2.25rem;
    max-height: 16rem;
    overflow: auto;
    transition: height .2s ease, min-height .2s ease;
    resize: vertical;
}

.expandible-textarea:focus {
    min-height: 5rem;
    height: 5rem;
}