/**
 * MEDRS - Admin Global Stylesheet
 * 
 * This file contains core styling for admin areas with customizable branding.
 * Brand colors and styling can be customized per client via CSS variables.
 * 
 * DO NOT use inline CSS. Always use classes defined here or Bootstrap utilities.
 */

/* ========================================================================
   CSS CUSTOM PROPERTIES (VARIABLES) - CLIENT CUSTOMIZABLE
   ======================================================================== */

:root {
    /* Primary Brand Colors - Customizable per client */
    --brand-primary: #2563eb;           /* Main brand color */
    --brand-primary-dark: #1e40af;      /* Darker shade for hover states */
    --brand-primary-light: #3b82f6;     /* Lighter shade */
    --brand-secondary: #64748b;         /* Secondary brand color */
    --brand-accent: #f59e0b;            /* Accent color for highlights */
    
    /* Sidebar Colors - Customizable */
    --sidebar-bg: #1e293b;              /* Sidebar background */
    --sidebar-text: #e2e8f0;            /* Sidebar text color */
    --sidebar-hover: #334155;           /* Sidebar hover background */
    --sidebar-hover-text: #ffffff;      /* Sidebar hover text color */
    --sidebar-active: var(--brand-primary); /* Active menu item */
    --sidebar-width: 260px;             /* Sidebar width */
    
    /* Topbar Colors - Customizable */
    --topbar-bg: #ffffff;               /* Top navigation background */
    --topbar-text: #334155;             /* Top navigation text */
    --topbar-border: #e2e8f0;           /* Top navigation border */
    
    /* Content Area */
    --content-bg: #f8fafc;              /* Main content background */
    --card-bg: #ffffff;                 /* Card background */
    --card-border: #e2e8f0;             /* Card border color */
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    
    /* Text Colors */
    --text-primary: #1e293b;            /* Primary text color */
    --text-secondary: #64748b;          /* Secondary text color */
    --text-muted: #94a3b8;              /* Muted text color */
    
    /* Status Colors - Usually consistent across clients */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    /* Form Elements */
    --input-border: #cbd5e1;
    --input-focus-border: var(--brand-primary);
    --input-bg: #ffffff;
    
    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    --font-family-dyslexie: "OpenDyslexic", var(--font-family-base);
    
    /* Spacing */
    --header-height: 64px;
    --footer-height: 60px;
    
    /* Transitions */
    --transition-base: all 0.3s ease;
    
    /* Border Radius */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 0.75rem;
}

/* ========================================================================
   OPENDYSLEXIC FONT SUPPORT
   ======================================================================== */

