/* ============================================================
   OPTICARE MODERN UI - 2024 DESIGN SYSTEM
   Clean, Professional Healthcare Theme
============================================================ */

/* ============================================================
   CSS VARIABLES - LIGHT THEME (Default)
============================================================ */
:root {
    /* Primary palette - Calming teal/blue healthcare colors */
    --primary: #0891b2;
    --primary-hover: #0e7490;
    --primary-light: #ecfeff;
    --primary-dark: #155e75;
    
    /* Secondary accent */
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    
    /* Semantic colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Neutrals */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-active: #e2e8f0;
    
    /* Borders */
    --border-light: #e2e8f0;
    --border-default: #cbd5e1;
    --border-focus: var(--primary);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    
    /* Layout */
    --navbar-height: 64px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   DARK THEME VARIABLES
============================================================ */
html[data-theme="dark"] {
    --primary: #22d3ee;
    --primary-hover: #06b6d4;
    --primary-light: rgba(34, 211, 238, 0.1);
    --primary-dark: #0891b2;
    
    --accent: #a78bfa;
    --accent-hover: #8b5cf6;
    
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.1);
    --info: #60a5fa;
    --info-light: rgba(96, 165, 250, 0.1);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    --bg-body: #0c1222;
    --bg-surface: #1e293b;
    --bg-surface-elevated: #273449;
    --bg-hover: #334155;
    --bg-active: #475569;
    
    --border-light: #334155;
    --border-default: #475569;
    --border-focus: var(--primary);
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   BASE RESET & TYPOGRAPHY
============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    padding-top: var(--navbar-height);
    transition: background-color var(--transition-base), color var(--transition-base);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin: 0 0 1rem; color: var(--text-secondary); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--primary-hover); }

/* ============================================================
   NAVBAR (Legacy support - main styles in _NavbarPartial.cshtml)
============================================================ */
.navbar-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    z-index: 1100;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

/* ============================================================
   ICON BUTTONS (Shared utility)
============================================================ */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
    color: var(--text-primary);
}

/* ============================================================
   SIDEBAR - Modern Healthcare Design
============================================================ */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
    transition: width var(--transition-slow), transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Sidebar Navigation */
.sidebar .nav {
    padding: 0.75rem;
    list-style: none;
    margin: 0;
    flex: 1;
}

/* Section Headers */
.sidebar .nav-section {
    padding: 1rem 1rem 0.5rem;
    margin-top: 0.5rem;
}

.sidebar .nav-section:first-child {
    margin-top: 0;
}

.sidebar .nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0;
    padding: 0 0.25rem;
}

.sidebar .nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.75rem 0.75rem;
}

.sidebar .nav-item {
    margin-bottom: 2px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.7rem 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    border: 1px solid transparent;
}

.sidebar .nav-link .icon {
    width: 18px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: all var(--transition-fast);
}

.sidebar .nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.sidebar .nav-link:hover .icon {
    opacity: 1;
    color: var(--primary);
}

/* Active state - Modern pill style */
.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    border-color: transparent;
}

.sidebar .nav-link.active .icon {
    opacity: 1;
    color: white;
}

/* Submenu styles - Clean tree design */
.submenu-list {
    list-style: none;
    padding: 0.375rem 0 0.375rem 0;
    margin: 0;
    position: relative;
}

.submenu-list::before {
    content: '';
    position: absolute;
    left: 1.65rem;
    top: 0.375rem;
    bottom: 0.375rem;
    width: 1px;
    background: linear-gradient(180deg, var(--border-light) 0%, var(--primary-light) 50%, var(--border-light) 100%);
}

.submenu-list li {
    position: relative;
}

.submenu-list .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.875rem 0.55rem 2.75rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 450;
    transition: all var(--transition-fast);
    position: relative;
    text-decoration: none;
}

.submenu-list .dropdown-item::before {
    content: '';
    position: absolute;
    left: 1.65rem;
    top: 50%;
    width: 0.625rem;
    height: 1px;
    background: var(--border-default);
    transition: background var(--transition-fast);
}

