:root {
    --primary: #DD2D4A;
    --primary-dark: #880D1E;
    --primary-light: #F26A8D;

    --text-main: #1e293b;
    --text-light: #64748b;

    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: var(--transition);
    z-index: 50;
}

.sidebar .brand {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(221, 45, 74, 0.3);
}

.brand h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-menu {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: var(--transition);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(221, 45, 74, 0.05);
    color: var(--primary);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item.active i {
    color: var(--primary);
}

.logout-btn:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 1.5rem;
    min-width: 0;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 1rem;
    z-index: 40;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-title p {
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.search-bar {
    background: #f1f5f9;
    padding: 0.6rem 1rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 250px;
    transition: var(--transition);
}

.search-bar:focus-within {
    background: white;
    box-shadow: 0 0 0 2px rgba(221, 45, 74, 0.2);
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    color: var(--text-main);
    width: 100%;
}

.icon-btn {
    background: white;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: var(--text-light);
    transition: var(--transition);
}

.icon-btn:hover {
    background: #f8fafc;
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
}

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

.user-profile:hover {
    background: #f1f5f9;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

.user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1-fr);
    gap: 1.5rem;
}

.dashboard-grid>.content-card {
    grid-column: span 2;
}

/* Stat Card */
.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

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

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-box.red {
    background: rgba(221, 45, 74, 0.1);
    color: var(--primary);
}

.icon-box.blue {
    background: #dbeafe;
    color: #3b82f6;
}

.icon-box.green {
    background: #dcfce7;
    color: #22c55e;
}

.icon-box.purple {
    background: #f3e8ff;
    color: #a855f7;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-info .number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0.2rem 0;
}

.trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend.up {
    color: #22c55e;
}

.trend.down {
    color: #ef4444;
}

/* Content Card */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    grid-column: span 4;
}

.content-card.wide {
    grid-column: span 3;
}

.content-card:last-child {
    grid-column: span 1;
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.action-btn {
    font-size: 0.875rem;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid #f1f5f9;
}

td {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid #f8fafc;
}

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

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

.patient-cell img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.patient-cell .name {
    display: block;
    font-weight: 600;
}

.patient-cell .sub {
    font-size: 0.75rem;
    color: var(--text-light);
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.critical {
    background: #fef2f2;
    color: #ef4444;
}

.status-badge.stable {
    background: #dcfce7;
    color: #22c55e;
}

.status-badge.warning {
    background: #fff7ed;
    color: #f97316;
}

.icon-btn-sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn-sm:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Chart Mockup */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bar-chart {
    display: flex;
    gap: 0.75rem;
    height: 100%;
    align-items: flex-end;
    width: 100%;
    justify-content: space-between;
}

.bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    background: #e2e8f0;
    border-radius: 6px;
    transition: var(--transition);
}

.bar.active,
.bar:hover {
    background: var(--primary);
}

.bar-col span {
    font-size: 0.75rem;
    color: var(--text-light);
}

.select-sm {
    padding: 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    outline: none;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-card.wide,
    .content-card:last-child {
        grid-column: span 2;
    }
}

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

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

    .menu-toggle {
        display: block;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .search-bar {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .content-card.wide,
    .content-card:last-child {
        grid-column: span 1;
    }

    .stat-card {
        padding: 1rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.close-modal:hover {
    color: var(--text-main);
}

.modal-header h2 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-size: 1.5rem;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(221, 45, 74, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    width: 100%;
    padding: 0.875rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* User Detail Styles */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-light);
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    text-align: right;
}
/* Login Page Styles */
.login-body {
    background: #f1f5f9;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
    text-align: center;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.brand-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.logo-icon-lg {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 4px 15px rgba(221, 45, 74, 0.4);
    margin-bottom: 1rem;
}

.brand-center h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.brand-center p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.input-icon-wrapper input {
    padding-left: 2.75rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    cursor: pointer;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.btn-lg {
    font-size: 1.1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.copyright {
    margin-top: 2rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    z-index: 10;
}
.hidden { display: none !important; }

/* Chart Containers */
.chart-container-lg {
    height: 300px;
    width: 100%;
    position: relative;
}
.chart-container-sm {
    height: 220px;
    width: 100%;
    position: relative;
}

/* Dark Mode Helper Classes (for future use) */
body.dark-mode {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #1e293b;
    --text-main: #f1f5f9;
    --text-light: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
}
body.dark-mode .sidebar { border-right-color: #334155; }
body.dark-mode .top-header { background: rgba(30, 41, 59, 0.8); border-color: #334155; }
body.dark-mode .nav-item:hover { background: rgba(255,255,255,0.05); }
body.dark-mode .search-bar { background: #334155; }
body.dark-mode .search-bar input { color: white; }
body.dark-mode .card-header h3 { color: #f1f5f9; }
body.dark-mode .detail-row { border-bottom-color: #334155; }
body.dark-mode .form-group input { background: #334155; border-color: #475569; color: white; }
body.dark-mode th { border-bottom-color: #334155; }
body.dark-mode td { border-bottom-color: #334155; }