/**
 * OpenDyslexic Font - Free, open-source font designed to improve readability for people with dyslexia
 * 
 * Font files are from: https://opendyslexic.org/
 * 
 * Font files location: public/fonts/dyslexie/opendyslexic-0.91.12/compiled/
 */

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Regular.woff2') format('woff2'),
         url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Regular.woff') format('woff'),
         url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Bold.woff2') format('woff2'),
         url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Bold.woff') format('woff'),
         url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Italic.woff2') format('woff2'),
         url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Italic.woff') format('woff'),
         url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic';
    src: url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Bold-Italic.woff2') format('woff2'),
         url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Bold-Italic.woff') format('woff'),
         url('/fonts/dyslexie/opendyslexic-0.91.12/compiled/OpenDyslexic-Bold-Italic.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* Apply OpenDyslexic Font when enabled */
body.use-dyslexie-font,
body.use-dyslexie-font * {
    font-family: var(--font-family-dyslexie) !important;
}

/* Reduce header font sizes when OpenDyslexic is enabled */
/* OpenDyslexic font appears larger, so we reduce header sizes proportionally */

/* Large display headings (display-1 through display-6) */
body.use-dyslexie-font .display-1 {
    font-size: 2rem !important; /* Reduced from ~5rem */
}

body.use-dyslexie-font .display-2 {
    font-size: 1.75rem !important; /* Reduced from ~4.5rem */
}

body.use-dyslexie-font .display-3 {
    font-size: 1.5rem !important; /* Reduced from ~4rem */
}

body.use-dyslexie-font .display-4 {
    font-size: 1.375rem !important; /* Reduced from ~3.5rem */
}

body.use-dyslexie-font .display-5 {
    font-size: 1.25rem !important; /* Reduced from ~3rem */
}

body.use-dyslexie-font .display-6 {
    font-size: 1.125rem !important; /* Reduced from ~2.5rem */
}

/* Standard headings */
body.use-dyslexie-font h1,
body.use-dyslexie-font .h1 {
    font-size: 1.375rem !important; /* Reduced from default ~2.5rem */
}

body.use-dyslexie-font h2,
body.use-dyslexie-font .h2,
body.use-dyslexie-font .page-header-title {
    font-size: 1.25rem !important; /* Reduced from 1.75rem */
}

body.use-dyslexie-font h3,
body.use-dyslexie-font .h3,
body.use-dyslexie-font .page-title {
    font-size: 1.125rem !important; /* Reduced from 1.25rem */
}

body.use-dyslexie-font h4,
body.use-dyslexie-font .h4,
body.use-dyslexie-font .card-title,
body.use-dyslexie-font .card-custom-title {
    font-size: 1rem !important;
}

body.use-dyslexie-font h5,
body.use-dyslexie-font .h5 {
    font-size: 0.9375rem !important;
}

body.use-dyslexie-font h6,
body.use-dyslexie-font .h6 {
    font-size: 0.875rem !important;
}

/* Reduce lead text size */
body.use-dyslexie-font .lead {
    font-size: 1rem !important; /* Reduced from default 1.25rem */
}

/* Reduce navbar brand size */
body.use-dyslexie-font .navbar-brand {
    font-size: 1.25rem !important; /* Reduced from 1.5rem */
}

/* Reduce feature icon sizes on public pages */
body.use-dyslexie-font .feature-icon {
    font-size: 2rem !important; /* Reduced from 3rem */
}

/* ========================================================================
   GLOBAL RESETS & BASE STYLES
   ======================================================================== */

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

body {
    font-family: var(--font-family-base);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--content-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--brand-primary-dark);
}

/* ========================================================================
   ADMIN LAYOUT STRUCTURE
   ======================================================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--content-bg);
}

/* Sidebar Navigation */
.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: var(--transition-base);
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Logo/Brand */
.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    background-color: white;
}

/* When client logo is present: vertical layout (logos on top, text below) */
.sidebar-brand.has-client-logo {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

/* When no client logo: horizontal layout (logo and text side-by-side) */
.sidebar-brand.no-client-logo {
    flex-direction: row;
    gap: 0.75rem;
    text-align: left;
}

.sidebar-brand-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

/* Logo sizing when client logo present */
.sidebar-brand.has-client-logo .sidebar-brand-logo {
    height: auto;
    width: auto;
    max-height: 60px;
    max-width: 100px;
    object-fit: contain;
    flex-shrink: 1;
}

.sidebar-brand.has-client-logo .sidebar-brand-logo.sidebar-client-logo {
    max-height: 80px;
    max-width: 120px;
    flex-shrink: 1;
}

/* Logo sizing when no client logo (standard size) */
.sidebar-brand.no-client-logo .sidebar-brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.sidebar-brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Sidebar User Section */
.sidebar-user-section {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

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

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

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Sidebar Quick Actions */
.sidebar-quick-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.sidebar-quick-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--border-radius-md);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition-base);
    position: relative;
    cursor: pointer;
    font-size: 0.9375rem;
}

