/* MediCare HMS — Design System */

:root {
    --mc-primary: #2563eb;
    --mc-primary-dark: #1d4ed8;
    --mc-primary-light: #3b82f6;
    --mc-teal: #14b8a6;
    --mc-cyan: #06b6d4;
    --mc-success: #10b981;
    --mc-warning: #f59e0b;
    --mc-danger: #ef4444;
    --mc-bg: #f0f6ff;
    --mc-surface: rgba(255, 255, 255, 0.92);
    --mc-sidebar-width: 288px;
    --mc-sidebar-collapsed: 84px;
    --mc-dark: #071827;
    --mc-text: #0f172a;
    --mc-muted: #64748b;
    --mc-border: rgba(148, 163, 184, 0.22);
    --mc-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
    --mc-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
    --mc-shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.14);
    --mc-radius: 20px;
    --mc-radius-sm: 14px;
    --mc-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --mc-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(20, 184, 166, 0.12), transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(37, 99, 235, 0.14), transparent 45%),
        linear-gradient(160deg, #f8fbff 0%, #eef5ff 50%, #f4f9ff 100%);
    color: var(--mc-text);
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--mc-sidebar-width);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    color: #fff;
    background:
        linear-gradient(185deg, rgba(7, 24, 39, 0.98) 0%, rgba(8, 47, 73, 0.96) 100%),
        radial-gradient(circle at 20% 10%, rgba(20, 184, 166, 0.22), transparent 45%);
    box-shadow: 20px 0 50px rgba(15, 23, 42, 0.3);
    transition: width 0.35s var(--mc-ease), transform 0.35s var(--mc-ease);
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    animation: gridDrift 40s linear infinite;
}

@keyframes gridDrift {
    from { background-position: 0 0; }
    to { background-position: 32px 32px; }
}

.sidebar.collapsed {
    width: var(--mc-sidebar-collapsed);
}

.sidebar-brand {
    position: relative;
    z-index: 1;
    padding: 1.35rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s var(--mc-ease);
}

.sidebar-brand:hover {
    color: #fff;
    transform: scale(1.01);
}

.brand-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 1.45rem;
    color: #fff;
    background: linear-gradient(135deg, var(--mc-primary), var(--mc-teal));
    box-shadow: 0 12px 32px rgba(20, 184, 166, 0.4);
    animation: brandPulse 4s ease-in-out infinite;
}

@keyframes brandPulse {
    0%, 100% { box-shadow: 0 12px 32px rgba(20, 184, 166, 0.35); }
    50% { box-shadow: 0 12px 40px rgba(37, 99, 235, 0.45); }
}

.sidebar-brand span {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.sidebar-brand small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    font-weight: 500;
}

.sidebar-nav {
    position: relative;
    z-index: 1;
    padding: 0.75rem 0.7rem 1.5rem;
    flex: 1;
}

.nav-section-title {
    padding: 1.1rem 0.85rem 0.4rem;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0.15rem 0;
    padding: 0.7rem 0.9rem;
    color: rgba(255, 255, 255, 0.68);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 14px;
    overflow: hidden;
    transition: color 0.25s var(--mc-ease), background 0.25s var(--mc-ease), transform 0.25s var(--mc-spring);
}

.sidebar .nav-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s var(--mc-ease);
}

.sidebar .nav-link:hover::before {
    transform: translateX(100%);
}

.sidebar .nav-link i {
    width: 22px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.05rem;
    transition: transform 0.3s var(--mc-spring);
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    transform: translateX(5px);
}

.sidebar .nav-link:hover i {
    transform: scale(1.12);
}

.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(20, 184, 166, 0.88));
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.32);
}

.sidebar .nav-link.active::after {
    content: "";
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.3); }
}

.submenu {
    margin-left: 0.35rem;
    padding-left: 0.7rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.14);
}

.submenu .nav-link {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
}

.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-brand small,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .submenu {
    display: none !important;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 0.65rem;
}

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

.sidebar.collapsed .nav-link:hover {
    transform: none;
}

.sidebar.collapsed .nav-link.active::after {
    display: none;
}

.main-content {
    margin-left: var(--mc-sidebar-width);
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.35s var(--mc-ease);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--mc-sidebar-collapsed);
}

