@import url('theme.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Institutional Anchors - Aliased to Dynamic Theme Engine */
    --primary: var(--accent);
    --primary-light: var(--accent);
    --primary-dark: var(--accent);
    --primary-bg: var(--accent-glow);

    --secondary: var(--secondary);
    --secondary-light: var(--secondary);
    --secondary-bg: var(--border-dim);

    --success: var(--vibrant-success);
    --success-light: var(--vibrant-success);
    --success-bg: rgba(0, 255, 102, 0.05);

    --warning: var(--vibrant-warning);
    --warning-light: var(--vibrant-warning);
    --warning-bg: rgba(255, 204, 0, 0.05);

    --danger: var(--vibrant-danger);
    --danger-light: var(--vibrant-danger);
    --danger-bg: rgba(255, 0, 60, 0.05);

    --info: var(--accent);
    --info-light: var(--accent);
    --info-bg: var(--accent-glow);

    --bg-primary: var(--bg-deep);
    --bg-secondary: var(--bg-panel);
    --bg-tertiary: var(--bg-elevated);

    --text-primary: var(--primary);
    --text-secondary: var(--text-secondary);
    --text-muted: var(--text-muted);

    --border: var(--border-hard);
    --border-light: var(--border-dim);

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -1px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);

    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

/* Institutional Transitions */
* {
    transition: var(--transition);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow);
}

.sidebar-crest {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.15));
    transition: transform 0.3s ease;
}

.sidebar-crest:hover {
    transform: rotate(-5deg) scale(1.1);
}

.logo-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.logo-text p {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
    padding: 1.25rem 0.75rem;
    flex: 1;
}

.menu-section {
    margin-bottom: 1.5rem;
}

.menu-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin-bottom: 0.75rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    position: relative;
}

.sidebar-menu a:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.sidebar-menu a.active {
    color: var(--primary);
    background: var(--primary-bg);
    font-weight: 600;
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.menu-icon {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

/* ===== TOP BAR ===== */
.top-bar {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.top-bar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 0.5rem;
}

.icon-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-toggle:hover {
    background: var(--primary-bg);
    color: var(--primary);
    transform: scale(1.05);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger-btn {
    display: none;
    background: var(--bg-tertiary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.hamburger-btn:hover {
    background: var(--border);
}

.top-bar h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    gap: 0.625rem;
    min-width: 280px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    background: var(--bg-tertiary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover {
    background: var(--border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== DASHBOARD CONTENT ===== */
.dashboard-content {
    padding: 2rem;
    flex: 1;
}

.welcome-section {
    margin-bottom: 2rem;
}

.welcome-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--gradient-from, var(--accent)), var(--gradient-to, var(--accent-glow)));
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card.patients {
    --gradient-from: var(--primary);
    --gradient-to: var(--primary-light);
}

.stat-card.appointments {
    --gradient-from: var(--info);
    --gradient-to: var(--info-light);
}

.stat-card.staff {
    --gradient-from: var(--success);
    --gradient-to: var(--success-light);
}

.stat-card.departments {
    --gradient-from: var(--warning);
    --gradient-to: var(--warning-light);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, var(--gradient-from), var(--gradient-to));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon.custom-icon {
    background: transparent;
    padding: 0;
    overflow: visible;
}

.stat-icon.custom-icon img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
}

.dark-mode .stat-icon.custom-icon img {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

.stat-trend.neutral {
    color: var(--text-muted);
}

/* ===== CONTENT GRID ===== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.content-grid .section:nth-child(1) {
    grid-column: 1 / 3;
}

.content-grid .section:nth-child(2) {
    grid-column: 1 / 2;
}

.content-grid .section:nth-child(3) {
    grid-column: 2 / 3;
}

/* ===== SECTIONS ===== */
.section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
}

.section-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.section-action:hover {
    background: rgba(67, 97, 238, 0.15);
}

/* ===== TABLES ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table th {
    background: var(--bg-tertiary);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

table td strong {
    color: var(--text-primary);
    font-weight: 600;
}

table tr:last-child td {
    border-bottom: none;
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:hover {
    background: var(--bg-tertiary);
}

.clickable-row:hover {
    background: rgba(0, 210, 255, 0.05) !important;
    border-left: 3px solid var(--accent);
    transition: all 0.2s ease;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active,
.status-completed {
    background: var(--success-bg);
    color: var(--success);
}

.status-scheduled {
    background: var(--primary-bg);
    color: var(--primary);
}

.status-pending {
    background: var(--warning-bg);
    color: var(--warning);
}

/* ===== DEPARTMENT CARDS ===== */
.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.dept-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent), var(--accent-glow));
}

.dept-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.dept-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.dept-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-glow));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 1.25rem;
}