.sidebar-quick-action:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.sidebar-notification-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background-color: var(--color-danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Notification dropdown in sidebar */
.sidebar-quick-actions .dropdown {
    position: relative;
}

.sidebar-quick-actions .dropdown-menu {
    position: absolute;
    left: auto;
    right: auto;
    top: 100%;
    margin-top: 0.5rem;
    z-index: 1050;
    min-width: 200px;
    max-width: 300px;
}

/* Desktop: Show to the right of sidebar */
@media (min-width: 769px) {
    .sidebar-quick-actions .dropdown-menu {
        left: 100%;
        right: auto;
        top: 0;
        margin-left: 0.5rem;
        margin-top: 0;
    }
}

/* Mobile: Show below button, aligned to the right */
@media (max-width: 768px) {
    .sidebar-quick-actions .dropdown-menu {
        left: auto;
        right: 0;
        top: 100%;
        margin-top: 0.5rem;
        margin-left: 0;
        max-width: calc(100vw - 2rem);
    }
    
    /* Ensure dropdown is visible in mobile sidebar */
    .admin-sidebar.mobile-open .sidebar-quick-actions .dropdown-menu {
        position: fixed;
        right: 1rem;
        left: auto;
        top: auto;
    }
}

/* Sidebar Navigation Menu */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu-item {
    margin-bottom: 0.25rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition-base);
    gap: 0.75rem;
    border-left: 3px solid transparent;
}

.sidebar-menu-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-hover-text);
}

.sidebar-badge {
    margin-left: auto;
    background-color: var(--color-danger);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-menu-link.active {
    background-color: var(--sidebar-hover);
    border-left-color: var(--sidebar-active);
    color: var(--sidebar-hover-text);
}

.sidebar-menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-menu-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Sidebar Section Headers */
.sidebar-section-header {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
   /* color: var(--text-muted); */
    opacity: 0.7;
}

/* Main Content Area */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition-base);
}

/* Top Navigation Bar - Minimal & Clean */
.admin-topbar {
    background-color: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Single Row: Just Search (Prominent) */
.topbar-search-row {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Page Title in Topbar */
.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Search Bar in Topbar */
.topbar-search-container {
    /* Flex: 1 allows it to grow and fill available space */
    /* Width is now controlled by flex property in the HTML */
}

.topbar-search {
    position: relative;
    width: 100%;
}

.topbar-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-lg);
    font-size: 0.9375rem;
    transition: var(--transition-base);
    background-color: var(--content-bg);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: white;
}

.topbar-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.125rem;
}

.topbar-search-options {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding: 0 0.25rem;
}

.topbar-search-options .form-check {
    margin-bottom: 0;
}

.topbar-search-options .form-check-label {
    color: var(--text-secondary);
    user-select: none;
    font-weight: 500;
}

/* Topbar Notifications */
.topbar-notifications {
    display: flex;
    align-items: flex-start; /* Align to top of row */
    align-self: flex-start; /* Align to top of flex container */
}

.topbar-notifications .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}


/* Content Container */
.admin-content {
    flex: 1;
    padding: 2rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ========================================================================
   CARDS & PANELS
   ======================================================================== */

.card-custom {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.card-custom-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-custom-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-custom-body {
    padding: 1.5rem;
}

.card-custom-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--card-border);
    background-color: var(--content-bg);
    border-bottom-left-radius: var(--border-radius-lg);
    border-bottom-right-radius: var(--border-radius-lg);
}

/* ========================================================================
   BUTTONS - Enhanced Bootstrap Buttons
   ======================================================================== */

.btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    transition: var(--transition-base);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    color: white;
}

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
}

/* ========================================================================
   FORMS & INPUTS
   ======================================================================== */

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

.form-control {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-md);
    background-color: var(--input-bg);
    transition: var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group {
    margin-bottom: 1.25rem;
}

/* ========================================================================
   TABLES - Enhanced Bootstrap Tables
   ======================================================================== */

.table-custom {
    width: 100%;
    background-color: var(--card-bg);
    border-collapse: collapse;
}

.table-custom thead th {
    background-color: var(--content-bg);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 2px solid var(--card-border);
}

.table-custom tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 0.875rem;
}

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

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

.review-table-container {
    max-height: 60vh;
    overflow-y: auto;
}

.review-table-header th {
    background-color: var(--card-header) !important;
    color: var(--card-header-text) !important;
    border-bottom: 2px solid var(--card-border);
    z-index: 2;
}

