/* ==========================================================================
   PARAS EYE CARE HOSPITAL MANAGEMENT SYSTEM - PREMIUM PURPLE MODERN THEME
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand Primary Gradient & Accents */
    --primary: #7c3aed;
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --primary-light: #f5f3ff;
    --primary-hover: #6d28d9;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --background: #f1f3f9;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    
    --purple: #8b5cf6;
    --purple-light: #f3e8ff;
    
    /* Premium Sidebar - Deep Purple Gradient */
    --sidebar-bg: linear-gradient(180deg, #1b0736 0%, #290f4e 50%, #15052a 100%);
    --sidebar-text: #c4b5fd;
    --sidebar-hover: rgba(168, 85, 247, 0.2);
    --sidebar-active-text: #ffffff;
    
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 20px rgba(109, 40, 217, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 14px 28px rgba(109, 40, 217, 0.1), 0 6px 12px rgba(15, 23, 42, 0.06);
    --shadow-premium: 0 10px 30px -5px rgba(124, 58, 237, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, 
.dashboard-title h1, 
.stat-value, 
.widget-title, 
.table-header-flex h3, 
.chart-header {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
}

/* -------------------------------------------------------------
   LAYOUT ARCHITECTURE
   ------------------------------------------------------------- */
.layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--background);
}

/* Sidebar */
.sidebar {
    width: 285px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    box-shadow: 6px 0 25px rgba(21, 5, 42, 0.35);
    z-index: 100;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
    padding-bottom: 2rem;
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.layout.sidebar-collapsed .sidebar {
    margin-left: -285px;
    opacity: 0;
    pointer-events: none;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

/* Sidebar Header Brand Area */
.sidebar-logo {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 1.2rem 1rem 0.75rem 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.sidebar-logo a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    overflow: hidden;
}

.sidebar-logo img {
    height: 34px;
    width: 34px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-logo span {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800;
    font-size: 0.95rem;
    color: #ffffff !important;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}
.sidebar-close-btn:hover {
    background: rgba(168, 85, 247, 0.35);
    color: #ffffff;
    border-color: rgba(168, 85, 247, 0.6);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.85rem;
    margin-top: 0.5rem;
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: rgba(196, 181, 253, 0.6);
    padding: 0.9rem 0.75rem 0.35rem 0.75rem;
}

.nav-link {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.88rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: relative;
    white-space: nowrap;
}

.nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.nav-link .badge-nav {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
    transform: translateX(3px);
}

.nav-link.active {
    background: linear-gradient(90deg, #7c3aed 0%, #a855f7 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.nav-link.active .badge-nav {
    background: #ffffff;
    color: var(--primary);
}

/* Accordion Nav Groups */
.nav-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.15rem;
}

.nav-group-header {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-group-header:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.nav-group.open .nav-group-header,
.nav-group.has-active .nav-group-header {
    color: #ffffff;
    background: rgba(168, 85, 247, 0.12);
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    white-space: nowrap;
}

.nav-group-title i {
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    color: #a78bfa;
    transition: var(--transition);
}

.nav-group-header:hover .nav-group-title i,
.nav-group.open .nav-group-title i,
.nav-group.has-active .nav-group-title i {
    color: #e9d5ff;
}

.nav-arrow {
    font-size: 0.68rem;
    color: #a78bfa;
    transition: transform 0.22s ease, color 0.2s ease;
}

.nav-group.open .nav-arrow {
    transform: rotate(90deg);
    color: #f5d0fe;
}

.nav-sub-menu {
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.35rem 0 0.35rem 1rem;
    border-left: 2px solid rgba(168, 85, 247, 0.25);
    margin-left: 1.45rem;
    margin-top: 0.2rem;
}

.nav-group.open .nav-sub-menu {
    display: flex;
}

.nav-sub-link {
    color: #c4b5fd;
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-sub-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-sub-link i {
    font-size: 0.35rem;
    opacity: 0.6;
    width: 10px;
    text-align: center;
    color: #c084fc;
}

.nav-sub-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    padding-left: 0.9rem;
}

.nav-sub-link.active {
    background: linear-gradient(90deg, #7c3aed 0%, #9333ea 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

.nav-sub-link.active i {
    opacity: 1;
    color: #ffffff;
}

.nav-sub-link .badge-nav {
    margin-left: auto;
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
    color: #ffffff;
}

/* -------------------------------------------------------------
   MAIN WRAPPER & TOP NAVBAR
   ------------------------------------------------------------- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--background);
}

.top-navbar {
    height: 70px;
    background: linear-gradient(90deg, #18092f 0%, #290f4e 50%, #1c0935 100%);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
    box-shadow: 0 4px 20px rgba(21, 5, 42, 0.25);
    position: sticky;
    top: 0;
    z-index: 90;
    flex-shrink: 0;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e9d5ff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    color: #ffffff;
    border-color: rgba(168, 85, 247, 0.5);
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.09);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-full);
    width: 340px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: var(--transition);
}

.search-bar:focus-within {
    background: rgba(255, 255, 255, 0.16);
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.search-bar i {
    color: #c4b5fd;
    margin-right: 0.65rem;
    font-size: 0.9rem;
}

.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 0.88rem;
    color: #ffffff;
    font-family: inherit;
}

.search-bar input::placeholder {
    color: #a78bfa;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.notification-bell {
    position: relative;
    color: #e9d5ff;
    font-size: 1.25rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.notification-bell:hover {
    background: rgba(168, 85, 247, 0.3);
    color: #ffffff;
    border-color: rgba(168, 85, 247, 0.5);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #18092f;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.5);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-profile img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #ffffff;
    line-height: 1.2;
}

.user-role {
    font-size: 0.72rem;
    color: #c4b5fd;
}

/* -------------------------------------------------------------
   MAIN CONTENT & DASHBOARD HEADER
   ------------------------------------------------------------- */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.dashboard-title h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #1e1b4b;
    letter-spacing: -0.02em;
}

.dashboard-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    margin-left: 0.5rem;
    background: #ffffff;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    white-space: nowrap;
}

.date-display:hover {
    border-color: #a855f7;
}

.date-display i {
    font-size: 1.2rem;
    color: var(--primary);
}

/* -------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.85rem;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    color: white !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #7e22ce 100%);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
    transform: translateY(-1px);
}

.btn-outline {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
}

.btn-outline:hover {
    border-color: #a855f7;
    color: var(--primary);
    background: #faf5ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.15);
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

/* -------------------------------------------------------------
   DASHBOARD GRID & COLUMNS
   ------------------------------------------------------------- */
.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.5rem;
    align-items: start;
}

.column-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.column-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* -------------------------------------------------------------
   TOP STAT CARDS (PREMIUM BOXES)
   ------------------------------------------------------------- */
.top-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.stat-card-new {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9edf5;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card-new::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: var(--transition);
}

.stat-card-new:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: #cbd5e1;
}

.stat-card-new.blue {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
    border-color: rgba(255, 255, 255, 0.15);
}
.stat-card-new.green {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.28);
    border-color: rgba(255, 255, 255, 0.15);
}
.stat-card-new.orange {
    background: linear-gradient(135deg, #b45309 0%, #d97706 50%, #f59e0b 100%);
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.28);
    border-color: rgba(255, 255, 255, 0.15);
}
.stat-card-new.red {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.28);
    border-color: rgba(255, 255, 255, 0.15);
}
.stat-card-new.purple {
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #8b5cf6 100%);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-card-new .stat-title {
    color: rgba(255, 255, 255, 0.88);
}

.stat-card-new .stat-value {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.stat-card-new .stat-subtitle {
    color: rgba(255, 255, 255, 0.82);
}

.stat-card-new .stat-change {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff !important;
    backdrop-filter: blur(4px);
}

.stat-card-new .stat-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(6px);
}

.stat-card-new.blue::after { background: rgba(255, 255, 255, 0.4); }
.stat-card-new.green::after { background: rgba(255, 255, 255, 0.4); }
.stat-card-new.orange::after { background: rgba(255, 255, 255, 0.4); }
.stat-card-new.red::after { background: rgba(255, 255, 255, 0.4); }

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.stat-card-new:hover .stat-icon-wrapper {
    transform: scale(1.08);
}

.blue .stat-icon-wrapper { 
    background: #eff6ff; 
    color: #2563eb; 
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}
.green .stat-icon-wrapper { 
    background: #ecfdf5; 
    color: #059669; 
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.12);
}
.orange .stat-icon-wrapper { 
    background: #fffbeb; 
    color: #d97706; 
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.12);
}
.red .stat-icon-wrapper { 
    background: #fef2f2; 
    color: #dc2626; 
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.12);
}
.purple .stat-icon-wrapper { 
    background: #f3e8ff; 
    color: #7c3aed; 
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.12);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.stat-change {
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}
.stat-change.positive { 
    color: #059669; 
    background: #ecfdf5;
}

