/* 
  KIDS-CAN ADMIN DASHBOARD V2 
  SaaS-Style Design System
*/

:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --accent: #f59e0b;
    /* Warm cancer-awareness orange */
    --success: #10b981;
    --danger: #ef4444;
    --background: #f8fafc;
    --sidebar-bg: #1e293b;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-sub: #64748b;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', 'Montserrat', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- SIDEBAR --- */
.dashboard-layout {
    display: flex;
    width: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-logo span {
    color: var(--accent);
}

.nav-group {
    padding: 0 1rem;
    margin-bottom: 2rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

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

.nav-item i {
    width: 20px;
    text-align: center;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.header {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: #f1f5f9;
    font-size: 0.9rem;
    outline: none;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub);
}

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

.notification-bell {
    position: relative;
    cursor: pointer;
    color: var(--secondary);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* --- DASHBOARD COMPONENTS --- */
.content-wrapper {
    padding: 2rem;
}

.page-title {
    margin-bottom: 2rem;
}

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

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

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.blue {
    background: #dbeafe;
    color: #1e40af;
}

.stat-icon.orange {
    background: #ffedd5;
    color: #9a3412;
}

.stat-icon.green {
    background: #dcfce7;
    color: #166534;
}

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

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.growth-up {
    color: var(--success);
}

.growth-down {
    color: var(--danger);
}

/* Charts Section */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* Tables Section */
.section-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

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

.table-responsive {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}

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

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef9c3;
    color: #854d0e;
}

.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    background: #1e40af;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--secondary);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 0.25rem;
}

.hidden {
    display: none !important;
}

.login-modal-screen {
    position: fixed;
    inset: 0;
    background: #0f172a;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* REAL-TIME TOASTS */
.realtime-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 4px solid var(--primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
    transform: translateX(120%);
}

.realtime-toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toast-content i {
    font-size: 1.5rem;
    color: var(--primary);
}

.toast-content strong {
    display: block;
    font-size: 0.9rem;
    color: var(--dark);
}

.toast-content p {
    font-size: 0.8rem;
    color: var(--secondary);
    margin: 0;
}

/* Responsive Improvements */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 0;
    }

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

    .charts-row {
        grid-template-columns: 1fr;
    }
}