/* Patient Link - Clickable patient IDs and names in tables */
.patient-link {
    color: var(--brand-primary);
    text-decoration: none;
    transition: var(--transition-base);
    display: inline-block;
}

.patient-link:hover {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

.patient-link strong {
    color: var(--brand-primary);
    transition: var(--transition-base);
}

.patient-link:hover strong {
    color: var(--brand-primary-dark);
}

/* ========================================================================
   BADGES & LABELS
   ======================================================================== */

.badge-custom {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.bg-purple {
    background-color: #9333ea !important;
    color: #ffffff !important;
}

.badge-purple {
    background-color: #f3e8ff;
    color: #6b21a8;
}

/* ========================================================================
   UTILITIES
   ======================================================================== */

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.divider {
    height: 1px;
    background-color: var(--card-border);
    margin: 1.5rem 0;
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--brand-primary);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================================================
   RESPONSIVE TABLES - Mobile Card Layout
   ======================================================================== */

/* Mobile responsive table - convert to cards on small screens */
@media (max-width: 991px) {
    /* Hide table headers on mobile */
    .table-custom thead {
        display: none;
    }
    
    /* Make each row a card */
    .table-custom tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--card-border);
        border-radius: var(--border-radius-md);
        background-color: var(--card-bg);
        box-shadow: var(--card-shadow);
    }
    
    /* Make each cell a row within the card */
    .table-custom tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--card-border);
        text-align: right;
    }
    
    .table-custom tbody td:last-child {
        border-bottom: none;
    }
    
    /* Add labels before each cell using data attributes */
    .table-custom tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--text-secondary);
        text-align: left;
        padding-right: 1rem;
        flex: 0 0 40%;
    }
    
    /* Actions column - center the buttons */
    .table-custom tbody td:last-child {
        justify-content: center;
    }
    
    .table-custom tbody td:last-child::before {
        display: none;
    }
}

/* Tablet adjustments - hide some less critical columns */
@media (max-width: 1200px) and (min-width: 992px) {
    .table-custom thead th:nth-child(3), /* NHS Number */
    .table-custom tbody td:nth-child(3) {
        display: none;
    }
    
    .table-custom thead th:nth-child(7), /* Contact */
    .table-custom tbody td:nth-child(7) {
        display: none;
    }
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

/* Mobile Sidebar Toggle Button */
#sidebar-toggle {
    display: none;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    
    /* Show mobile menu toggle button */
    #sidebar-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1001;
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    /* Prominent search on mobile */
    .topbar-search-row {
        padding: 0.875rem 1rem 1rem 1rem;
    }
    
    .topbar-search input {
        font-size: 1rem;
        padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    }
    
    .topbar-search-icon {
        left: 0.75rem;
        font-size: 1.125rem;
    }
    
    .topbar-search-options {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.625rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 576px) {
    .admin-topbar {
        padding: 0 1rem;
    }
    
    .page-header-title {
        font-size: 1.5rem;
    }
    
    .card-custom-body {
        padding: 1rem;
    }
}

/* ========================================================================
   PRINT STYLES
   ======================================================================== */

@media print {
    .admin-sidebar,
    .admin-topbar,
    .page-header-actions,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .admin-main {
        margin-left: 0 !important;
    }
    
    .admin-content {
        padding: 0 !important;
    }
}

/* ========================================================================
   TOAST NOTIFICATIONS
   ======================================================================== */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.toast-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border-left: 4px solid;
    min-width: 300px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Toast Icon */
.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon::before {
    font-family: 'bootstrap-icons';
    font-size: 14px;
    font-weight: bold;
    color: white;
}

/* Toast Message */
.toast-message {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
    color: #334155;
}

/* Success Toast */
.toast-success {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.toast-success .toast-icon {
    background: #10b981;
}

.toast-success .toast-icon::before {
    content: "\f26b"; /* bi-check-circle-fill */
}

.toast-success .toast-message {
    color: #065f46;
}

/* Error/Danger Toast */
.toast-error,
.toast-danger {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.toast-error .toast-icon,
.toast-danger .toast-icon {
    background: #ef4444;
}

.toast-error .toast-icon::before,
.toast-danger .toast-icon::before {
    content: "\f33a"; /* bi-exclamation-circle-fill */
}

.toast-error .toast-message,
.toast-danger .toast-message {
    color: #991b1b;
}

/* Warning Toast */
.toast-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.toast-warning .toast-icon {
    background: #f59e0b;
}

.toast-warning .toast-icon::before {
    content: "\f33a"; /* bi-exclamation-triangle-fill */
}

.toast-warning .toast-message {
    color: #92400e;
}

/* Info Toast */
.toast-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.toast-info .toast-icon {
    background: #3b82f6;
}

.toast-info .toast-icon::before {
    content: "\f431"; /* bi-info-circle-fill */
}

.toast-info .toast-message {
    color: #1e40af;
}

/* ========================================================================
   SEARCH RESULTS DROPDOWN
   ======================================================================== */

.search-results-list {
    padding: 0.5rem 0;
}

.search-result-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--card-border);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8fafc;
}

.search-result-photo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    float: left;
    margin-right: 0.75rem;
}