/* ─── Top navbar ─── */

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    margin: 1rem 1.25rem 0;
    padding: 0.75rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--mc-radius);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: var(--mc-shadow-sm);
    animation: slideDown 0.5s var(--mc-ease) both;
}

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

.page-content {
    flex: 1;
    padding: 1.5rem 1.25rem 2rem;
}

/* ─── Page animations ─── */

.animate-in {
    animation: fadeInUp 0.55s var(--mc-ease) both;
}

.animate-in-delay-1 { animation-delay: 0.06s; }
.animate-in-delay-2 { animation-delay: 0.12s; }
.animate-in-delay-3 { animation-delay: 0.18s; }
.animate-in-delay-4 { animation-delay: 0.24s; }
.animate-in-delay-5 { animation-delay: 0.3s; }

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ─── Page header ─── */

.page-header {
    margin-bottom: 1.75rem;
}

.page-header h1 {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.page-header h1 i {
    opacity: 0.9;
}

.page-header .text-muted {
    font-size: 0.9rem;
}

/* ─── Cards ─── */

.card {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--mc-radius);
    background: var(--mc-surface);
    box-shadow: var(--mc-shadow-sm);
    backdrop-filter: blur(12px);
    transition: transform 0.3s var(--mc-ease), box-shadow 0.3s var(--mc-ease), border-color 0.3s var(--mc-ease);
    overflow: hidden;
}

.card:hover {
    border-color: rgba(37, 99, 235, 0.15);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.35s var(--mc-spring), box-shadow 0.35s var(--mc-ease);
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mc-primary), var(--mc-teal));
    opacity: 0;
    transition: opacity 0.3s var(--mc-ease);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--mc-shadow-lg) !important;
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 1.4rem;
    transition: transform 0.35s var(--mc-spring);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08) rotate(-3deg);
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* ─── Buttons ─── */

.btn {
    border-radius: var(--mc-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.25s var(--mc-ease);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--mc-primary), var(--mc-primary-dark));
    border: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--mc-primary-light), var(--mc-primary));
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.38);
}

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

.btn-soft {
    border: 1px solid var(--mc-border);
    background: #fff;
    color: var(--mc-text);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.btn-soft:hover {
    background: #f8fafc;
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--mc-primary);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-width: 1.5px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

/* ─── Forms ─── */

.form-control,
.form-select {
    border-radius: var(--mc-radius-sm);
    border: 1.5px solid #e2e8f0;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    transition: border-color 0.2s var(--mc-ease), box-shadow 0.2s var(--mc-ease), transform 0.2s var(--mc-ease);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mc-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #334155;
    margin-bottom: 0.4rem;
}

/* ─── Tables ─── */

.table {
    vertical-align: middle;
    margin-bottom: 0;
}

.table thead th {
    padding: 0.95rem 1rem;
    color: var(--mc-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.table tbody tr {
    transition: background 0.2s var(--mc-ease), transform 0.2s var(--mc-ease);
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.04) !important;
}

.table td {
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
}

.table-hover tbody tr {
    cursor: default;
}

/* ─── Badges ─── */

.badge {
    font-weight: 600;
    padding: 0.4em 0.7em;
    border-radius: 8px;
    letter-spacing: 0.02em;
}

/* ─── Alerts (toast style) ─── */

.mc-alert {
    border: none;
    border-radius: var(--mc-radius-sm);
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--mc-shadow-sm);
    animation: alertSlide 0.45s var(--mc-spring) both;
    border-left: 4px solid transparent;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mc-alert-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-left-color: var(--mc-success);
    color: #065f46;
}

.mc-alert-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-left-color: var(--mc-danger);
    color: #991b1b;
}

.mc-alert-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left-color: var(--mc-warning);
    color: #92400e;
}

.mc-alert-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left-color: var(--mc-primary);
    color: #1e40af;
}

/* ─── Dropdowns ─── */

.dropdown-menu {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    box-shadow: var(--mc-shadow);
    padding: 0.5rem;
    animation: dropdownIn 0.25s var(--mc-ease) both;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item {
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.15s var(--mc-ease), padding-left 0.15s var(--mc-ease);
}

.dropdown-item:hover {
    padding-left: 1rem;
}

/* ─── User avatar ─── */

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--mc-primary), var(--mc-teal));
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
    transition: transform 0.3s var(--mc-spring);
}