.submenu-list .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.submenu-list .dropdown-item:hover::before {
    background: var(--primary);
}

.submenu-list .dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.submenu-list .dropdown-item.active::before {
    background: var(--primary);
    width: 0.75rem;
}

.submenu-list .dropdown-item i {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Dropdown toggle arrow - Smooth animation */
.sidebar .nav-link.dropdown-toggle::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: auto;
    transition: transform var(--transition-fast);
    opacity: 0.5;
}

.sidebar .nav-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg);
}

.sidebar .nav-link.dropdown-toggle:hover::after {
    opacity: 0.8;
}

/* Parent active state */
.sidebar .nav-item.parent-active > .nav-link {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(8, 145, 178, 0.15);
}

.sidebar .nav-item.parent-active > .nav-link .icon {
    opacity: 1;
    color: var(--primary);
}

/* Badge for notifications/counts */
.sidebar .nav-badge {
    margin-left: auto;
    padding: 0.15rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    background: var(--danger);
    color: white;
    min-width: 18px;
    text-align: center;
}

.sidebar .nav-badge.success {
    background: var(--success);
}

.sidebar .nav-badge.warning {
    background: var(--warning);
    color: var(--text-inverse);
}

/* User info at bottom */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-hover);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--bg-surface);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Collapsed sidebar */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar .nav-section,
body.sidebar-collapsed .sidebar .nav-divider {
    display: none;
}

body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

body.sidebar-collapsed .sidebar .nav-link .icon {
    margin: 0;
    font-size: 1.1rem;
}

body.sidebar-collapsed .sidebar .nav-link .nav-link-text,
body.sidebar-collapsed .sidebar .nav-link.dropdown-toggle::after,
body.sidebar-collapsed .sidebar .nav-badge {
    display: none;
}

body.sidebar-collapsed .sidebar .collapse,
body.sidebar-collapsed .sidebar .collapsing {
    display: none;
}

body.sidebar-collapsed .sidebar-footer {
    padding: 0.5rem;
}

body.sidebar-collapsed .sidebar-user-info {
    display: none;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 0.25rem;
}

/* Hover expand for collapsed */
body.sidebar-collapsed .sidebar:hover {
    width: var(--sidebar-width);
    box-shadow: var(--shadow-xl);
}

body.sidebar-collapsed .sidebar:hover .nav-section,
body.sidebar-collapsed .sidebar:hover .nav-divider {
    display: block;
}

body.sidebar-collapsed .sidebar:hover .nav-link {
    justify-content: flex-start;
    padding: 0.7rem 0.875rem;
}

body.sidebar-collapsed .sidebar:hover .nav-link .icon {
    font-size: 0.9rem;
}

body.sidebar-collapsed .sidebar:hover .nav-link .nav-link-text,
body.sidebar-collapsed .sidebar:hover .nav-link.dropdown-toggle::after,
body.sidebar-collapsed .sidebar:hover .nav-badge {
    display: inline-flex;
}

body.sidebar-collapsed .sidebar:hover .collapse.show {
    display: block;
}

body.sidebar-collapsed .sidebar:hover .sidebar-user-info {
    display: block;
}

body.sidebar-collapsed .sidebar:hover .sidebar-user {
    justify-content: flex-start;
    padding: 0.5rem;
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    
    .content {
        margin-left: 0;
    }
}

/* ============================================================
   MAIN CONTENT
============================================================ */
.content {
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    padding: 1.5rem 2rem;
    transition: margin-left var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.content main {
    flex: 1;
}

body.sidebar-collapsed .content {
    margin-left: var(--sidebar-collapsed-width);
}

/* ============================================================
   CARDS
============================================================ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

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

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Cards with p-0 body for tables */
.card-body.p-0 {
    padding: 0;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-hover);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-card .stat-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-card .stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-card .stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-card .stat-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-card .stat-icon.secondary {
    background: var(--bg-active);
    color: var(--text-secondary);
}

.stat-card .stat-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-active);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.btn-outline-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ============================================================
   FORMS