.search-result-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card-border);
}

.search-result-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--card-border);
}

.search-result-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.search-result-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.search-result-info em {
    font-style: italic;
    color: var(--text-muted);
}

.search-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.search-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
}

.search-badge.student-type {
    background-color: #dbeafe;
    color: #1e40af;
}

.search-badge.academic-year {
    background-color: #dcfce7;
    color: #166534;
}

.search-badge.house {
    background-color: #fef3c7;
    color: #92400e;
}

.search-badge.status-archived {
    background-color: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.search-badge.status-deceased {
    background-color: #1e293b;
    color: #ffffff;
    font-weight: 600;
}

.search-badge.status-deleted {
    background-color: #fee2e2;
    color: #991b1b;
    font-weight: 600;
}

.search-result-item.result-archived {
    background-color: #fffbeb;
}

.search-result-item.result-archived:hover {
    background-color: #fef3c7;
}

.search-result-item.result-deceased {
    background-color: #f1f5f9;
    border-left: 3px solid #1e293b;
}

.search-result-item.result-deceased:hover {
    background-color: #e2e8f0;
}

.search-result-item.result-deceased .search-result-photo img,
.search-result-item.result-deceased .search-result-avatar {
    opacity: 0.5;
    filter: grayscale(100%);
}

.search-result-item.result-deceased .search-result-name {
    color: var(--text-secondary);
}

.search-result-item.result-deleted {
    background-color: #fef2f2;
}

.search-result-item.result-deleted:hover {
    background-color: #fee2e2;
}

.search-result-item.result-deleted .search-result-photo img,
.search-result-item.result-deleted .search-result-avatar {
    opacity: 0.6;
}

/* Deleted Records Styling */
.deleted-record {
    opacity: 0.7;
    background-color: #f8d7da !important;
}

.deleted-record td {
    color: #721c24;
}

/* ========================================================================
   PAGINATION STYLING - Bootstrap Compatible
   ======================================================================== */

/* Fix Laravel's default Tailwind pagination to work with Bootstrap */
/* Apply globally to all pagination, not just in card-custom-footer */

/* Pagination navigation container */
nav[role="navigation"][aria-label*="Pagination"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Tailwind utility classes compatibility - CRITICAL FIX for SVG sizing */
nav[role="navigation"] .w-5,
.pagination .w-5 {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

nav[role="navigation"] .h-5,
.pagination .h-5 {
    height: 1.25rem !important;
}

/* Pagination container */
nav[role="navigation"] .flex {
    display: flex;
}

nav[role="navigation"] .items-center {
    align-items: center;
}

nav[role="navigation"] .justify-between {
    justify-content: space-between;
}

nav[role="navigation"] .flex-1 {
    flex: 1;
}

/* Hidden on mobile */
nav[role="navigation"] .hidden {
    display: none;
}

@media (min-width: 640px) {
    nav[role="navigation"] .sm\\:flex {
        display: flex;
    }
    
    nav[role="navigation"] .sm\\:flex-1 {
        flex: 1;
    }
    
    nav[role="navigation"] .sm\\:hidden {
        display: none;
    }
    
    nav[role="navigation"] .sm\\:items-center {
        align-items: center;
    }
    
    nav[role="navigation"] .sm\\:justify-between {
        justify-content: space-between;
    }
}

/* Pagination text styling */
nav[role="navigation"] .text-sm {
    font-size: 0.875rem;
}

nav[role="navigation"] .text-gray-700,
nav[role="navigation"] .text-gray-500 {
    color: var(--text-secondary);
}

nav[role="navigation"] .text-gray-400 {
    color: var(--text-muted);
}

nav[role="navigation"] .font-medium {
    font-weight: 500;
}

nav[role="navigation"] .leading-5 {
    line-height: 1.25;
}

/* Pagination links styling */
nav[role="navigation"] .relative {
    position: relative;
}

nav[role="navigation"] .inline-flex {
    display: inline-flex;
}

nav[role="navigation"] .items-center {
    align-items: center;
}

nav[role="navigation"] .px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

nav[role="navigation"] .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

nav[role="navigation"] .py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

nav[role="navigation"] .ml-3 {
    margin-left: 0.75rem;
}

nav[role="navigation"] .-ml-px {
    margin-left: -1px;
}

/* Pagination button styling */
nav[role="navigation"] a,
nav[role="navigation"] span[aria-disabled="true"] > span,
nav[role="navigation"] span[aria-current="page"] > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    background-color: white;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-base);
    font-size: 0.875rem;
}

nav[role="navigation"] a:hover {
    background-color: var(--content-bg);
    color: var(--text-primary);
}

nav[role="navigation"] span[aria-current="page"] > span {
    background-color: var(--content-bg);
    color: var(--text-primary);
    font-weight: 600;
}

nav[role="navigation"] span[aria-disabled="true"] > span {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Border radius for first and last pagination items */
nav[role="navigation"] .rounded-l-md {
    border-top-left-radius: var(--border-radius-md);
    border-bottom-left-radius: var(--border-radius-md);
}

nav[role="navigation"] .rounded-r-md {
    border-top-right-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
}

nav[role="navigation"] .rounded-md {
    border-radius: var(--border-radius-md);
}

/* Shadow for pagination group */
nav[role="navigation"] .shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* RTL support */
nav[role="navigation"] .rtl\\:flex-row-reverse[dir="rtl"] {
    flex-direction: row-reverse;
}

/* Focus states */
nav[role="navigation"] a:focus,
nav[role="navigation"] button:focus {
    outline: none;
    z-index: 10;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    border-color: var(--brand-primary);
}

/* Active state */
nav[role="navigation"] a:active {
    background-color: var(--content-bg);
}

/* Ensure SVG arrows are properly sized - CRITICAL FIX */
nav[role="navigation"] svg,
.pagination svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0;
}

/* Mobile pagination adjustments */
@media (max-width: 576px) {
    /* Make pagination buttons wrap */
    nav[role="navigation"] span.relative {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.25rem !important;
    }
    
    /* Smaller pagination buttons on mobile */
    nav[role="navigation"] a,
    nav[role="navigation"] span[aria-disabled="true"] > span,
    nav[role="navigation"] span[aria-current="page"] > span {
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Smaller arrow buttons */
    nav[role="navigation"] a[aria-label*="Previous"],
    nav[role="navigation"] a[aria-label*="Next"],
    nav[role="navigation"] span[aria-label*="Previous"] > span {
        padding: 0.25rem 0.375rem !important;
        min-width: 32px !important;
    }
    
    /* Smaller SVG arrows on mobile */
    nav[role="navigation"] svg {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    /* Reduce gap in pagination flex container */
    nav[role="navigation"] div[class*="sm:flex"] {
        gap: 0.5rem !important;
    }
    
    /* Smaller showing text on mobile */
    nav[role="navigation"] .text-sm {
        font-size: 0.75rem !important;
    }
    
    /* Reduce pagination footer padding on mobile */
    .card-custom-footer {
        padding: 0.75rem 0.5rem !important;
    }
}

/* Per Page Selector Styling */
.card-custom-header .gap-2 {
    gap: 0.5rem;
}

.card-custom-header .text-sm {
    font-size: 0.875rem;
}

.card-custom-header .form-select-sm,
.card-custom-footer .form-select-sm {
    padding: 0.25rem 1.75rem 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--input-border);
    cursor: pointer;
}

.card-custom-header .form-select-sm:focus,
.card-custom-footer .form-select-sm:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Pagination centered at bottom */
.card-custom-footer .d-flex.justify-content-center {
    width: 100%;
}

.card-custom-footer .d-flex.justify-content-center nav {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Force desktop pagination view to show page numbers - use attribute selector */
nav[role="navigation"] div[class*="sm:flex"] {
    display: flex !important;
    flex: 1 !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
}

/* Reorder: page numbers first, then showing text */
nav[role="navigation"] div[class*="sm:flex"] > div:first-child {
    order: 2;
}

nav[role="navigation"] div[class*="sm:flex"] > div:last-child {
    order: 1;
}

/* Hide mobile pagination view */
nav[role="navigation"] div[class*="sm:hidden"] {
    display: none !important;
}

/* Make the showing text and page links container visible */
nav[role="navigation"] > div > div {
    display: flex !important;
}

/* Make pagination page numbers more prominent and visible */
nav[role="navigation"] span[aria-current="page"] > span {
    background-color: var(--brand-primary) !important;
    color: white !important;
    font-weight: 600;
    border-color: var(--brand-primary) !important;
}

/* Ensure all pagination links are visible */
nav[role="navigation"] a,
nav[role="navigation"] span[aria-disabled="true"] > span,
nav[role="navigation"] span[aria-current="page"] > span {
    display: inline-flex !important;
    min-width: 38px;
    min-height: 38px;
}

/* Pagination spacing */
.card-custom-footer {
    padding: 1rem 1.5rem;
}

/* Page number links styling */
nav[role="navigation"] a[aria-label*="Go to page"] {
    font-weight: 500;
    color: var(--text-primary);
}

nav[role="navigation"] a[aria-label*="Go to page"]:hover {
    background-color: var(--brand-primary-light);
    color: white;
}

/* ========================================================================
   SCREENSAVER
   ======================================================================== */

/* Screensaver background overlay */
.screensaverBK {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

/* Screensaver container */
.screensaver {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Screensaver video */
.screensaver video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    box-shadow: none;
}

/* Screensaver text message */
.screensaver-text {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.25rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    border-radius: 8px;
    animation: pulse 2s ease-in-out infinite;
    white-space: nowrap;
}

/* Pulse animation for screensaver text */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Mobile responsive screensaver */
@media (max-width: 768px) {
    .screensaver video {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: cover;
    }
    
    .screensaver-text {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
        bottom: 5%;
        white-space: normal;
        max-width: 90%;
    }
}

/* ========================================================================
   SUB-TAB STYLES - Patient Settings Sub-Navigation
   ======================================================================== */

/* Sub-tab navigation styling */
#patientSubTabs {
    background-color: #f8fafc;
    padding: 0.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

#patientSubTabs .nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

#patientSubTabs .nav-link:hover {
    color: var(--brand-primary);
    background-color: rgba(37, 99, 235, 0.05);
}

#patientSubTabs .nav-link.active {
    background-color: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
}

/* Ensure all nav-link.active elements have proper contrast */
.nav-link.active {
    background-color: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
}

#patientSubTabs .nav-link i {
    margin-right: 0.35rem;
    font-size: 1rem;
}

/* Sub-tab content styling */
#patientSubTabContent {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Mobile responsive sub-tabs */
@media (max-width: 768px) {
    #patientSubTabs {
        padding: 0.25rem;
    }
    
    #patientSubTabs .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    
    #patientSubTabs .nav-link i {
        display: block;
        margin-right: 0;
        margin-bottom: 0.2rem;
        font-size: 1.2rem;
    }
    
    /* Stack sub-tabs vertically on very small screens */
    @media (max-width: 576px) {
        #patientSubTabs .nav-item {
            width: 100%;
            margin-bottom: 0.25rem;
        }
        
        #patientSubTabs .nav-link {
            width: 100%;
            text-align: left;
        }
        
        #patientSubTabs .nav-link i {
            display: inline-block;
            margin-right: 0.35rem;
            margin-bottom: 0;
        }
    }
}