.dropdown:hover .user-avatar {
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mc-danger);
    border: 2px solid #fff;
    animation: notifPulse 2s ease-in-out infinite;
}

@keyframes notifPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ─── Dashboard hero ─── */

.dashboard-hero {
    position: relative;
    padding: 1.75rem 1.5rem;
    border-radius: var(--mc-radius);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(20, 184, 166, 0.88));
    color: #fff;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.28);
}

.dashboard-hero::before,
.dashboard-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: floatOrb 8s ease-in-out infinite;
}

.dashboard-hero::before {
    width: 200px;
    height: 200px;
    top: -80px;
    right: -40px;
}

.dashboard-hero::after {
    width: 120px;
    height: 120px;
    bottom: -40px;
    left: 20%;
    animation-delay: -4s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10px, -15px) scale(1.05); }
}

.dashboard-hero .hero-content {
    position: relative;
    z-index: 1;
}

.dashboard-hero h2 {
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.hero-greeting-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.hero-role-badge {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1e40af !important;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    font-weight: 600;
}

.hero-meta-pill--alert {
    background: rgba(254, 226, 226, 0.22);
    border-color: rgba(254, 202, 202, 0.45);
}

.dashboard-quick-actions .card-header,
.dashboard-panel .card-header {
    background: #fff;
}

.quick-action-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    height: 100%;
    padding: 1rem;
    border-radius: calc(var(--mc-radius) - 4px);
    border: 1px solid var(--mc-border, #e5e7eb);
    background: #fff;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quick-action-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    border-color: rgba(37, 99, 235, 0.25);
    color: inherit;
}

.quick-action-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    font-size: 1.1rem;
}

.quick-action-tile__label {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
}

.dashboard-metric-card .stat-value {
    font-size: 2rem;
}

.dashboard-panel {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

.dashboard-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom-width: 1px;
    background: #f8fafc;
}

.dashboard-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    margin-bottom: 0.65rem;
    position: relative;
    border: 1px solid transparent;
}

.dashboard-alert-danger {
    background: rgba(254, 226, 226, 0.55);
    border-color: rgba(252, 165, 165, 0.45);
    color: #991b1b;
}

.dashboard-alert-warning {
    background: rgba(254, 243, 199, 0.55);
    border-color: rgba(252, 211, 77, 0.45);
    color: #92400e;
}

.dashboard-alert-info {
    background: rgba(219, 234, 254, 0.55);
    border-color: rgba(147, 197, 253, 0.45);
    color: #1d4ed8;
}

.dashboard-alert__icon {
    line-height: 1;
    font-size: 1rem;
    margin-top: 0.1rem;
}

.dashboard-alert__content {
    font-size: 0.875rem;
    line-height: 1.45;
}

/* ─── Empty state ─── */

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--mc-muted);
}

.empty-state i {
    font-size: 2.5rem;
    opacity: 0.35;
    margin-bottom: 0.75rem;
    display: block;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ─── Pagination ─── */

.pagination .page-link {
    border-radius: 10px !important;
    margin: 0 2px;
    border: none;
    font-weight: 600;
    color: var(--mc-muted);
    transition: all 0.2s var(--mc-ease);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--mc-primary), var(--mc-teal));
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pagination .page-link:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

/* ─── Overlay mobile ─── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s var(--mc-ease);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
    animation: fadeIn 0.3s var(--mc-ease) both;
}

/* ─── Login page ─── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #071827 0%, #0c4a6e 40%, #1e40af 100%);
}

.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: loginOrb 12s ease-in-out infinite;
}

.login-page::before {
    width: 400px;
    height: 400px;
    background: rgba(20, 184, 166, 0.4);
    top: -100px;
    left: -100px;
}

.login-page::after {
    width: 350px;
    height: 350px;
    background: rgba(37, 99, 235, 0.45);
    bottom: -80px;
    right: -80px;
    animation-delay: -6s;
}

@keyframes loginOrb {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -20px); }
    66% { transform: translate(-20px, 25px); }
}

.login-card {
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
    animation: loginCardIn 0.7s var(--mc-spring) both;
    position: relative;
    z-index: 1;
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 20px;
    font-size: 2rem;
    color: #fff;
    background: linear-gradient(135deg, var(--mc-primary), var(--mc-teal));
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.4);
    animation: brandPulse 3s ease-in-out infinite;
}

/* ─── Responsive ─── */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 30px 0 60px rgba(0, 0, 0, 0.4);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .top-navbar {
        margin: 0.75rem 0.75rem 0;
        border-radius: 18px;
    }

    .page-content {
        padding: 1rem 0.75rem 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .top-navbar {
        padding: 0.65rem 0.75rem;
    }

    .breadcrumb-text {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Extended UI polish ─── */

.filter-panel {
    margin-bottom: 1.25rem;
}

.filter-panel .card-body {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
}

.filter-panel .form-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mc-muted);
}