============================================================ */
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--bg-hover);
    cursor: not-allowed;
    opacity: 0.7;
}

.input-group {
    position: relative;
    display: flex;
}

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

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    background-color: var(--bg-hover);
    border: 1px solid var(--border-default);
}

/* ============================================================
   TABLES
============================================================ */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.table thead th {
    padding: 0.875rem 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-hover);
    border-bottom: 2px solid var(--border-light);
    text-align: left;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.table-responsive .table {
    margin-bottom: 0;
}

/* Custom table style */
.custom-table {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.custom-table thead th {
    background: var(--bg-hover);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.custom-table tbody td:last-child {
    background: transparent;
}

/* ============================================================
   BADGES & STATUS
============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.danger { background: var(--danger); }
.status-dot.info { background: var(--info); }

/* ============================================================
   MODALS - Ensure modals appear above navbar
============================================================ */
.modal {
    z-index: 1200 !important;
}

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

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    gap: 0.5rem;
}

.modal-backdrop.show {
    opacity: 0.6;
    backdrop-filter: blur(4px);
}

/* ============================================================
   DROPDOWNS
============================================================ */
.dropdown-menu {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-light);
}

/* ============================================================
   ALERTS
============================================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-color: var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border-color: var(--danger);
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border-color: var(--info);
}

/* ============================================================
   FOOTER - Modern Rounded Design
============================================================ */
.app-footer {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    padding: 0;
}

.app-footer .footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
    font-size: 0.8125rem;
    max-width: fit-content;
    margin: 0 auto;
}

.app-footer .footer-divider {
    color: var(--border-default);
    opacity: 0.5;
}

.app-footer .footer-tagline {
    color: var(--text-muted);
}

/* Legacy footer fallback */
footer:not(.app-footer) {
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
    margin-top: auto;
}

/* ============================================================
   ACTION BUTTONS (Table Actions)
============================================================ */
.action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.edit {
    color: var(--warning);
}
.action-btn.edit:hover {
    background: var(--warning-light);
}

.action-btn.delete {
    color: var(--danger);
}
.action-btn.delete:hover {
    background: var(--danger-light);
}

.action-btn.view {
    color: var(--info);
}
.action-btn.view:hover {
    background: var(--info-light);
}

.action-btn.print {
    color: var(--success);
}
.action-btn.print:hover {
    background: var(--success-light);
}

/* ============================================================
   SCROLLBAR (Global)
============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================
   OVERLAY (Mobile)
============================================================ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   Z-INDEX SYSTEM - Ensures modals appear above navbar (z-index: 1100)
============================================================ */
.modal { z-index: 1200 !important; }
.modal-backdrop { z-index: 1150 !important; }
.modal-dialog { z-index: 1200 !important; }

/* ============================================================
   MOBILE SIDEBAR CONTAINER
============================================================ */
.mobile-sidebar-container {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
}

.mobile-sidebar-container.open {
    transform: translateX(0);
}

.mobile-sidebar-container.open .sidebar-modern {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
}

body.no-scroll {
    overflow: hidden;
}