.stat-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------
   ENTERPRISE OPERATIONS HIGHLIGHTS CARDS
   ------------------------------------------------------------- */
.ops-highlights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 0.25rem;
}

.ops-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9edf5;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.ops-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.ops-content {
    flex: 1;
    min-width: 0;
}

.ops-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-link {
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
    white-space: nowrap;
}

.ops-card:hover .ops-link i {
    transform: translateX(3px);
}

.ops-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.ops-card:hover .ops-icon {
    transform: scale(1.08);
}

/* Color Themes for Operations Cards */
.ops-blue .ops-value, .ops-blue .ops-link { color: #0284c7; }
.ops-blue .ops-icon { background: #e0f2fe; color: #0284c7; }

.ops-green .ops-value, .ops-green .ops-link { color: #16a34a; }
.ops-green .ops-icon { background: #dcfce7; color: #16a34a; }

.ops-orange .ops-value, .ops-orange .ops-link { color: #ea580c; }
.ops-orange .ops-icon { background: #ffedd5; color: #ea580c; }

.ops-purple .ops-value, .ops-purple .ops-link { color: #7c3aed; }
.ops-purple .ops-icon { background: #ede9fe; color: #7c3aed; }

/* -------------------------------------------------------------
   MIDDLE SECTION GRID (EMERGENCY + CHARTS)
   ------------------------------------------------------------- */
.middle-grid {
    display: grid;
    grid-template-columns: 200px 1.6fr 1.2fr;
    gap: 1.25rem;
    align-items: stretch;
}

/* Dual Split Half Cards: Emergency & Billing */
.emergency-card-half {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 60%, #581c87 100%);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.emergency-card-half:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.billing-card-half {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 60%, #075985 100%);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    color: white;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.billing-card-half:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.4);
}

/* Premium Emergency Banner Card */
.emergency-card {
    background: linear-gradient(145deg, #7c3aed 0%, #6d28d9 45%, #4c1d95 100%);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.1rem;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(109, 40, 217, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}

.emergency-card::before {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    top: -30px;
    right: -30px;
    border-radius: 50%;
    pointer-events: none;
}

.emergency-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(109, 40, 217, 0.45);
}

.emergency-card .stat-icon-wrapper {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    color: white;
    margin-bottom: 0.65rem;
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.emergency-card .stat-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: 0.06em;
}

.emergency-card .stat-value {
    color: #ffffff;
    font-size: 2.15rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.emergency-card .stat-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.72rem;
    margin-top: 0.35rem;
    font-weight: 500;
}

.emergency-card > i.fa-chevron-right {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.emergency-card:hover > i.fa-chevron-right {
    transform: translate(3px, -50%);
    color: #ffffff;
}

/* Charts */
.chart-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9edf5;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: var(--transition);
}

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

.chart-header {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1.15rem;
    color: #0f172a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header span {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
}

.chart-container {
    flex: 1;
    position: relative;
    min-height: 160px;
    width: 100%;
}

.doughnut-layout {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 1.25rem;
}

.doughnut-chart-wrapper {
    flex: 1;
    position: relative;
    height: 150px;
    min-width: 0;
}

.doughnut-legend {
    width: 110px;
    flex-shrink: 0;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legend-color {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 0.35rem;
}

.legend-text { 
    color: var(--text-muted); 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    max-width: 65px; 
    font-size: 0.72rem;
    font-weight: 500;
}

.legend-value { 
    font-weight: 700; 
    color: var(--text-main); 
    font-size: 0.8rem;
}

/* -------------------------------------------------------------
   TABLES & LIST WIDGETS
   ------------------------------------------------------------- */
.table-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e9edf5;
    padding: 1.35rem;
    overflow-x: auto;
    transition: var(--transition);
}

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

.table-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.table-header-flex h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e1b4b;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.data-table th {
    text-transform: uppercase;
    font-size: 0.68rem;
    color: #64748b;
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.data-table th:first-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}
.data-table th:last-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.85rem;
    color: #334155;
}

.data-table tr:hover td {
    background-color: #faf5ff;
}

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

.patient-info-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e2e8f0;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.patient-details strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 600;
}

.patient-details span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* -------------------------------------------------------------
   BADGES (PILL DESIGN)
   ------------------------------------------------------------- */
.badge {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
    text-align: center;
    letter-spacing: 0.02em;
}

.badge-waiting { background: #fef3c7; color: #b45309; }
.badge-confirmed { background: #d1fae5; color: #047857; }
.badge-regular { background: #ede9fe; color: #6d28d9; }
.badge-followup { background: #fce7f3; color: #be185d; }
.badge-cataract { background: #fee2e2; color: #b91c1c; }
.badge-glaucoma { background: #dcfce7; color: #15803d; }
.badge-completed { background: #ccfbf1; color: #0f766e; }

/* -------------------------------------------------------------
   RIGHT COLUMN WIDGETS
   ------------------------------------------------------------- */
.widget {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
    border: 1.5px solid #cbd5e1;
    transition: var(--transition);
}

.widget.opd-queue-widget {
    background: linear-gradient(145deg, #1e0b3c 0%, #2f1057 50%, #1e0b3c 100%);
    border: 1.5px solid rgba(168, 85, 247, 0.4);
    box-shadow: 0 8px 24px rgba(21, 5, 42, 0.35);
    color: #ffffff;
}

.widget.opd-queue-widget .widget-title {
    color: #ffffff;
}

.widget.opd-queue-widget .btn-outline {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e9d5ff;
}

.widget.opd-queue-widget .btn-outline:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
}

.widget.opd-queue-widget .list-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.widget.opd-queue-widget div[style*="color: var(--text-muted)"],
.widget.opd-queue-widget span[style*="color: var(--text-muted)"] {
    color: #c4b5fd !important;
}

.widget:hover {
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.08);
    border-color: #c084fc;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1e1b4b;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.list-item:last-child { 
    border-bottom: none; 
    padding-bottom: 0; 
}

.list-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.list-item-info {
    min-width: 0;
}

.list-item-info strong {
    display: block;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0f172a;
    font-weight: 600;
}

.list-item-info span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* -------------------------------------------------------------
   QUICK ACTIONS GRID - PREMIUM CARD STYLE
   ------------------------------------------------------------- */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1.15rem 0.75rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    color: #1e293b;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

/* Distinct Soft Pastel Gradients for each Quick Action */
.quick-action-btn.qa-purple {
    background: linear-gradient(145deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #d8b4fe;
}
.quick-action-btn.qa-green {
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}
.quick-action-btn.qa-amber {
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}
.quick-action-btn.qa-red {
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
}
.quick-action-btn.qa-blue {
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #7dd3fc;
}
.quick-action-btn.qa-emerald {
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
}
.quick-action-btn.qa-orange {
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
}
.quick-action-btn.qa-violet {
    background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: #c4b5fd;
}

.quick-action-btn:hover {
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.16);
    transform: translateY(-3px);
    border-color: #a855f7 !important;
}

.qa-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
    transition: var(--transition);
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

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

.qa-icon.new-patient { color: #7c3aed; background: #f3e8ff; }
.qa-icon.book-appt { color: #059669; background: #ecfdf5; }
.qa-icon.opd { color: #d97706; background: #fffbeb; }
.qa-icon.emergency { color: #dc2626; background: #fee2e2; }

/* -------------------------------------------------------------
   GLOBAL MODALS & DIALOGS
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

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

.modal-card,
.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    padding: 2rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
@media (max-width: 1400px) {
    .top-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ops-highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .middle-grid {
        grid-template-columns: 1fr 1fr;
    }
    .emergency-card {
        grid-column: span 2;
    }
}

@media (max-width: 1100px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        z-index: 9999;
        margin-left: -260px;
        opacity: 0;
        box-shadow: 10px 0 25px rgba(0, 0, 0, 0.3);
    }
    .layout.sidebar-mobile-open .sidebar {
        margin-left: 0 !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    .main-content {
        padding: 1.25rem;
    }
}

@media (max-width: 640px) {
    .top-stats-grid {
        grid-template-columns: 1fr;
    }
    .ops-highlights-grid {
        grid-template-columns: 1fr;
    }
    .middle-grid {
        grid-template-columns: 1fr;
    }
    .emergency-card {
        grid-column: span 1;
    }
    .top-navbar {
        padding: 0 1rem;
    }
    .search-bar {
        width: 180px;
    }
}