/* Deleted record styling */
.deleted-record {
    opacity: 0.6;
    background-color: #f8d7da !important;
}

.deleted-record td {
    text-decoration: line-through;
}

.badge.bg-danger {
    font-size: 0.75rem;
}

/* ========================================================================
   CLIENT DETAILS SUB-ROWS - SUBSCRIPTION MANAGEMENT
   ======================================================================== */

/* Client details toggle button */
.toggle-details {
    transition: all 0.2s ease-in-out;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-details:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toggle-details .toggle-icon {
    transition: transform 0.2s ease-in-out;
    font-size: 14px;
}

/* Client details sub-row */
.client-details-row {
    background-color: #f8f9fa;
}

.client-details-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--brand-primary);
}

/* Avatar for last active user */
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
    font-weight: 600;
}

/* Progress bars in sub-rows */
.client-details-content .progress {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.client-details-content .progress-bar {
    border-radius: 3px;
    transition: width 0.3s ease-in-out;
}

/* Usage statistics styling */
.client-details-content h6 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.client-details-content .fw-medium {
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive adjustments for sub-rows */
@media (max-width: 768px) {
    .client-details-content .row > div {
        margin-bottom: 1rem;
    }
    
    .client-details-content h6 {
        font-size: 0.8rem;
    }
    
    .avatar-sm {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Animation for expanding/collapsing */
.client-details-row {
    transition: all 0.3s ease-in-out;
}

.client-details-row[style*="display: none"] {
    opacity: 0;
    transform: translateY(-10px);
}

.client-details-row[style*="display: table-row"] {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================================================
   OPENDYSLEXIC FONT TOGGLE BUTTON
   ======================================================================== */

.dyslexie-toggle-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    transition: all 0.3s ease;
}

.dyslexie-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem;
    background-color: var(--brand-primary, #2563eb);
    color: white;
    border: none;
    border-radius: var(--border-radius-md, 0.375rem);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    justify-content: center;
    overflow: hidden;
}

.dyslexie-toggle-btn:hover {
    background-color: var(--brand-primary-dark, #1e40af);
    width: auto;
    padding: 0.5rem 0.75rem;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dyslexie-toggle-btn:active {
    transform: translateY(0);
}

.dyslexie-toggle-btn i {
    font-size: 0.875rem;
    flex-shrink: 0;
}

.dyslexie-toggle-label {
    white-space: nowrap;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.dyslexie-toggle-btn:hover .dyslexie-toggle-label {
    opacity: 1;
    width: auto;
    margin-left: 0.375rem;
}

/* When font is enabled, change button style */
body.use-dyslexie-font .dyslexie-toggle-btn {
    background-color: var(--color-success, #10b981);
}

body.use-dyslexie-font .dyslexie-toggle-btn:hover {
    background-color: #059669;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .dyslexie-toggle-container {
        bottom: 15px;
        right: 15px;
    }
    
    .dyslexie-toggle-btn {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
        font-size: 0.75rem;
        justify-content: center;
    }
    
    .dyslexie-toggle-btn:hover {
        width: 40px; /* Keep small on mobile even on hover */
        padding: 0.5rem;
    }
    
    .dyslexie-toggle-label {
        display: none; /* Hide text on mobile, show only icon */
    }
    
    .dyslexie-toggle-btn i {
        font-size: 0.875rem;
    }
}