@media (min-width: 992px) {
    .mobile-sidebar-container {
        position: static;
        transform: none;
        width: auto;
        height: auto;
    }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
    }
    
    body.sidebar-collapsed .content {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .content {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================================
   UTILITIES
============================================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary-light { background: var(--primary-light) !important; }
.bg-success-light { background: var(--success-light) !important; }
.bg-warning-light { background: var(--warning-light) !important; }
.bg-danger-light { background: var(--danger-light) !important; }

.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ============================================================
   PAGE HEADER COMPONENT
============================================================ */
.page-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
    flex-shrink: 0;
}

.page-icon.sm {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

/* ============================================================
   MODAL HEADER ICON
============================================================ */
.modal-header-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.modal-header-icon,
.modal-header-icon.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.modal-header-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-header-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.modal-header-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.modal-header-icon.info {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================================
   MODERN DATATABLE STYLES
   Clean, minimal design like Linear/Notion
============================================================ */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 0.875rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_length {
    padding-bottom: 0;
}

.dataTables_wrapper .dataTables_filter {
    padding-bottom: 0;
}

.dataTables_wrapper .dataTables_info {
    padding: 1rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding: 1rem 1.25rem;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Modern Pagination - Pill-style buttons */
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    margin: 0 !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    background: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next {
    font-weight: 500;
    padding: 0 1rem;
}

.dataTables_wrapper .dataTables_paginate .ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_processing {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Modern Table Styling inside cards */
.card .dataTables_wrapper {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    overflow: hidden;
}

/* DataTable Footer - Info & Pagination Container */
.card .dataTables_wrapper > .row:last-child {
    background: var(--bg-hover);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin: 0 !important;
    padding: 0.75rem 0;
}

.card .dataTables_wrapper .dataTables_info {
    background: transparent;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.card .dataTables_wrapper .dataTables_paginate {
    background: transparent;
    padding: 0.75rem 1.5rem;
}

/* DataTable Header Row - Length selector */
.card .dataTables_wrapper > .row:first-child {
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin: 0 !important;
    padding: 0.75rem 0;
}

.card .dataTables_wrapper .dataTables_length {
    padding: 0.5rem 1.5rem;
}

.card .dataTables_wrapper .dataTables_filter {
    padding: 0.5rem 1.5rem;
}

/* DataTable header row styling */
table.dataTable thead th {
    background: var(--bg-hover) !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding: 1rem 1.25rem !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--text-secondary) !important;
    white-space: nowrap;
}

table.dataTable thead th:first-child {
    padding-left: 1.5rem !important;
}

table.dataTable thead th:last-child {
    padding-right: 1.5rem !important;
}

table.dataTable tbody td {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--border-light) !important;
    vertical-align: middle !important;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

table.dataTable tbody td:first-child {
    padding-left: 1.5rem !important;
}

table.dataTable tbody td:last-child {
    padding-right: 1.5rem !important;
}

table.dataTable tbody tr {
    transition: background-color var(--transition-fast);
}

table.dataTable tbody tr:hover {
    background-color: var(--bg-hover) !important;
}

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

/* Sorting indicators */
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: 0.4;
    font-size: 0.625rem;
    margin-left: 0.5rem;
}

table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: 1;
    color: var(--primary);
}

/* Empty table message */
table.dataTable tbody td.dataTables_empty {
    padding: 3rem 1rem !important;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive DataTables */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    background-color: var(--primary);
    border-radius: var(--radius-sm);
}

/* Row selection styling */
table.dataTable tbody tr.selected {
    background-color: var(--primary-light) !important;
}

/* ============================================================
   ENTITY AVATAR/ICON (for table rows)
============================================================ */
.entity-avatar {
    width: 36px;
    height: 36px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.entity-avatar.rounded {
    border-radius: 50%;
}

.entity-avatar.primary {
    background: var(--primary-light);
    color: var(--primary);
}

.entity-avatar.success {
    background: var(--success-light);
    color: var(--success);
}

.entity-avatar.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.entity-avatar.info {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================================
   EMPTY STATE COMPONENT
============================================================ */
.empty-state {
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-hover);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--text-muted);
    font-size: 2rem;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* ============================================================
   FILTER PANEL COMPONENT
============================================================ */
.filter-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
}

.filter-panel .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 0.875rem 1.25rem;
}

.filter-panel .card-body {
    padding: 1.25rem;
}

/* ============================================================
   CLICKABLE TABLE ROWS
============================================================ */
.table-clickable tbody tr {
    cursor: pointer;
}

.table-clickable tbody tr:active {
    background-color: var(--bg-active) !important;
}

/* ============================================================
   THEME-AWARE LOGOS
============================================================ */
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }

/* ============================================================
   STOREFRONT MODERN DESIGN SYSTEM
   Glassmorphism, rounded cards, modern typography
============================================================ */

/* Glassmorphism cards for storefront */
.checkout-section,
.cart-container,
.wishlist-card,
.product-gallery,
.product-card,
.calendar-card,
.slots-card,
.doctor-card,
.booking-container .wizard-step,
.login-card,
.register-card {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease !important;
}

html[data-theme="dark"] .checkout-section,
html[data-theme="dark"] .cart-container,
html[data-theme="dark"] .wishlist-card,
html[data-theme="dark"] .product-gallery,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .calendar-card,
html[data-theme="dark"] .slots-card,
html[data-theme="dark"] .doctor-card,
html[data-theme="dark"] .booking-container .wizard-step,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .register-card {
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Modern rounded buttons for storefront */
.btn-submit,
.btn-hero-primary,
.btn-hero-outline,
.cart-btn,
.mobile-cart-btn,
.mobile-wishlist-btn {
    border-radius: 14px !important;
}

/* Enhanced product cards hover */
.product-card:hover,
.wishlist-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
}

/* Modern form inputs on storefront */
.checkout-section .form-control,
.checkout-section .form-select,
.booking-container .form-control,
.booking-container .form-select {
    background: rgba(241, 245, 249, 0.8);
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 14px 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.checkout-section .form-control:focus,
.checkout-section .form-select:focus,
.booking-container .form-control:focus,
.booking-container .form-select:focus {
    background: white;
    border-color: #0891b2;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}

html[data-theme="dark"] .checkout-section .form-control,
html[data-theme="dark"] .checkout-section .form-select,
html[data-theme="dark"] .booking-container .form-control,
html[data-theme="dark"] .booking-container .form-select {
    background: rgba(51, 65, 85, 0.8);
}

html[data-theme="dark"] .checkout-section .form-control:focus,
html[data-theme="dark"] .checkout-section .form-select:focus,
html[data-theme="dark"] .booking-container .form-control:focus,
html[data-theme="dark"] .booking-container .form-select:focus {
    background: var(--bg-surface-elevated);
    border-color: #22d3ee;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
}

/* Modern storefront hero sections */
.shop-hero,
.cart-header,
.wishlist-header,
.checkout-header {
    border-radius: 0 0 24px 24px;
    position: relative;
    overflow: hidden;
}

/* Force white text in teal/gradient header areas */
.shop-hero h1, .shop-hero h2, .shop-hero h3, .shop-hero h4, .shop-hero h5, .shop-hero h6, .shop-hero p, .shop-hero i,
.cart-header h1, .cart-header h2, .cart-header p, .cart-header i,
.wishlist-header h1, .wishlist-header h2, .wishlist-header p, .wishlist-header i,
.checkout-header h1, .checkout-header h2, .checkout-header p, .checkout-header i,
.page-hero h1, .page-hero h2, .page-hero p, .page-hero i,
.login-card-header h1, .login-card-header p,
.register-card-header h1, .register-card-header p,
.size-hero h1, .size-hero h2, .size-hero p, .size-hero i,
.quiz-hero h1, .quiz-hero h2, .quiz-hero p, .quiz-hero i {
    color: white !important;
}

/* Modern section titles */
.section-title i,
.checkout-section .section-title i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    font-size: 1rem;
}

/* Product card image area glassmorphism */
.product-image {
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

/* Storefront footer glassmorphism */
.site-footer {
    position: relative;
    z-index: 1;
}

/* Modern alert/notification styles */
.alert {
    border-radius: 14px;
    border: none;
    backdrop-filter: blur(10px);
}

/* Smooth page transitions */
.cart-page,
.checkout-page,
.wishlist-page,
.product-page,
.booking-container {
    animation: storefrontFadeIn 0.5s ease-out;
}

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

/* Modern badges */
.badge-featured,
.badge-new,
.badge-sale,
.badge-custom,
.badge-tryon {
    border-radius: 10px !important;
    backdrop-filter: blur(10px);
    font-weight: 600;
}

/* Order confirmation, track order pages */
.order-confirmation,
.track-order-container {
    animation: storefrontFadeIn 0.5s ease-out;
}