.data-card {
    overflow: hidden;
}

.data-card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    padding: 0.85rem 1.25rem;
}

.table .btn-group-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.btn-icon,
.table .btn-sm {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    line-height: 1;
    transition: transform 0.2s var(--mc-spring), box-shadow 0.2s var(--mc-ease), background 0.2s var(--mc-ease);
}

.table .btn-sm:not(.btn-icon-auto) {
    width: 34px;
    height: 34px;
}

.table .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}

.table .btn-light {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.table .btn-light:hover {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.25);
}

.table td.empty-cell {
    padding: 0 !important;
    border: none !important;
}

.mc-status {
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.45em 0.75em;
}

.mc-status-waiting { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.mc-status-in_consultation { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.mc-status-completed { background: rgba(16, 185, 129, 0.15); color: #047857; }
.mc-status-cancelled { background: rgba(100, 116, 139, 0.15); color: #475569; }
.mc-status-active { background: rgba(16, 185, 129, 0.15); color: #047857; }
.mc-status-discharged { background: rgba(100, 116, 139, 0.15); color: #475569; }
.mc-status-critical { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.mc-status-high { background: rgba(249, 115, 22, 0.15); color: #c2410c; }
.mc-status-medium { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.mc-status-low { background: rgba(16, 185, 129, 0.15); color: #047857; }

.input-group-text {
    border-radius: var(--mc-radius-sm) 0 0 var(--mc-radius-sm);
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
}

.input-group .form-control {
    border-radius: 0 var(--mc-radius-sm) var(--mc-radius-sm) 0;
}

.input-group:focus-within .input-group-text {
    border-color: var(--mc-primary);
}

.input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    border-radius: var(--mc-radius-sm);
}

.mc-pagination-meta {
    font-size: 0.82rem;
    color: var(--mc-muted);
    font-weight: 500;
}

.mc-pagination-meta strong {
    color: var(--mc-text);
}

.form-card .card-header {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.form-card .card-body {
    padding: 1.5rem 1.35rem;
}

.form-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mc-muted);
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e2e8f0;
}

.form-section-title:first-child {
    margin-top: 0;
}

.sidebar .nav-link {
    animation: navFadeIn 0.4s var(--mc-ease) both;
}

.sidebar .nav-link:nth-child(2) { animation-delay: 0.02s; }
.sidebar .nav-link:nth-child(3) { animation-delay: 0.04s; }
.sidebar .nav-link:nth-child(4) { animation-delay: 0.06s; }
.sidebar .nav-link:nth-child(5) { animation-delay: 0.08s; }

@keyframes navFadeIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.row.g-3 > [class*="col-"] .card,
.row.g-4 > [class*="col-"] .card {
    animation: fadeInUp 0.5s var(--mc-ease) both;
}

.row.g-3 > [class*="col-"]:nth-child(1) .card { animation-delay: 0.05s; }
.row.g-3 > [class*="col-"]:nth-child(2) .card { animation-delay: 0.1s; }
.row.g-3 > [class*="col-"]:nth-child(3) .card { animation-delay: 0.15s; }
.row.g-3 > [class*="col-"]:nth-child(4) .card { animation-delay: 0.2s; }

.dropdown-menu .dropdown-header {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mc-muted);
}

.top-navbar .breadcrumb-text .fw-bold {
    letter-spacing: -0.02em;
}

.card.border-0.shadow-sm {
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: var(--mc-shadow-sm) !important;
}

.card.border-0.shadow-sm:hover {
    box-shadow: var(--mc-shadow) !important;
}