.dept-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dept-staff-count {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.dept-card-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dept-card-meta p {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.dept-card-meta strong {
    color: var(--text-primary);
    font-weight: 600;
    min-width: 70px;
}

/* ===== HOSPITALS MODULE ===== */
.hospitals-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.hospital-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.hospital-card-inner {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hospital-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hospital-icon-circle {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hospital-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.location-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hospital-stats-strip {
    display: flex;
    justify-content: space-between;
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.stat-lbl {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-indicator {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-bottom: 2px;
}

.dot.active {
    background: #00ff88;
    box-shadow: 0 0 8px #00ff88;
}

.dot.inactive {
    background: #ff4b2b;
}

.hospital-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.contact-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.arrow-btn {
    color: var(--accent);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

/* Hover Effects */
.hospital-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.1);
}

.hospital-card:hover .hospital-icon-circle {
    background: var(--accent);
    color: #000;
}

.hospital-card:hover .arrow-btn {
    opacity: 1;
    transform: translateX(0);
}

.dark-mode .hospital-card {
    background: #050505;
}

.dark-mode .hospital-card:hover {
    background: #0a0a0a;
}

/* Filter Section Styling */
.filters-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.filter-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.dark-mode .filter-group select {
    background: #000000;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .search-bar {
        display: none;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .content-grid .section:nth-child(1),
    .content-grid .section:nth-child(2),
    .content-grid .section:nth-child(3) {
        grid-column: 1 / 2;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 1.25rem 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .section {
        padding: 1.25rem;
    }

    .departments-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        padding: 0.875rem 1rem;
    }

    .user-details {
        display: none;
    }

    .welcome-section h1 {
        font-size: 1.5rem;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar h2 {
        font-size: 1.25rem;
    }

    .top-bar-right {
        gap: 0.5rem;
    }

    table {
        font-size: 0.8rem;
    }

    table th,
    table td {
        padding: 0.75rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.section,
.dept-card {
    animation: fadeInUp 0.5s ease forwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* ===== FACILITY PROFILER ===== */
.hospital-hero {
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--hud-border);
}

.hero-main h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 1rem 0;
    letter-spacing: -1px;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Timeline */
.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 0.45rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 10px var(--accent);
}

.timeline-content {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.visit-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.visit-reason {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.attending-doc {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

/* Depts Compact */
.depts-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dept-compact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.dept-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.dept-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dept-location {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.mt-4 {
    margin-top: 2rem;
}

.h-full {
    height: 100%;
}

.text-accent {
    color: var(--accent);
}

.hospital-hero-banner {
    position: relative;
    padding: 4rem 3rem;
    margin: 1.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-deep) 100%);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-stats-row {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
}

.hero-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.hero-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Inter', sans-serif;
}

.hero-stat-value small {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--hud-border);
}

.scanline-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 210, 255, 0.02) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
}

.btn-hud-primary {
    background: var(--accent);
    color: var(--bg-panel);
    font-weight: 700;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px var(--accent-glow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-hud-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-left: 1rem;
}

/* ===== PREMIUM NATIONAL REGISTRY ===== */
.no-padding {
    padding: 0 !important;
}

.hospital-hero-banner {
    position: relative;
    padding: 4rem 3rem;
    margin: 1.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-deep) 100%);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-stats-row {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
}

.hero-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.hero-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Inter', sans-serif;
}

.hero-stat-value small {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--hud-border);
}

.scanline-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 210, 255, 0.02) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
}

.btn-hud-primary {
    background: var(--accent);
    color: var(--bg-panel);
    font-weight: 700;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px var(--accent-glow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-hud-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-left: 1rem;
}

/* Registry Controls */
.registry-controls {
    margin: 0 1.5rem;
    padding: 1.25rem 2rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
}

.registry-filter-bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.filter-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-field i {
    color: var(--accent);
    font-size: 1.1rem;
}

.filter-field select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
}

.results-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Premium Cards Grid */
.hospitals-viewport {
    padding: 1.5rem;
}

.premium-hospitals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.premium-hospital-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-hospital-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(0, 210, 255, 0.05), transparent 70%);
    pointer-events: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.facility-type {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    background: rgba(0, 210, 255, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.facility-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-pulse.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse-glow 2s infinite;
}

.facility-main {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.facility-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
}

.facility-info h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.district-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.province-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.facility-data-strip {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
}

.data-point {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.data-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.data-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.data-divider {
    width: 1px;
    background: var(--border);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-pill {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.view-profiler {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Animations */
@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scale-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* HUD Corners */
.hud-corners div {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.premium-hospital-card:hover .hud-corners div {
    opacity: 0.5;
}

.corner-tl {
    top: 0;
    left: 0;
    border-right: none !important;
    border-bottom: none !important;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-left: none !important;
    border-top: none !important;
}

/* Empty state */
.premium-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}