/* Premium iOS-like PWA CSS */

:root {
    /* Emerald Colors */
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    
    /* System Colors */
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-500: #ef4444;
    --yellow-50: #fefce8;
    --yellow-400: #facc15;
    --blue-50: #eff6ff;
    --blue-500: #3b82f6;
    
    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Safe Area Variables for iOS notch */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--gray-50);
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100%;
    -webkit-touch-callout: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--gray-800);
    user-select: none;
}

/* Base Utility Classes */
.text-emerald { color: var(--emerald-600); }
.text-critical { color: var(--red-500); }
.text-gray { color: var(--gray-500); }
.small { font-size: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.d-flex { display: flex; }
.d-flex-between { display: flex; justify-content: space-between; align-items: center; }
.align-center { align-items: center; }
.gap-sm { gap: 0.5rem; }
.w-100 { width: 100%; }

/* App Shell - TAMAMEN NATIVE DAVRANIŞ (KUTU TASARIMI) */
.app-container {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--gray-50);
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* Header */
.app-header {
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: calc(1rem + var(--safe-area-top)) 1.5rem 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 50;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--emerald-600);
}

.header-logo h1 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Content Area */
.app-content {
    flex: 1; /* Dinamik olarak ortadaki TÜM boşluğu doldurur */
    overflow-y: auto; /* Sadece gövde içinde kaydırma (Native hissiyat) */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding-bottom: 2rem; /* Nav zaten altındayken devasa padding'e gerek yok */
}

/* Views Wrapper */
.view {
    display: none;
    padding: 1.5rem;
    animation: fade-in 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Navigation Menu */
.app-nav {
    flex-shrink: 0; /* Küçülmez, her halükarda en alta fiziksel olarak oturur */
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    /* Hiçbir güvenli alan formülü vb. kalmadı! Doğrudan, eşit ve dengeli yükseklik: */
    padding: 0.75rem 0 calc(0.85rem + var(--safe-area-bottom)) 0; 
    z-index: 100;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 0.7rem;
    font-weight: 600;
    gap: 0.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active {
    color: var(--emerald-600);
}

.nav-item.active svg {
    transform: translateY(-2px);
}

/* Progress Card (Hero) */
.progress-card {
    background: linear-gradient(135deg, var(--emerald-500) 0%, rgba(5, 150, 105, 1) 100%);
    border-radius: 1.25rem;
    padding: 1.5rem;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

/* Add a subtle glow behind the progress card */
.progress-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    filter: blur(40px);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.progress-header h2 { margin: 0; font-size: 1.5rem; font-weight: 800; }
.progress-header p { margin: 0; opacity: 0.9; font-size: 0.875rem; font-weight: 500;}

.progress-count {
    background-color: rgba(255,255,255,0.25);
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.progress-bar-bg {
    background-color: rgba(0,0,0,0.15);
    height: 0.5rem;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    background-color: white;
    height: 100%;
    border-radius: 999px;
    transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Date Navigator styling */
.date-navigator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    padding: 0.625rem 1rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0,0,0,0.03);
}

.btn-date-nav {
    background: none;
    border: none;
    color: var(--emerald-600);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-date-nav:active {
    background-color: var(--emerald-50);
    transform: scale(0.95);
}

.date-display {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--gray-800);
}

/* Elements & Sections */
.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    margin-top: 0;
}

.section-container {
    margin-bottom: 1.5rem;
}

/* Med Card - Used in dashboard */
.med-card {
    background-color: white;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0,0,0,0.02);
    transition: opacity 0.3s, transform 0.2s;
}

.med-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.med-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.med-details h4 {
    margin: 0;
    font-weight: 700;
    color: var(--gray-800);
    font-size: 1rem;
}

.med-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.badge {
    background-color: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    color: var(--gray-600);
}
.badge-subtle { background-color: var(--emerald-50); color: var(--emerald-600); }

.btn-check {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald-400), var(--emerald-500));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 15px -3px rgba(16, 185, 129, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-check:active {
    transform: scale(0.9) translateY(2px);
    box-shadow: 0 4px 6px -3px rgba(16, 185, 129, 0.3);
}

.status-taken {
    background-color: var(--emerald-50);
    color: var(--emerald-600);
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.med-card.is-taken {
    opacity: 0.7;
    background-color: var(--gray-50);
    box-shadow: none;
    border-color: var(--gray-200);
}

/* Button & Actions */
.btn-icon {
    background: transparent;
    border: none;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
    border-radius: 0.5rem;
}

.btn-icon:hover, .btn-icon:active { background-color: var(--gray-100); }

/* Colors Generators */
.bg-green { background-color: var(--emerald-100); color: var(--emerald-600); }
.bg-red { background-color: var(--red-100); color: var(--red-500); }
.bg-yellow { background-color: var(--yellow-50); color: var(--yellow-400); }
.bg-blue { background-color: var(--blue-50); color: var(--blue-500); }

/* Medication List (Inventory UI) */
.med-list-item {
    background-color: white;
    padding: 1.25rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    position: relative;
    border: 1px solid transparent;
}
.med-list-item.finished {
    border-color: var(--red-100);
    opacity: 0.8;
}

.med-inventory { margin-bottom: 0.75rem; }
.inventory-bar {
    height: 0.375rem;
    background-color: var(--gray-100);
    border-radius: 999px;
    overflow: hidden;
    width: 100%;
}
.inventory-fill {
    height: 100%;
    background-color: var(--emerald-400);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.med-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    border-top: 1px solid var(--gray-100);
    padding-top: 0.5rem;
}

/* History UI */
/* Hierarchical History Accordion */
.history-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accordion-item {
    background-color: white;
    border: 1px solid var(--gray-100);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.accordion-header {
    width: 100%;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background-color 0.2s;
}

.accordion-header:active { background-color: var(--gray-50); }

.accordion-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.accordion-header .chevron {
    color: var(--gray-400);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active > .accordion-header .chevron {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid var(--gray-50);
    animation: slide-down 0.3s ease-out;
}

.accordion-item.active > .accordion-content {
    display: block;
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Nesting Levels */
.level-month .accordion-item { border: none; border-radius: 0.75rem; margin-top: 0.25rem; }
.level-month .accordion-header { padding: 0.75rem 1rem; background-color: var(--gray-50); border-radius: 0.75rem; }
.level-month .accordion-header h4 { font-size: 0.9375rem; font-weight: 600; }

.level-week .accordion-item { margin-top: 0.125rem; }
.level-week .accordion-header { padding: 0.625rem 0.75rem; background-color: white; border: 1px dashed var(--gray-200); }
.level-week .accordion-header h4 { font-size: 0.875rem; font-weight: 500; color: var(--gray-600); }

.history-item {
    padding: 0.875rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-50);
}
.history-item:last-child { border-bottom: none; }

.history-actions {
    display: flex;
    gap: 0.25rem;
}

.history-actions .btn-icon {
    padding: 0.375rem;
    color: var(--gray-300);
}

.history-actions .btn-icon:hover {
    background-color: var(--gray-50);
}

.history-actions .btn-icon.edit:hover { color: var(--blue-500); }
.history-actions .btn-icon.delete:hover { color: var(--red-500); }

/* Header Inline Actions */
.header-actions-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: 0.5rem;
}

.btn-bulk-delete {
    padding: 0.375rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: var(--gray-300);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.btn-bulk-delete:hover {
    color: var(--red-500);
    background-color: var(--red-50);
}

/* Modal / Form */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: white;
    width: 100%;
    max-width: 600px;
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 1.5rem calc(1.5rem + env(safe-area-inset-right)) calc(1.5rem + var(--safe-area-bottom)) calc(1.5rem + env(safe-area-inset-left));
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
}

.modal-header {
    position: sticky;
    top: -1.5rem;
    background-color: white;
    z-index: 10;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-50);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.modal-header h3 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.close-modal { background: none; border: none; cursor: pointer; color: var(--gray-500); padding: 0.5rem; }

.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.375rem; }
.form-input { 
    width: 100%; padding: 0.875rem 1rem; 
    border: 1px solid var(--gray-200); border-radius: 0.75rem; 
    font-size: 1rem; font-family: inherit; 
    background-color: var(--gray-50);
    transition: all 0.2s;
}
.form-input:focus {
    outline: none; border-color: var(--emerald-400); background-color: white;
    box-shadow: 0 0 0 4px var(--emerald-50);
}

.color-picker { display: flex; gap: 0.75rem; }
.color-option {
    width: 3rem; height: 3rem; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
.color-option.selected {
    transform: scale(1.1);
    border-color: var(--gray-800);
}

.day-picker {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.day-option {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background-color: var(--gray-50);
    color: var(--gray-700);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}
.day-option:hover {
    background-color: var(--gray-100);
}
.day-option.selected {
    background-color: var(--emerald-500);
    color: white;
    border-color: var(--emerald-600);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
    transform: scale(1.05);
}

.btn-primary {
    background-color: var(--emerald-500); color: white;
    border: none; padding: 1rem; border-radius: 0.75rem;
    font-weight: 700; font-size: 1rem; cursor: pointer;
    transition: filter 0.2s;
    font-family: inherit;
    margin-top: 0.5rem;
}
.btn-text-emerald {
    background: none;
    border: none;
    color: var(--emerald-600);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}
.btn-text-emerald:active { background-color: var(--emerald-50); }

.time-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.time-input-group .form-input {
    flex: 1;
}

.btn-remove-time {
    background: none;
    border: none;
    color: var(--red-500);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mb-0 { margin-bottom: 0; }

/* Backup Controls */
.backup-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--gray-50);
    border-radius: 1rem;
    border: 1px dashed var(--gray-300);
}

.btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:active {
    transform: scale(0.97);
    background-color: var(--gray-50);
}

.btn-secondary svg {
    color: var(--emerald-500);
}

#importFile {
    display: none;
}

/* Low Stock Alert Section */
.alert-section {
    background-color: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    animation: pulse-soft 2s infinite ease-in-out;
}

@keyframes pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.1); }
    70% { box-shadow: 0 0 0 10px rgba(244, 63, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #e11d48;
    font-weight: 700;
    font-size: 0.9375rem;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ffe4e6;
}

.alert-item:last-child { border-bottom: none; }

/* History Search Bar */
.search-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background-color: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.875rem;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.search-input:focus {
    outline: none;
    border-color: var(--emerald-400);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

/* Settings Page Styling */
.settings-group {
    background-color: white;
    border-radius: 1rem;
    padding: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.02);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info h4 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
}

.settings-item-info p {
    margin: 0.25rem 0 0 0;
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* iOS Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--gray-200);
    transition: .3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

input:checked + .toggle-slider {
    background-color: var(--emerald-500);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Stats Card (Geçmiş Sayfası Uyum Kartı) */
.stats-card {
    background: linear-gradient(135deg, var(--emerald-500) 0%, rgba(5, 150, 105, 1) 100%);
    border-radius: 1.25rem;
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

.stats-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    filter: blur(40px);
}

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

.stats-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.stats-percentage {
    font-size: 1.5rem;
    font-weight: 800;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.stats-col {
    flex: 1;
    text-align: center;
}

.stats-col:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-val {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
}

.stats-label {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 500;
}

/* Weekly Heatmap */
.weekly-heatmap-container {
    background-color: white;
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0,0,0,0.02);
}

.weekly-heatmap {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
}

.heatmap-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 0.375rem;
    cursor: pointer;
}

.heatmap-day-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
}

.heatmap-day-circle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

/* Heatmap compliance states */
.heatmap-day-circle.state-full {
    background-color: var(--emerald-50);
    color: var(--emerald-600);
    border-color: var(--emerald-200);
}

.heatmap-day-circle.state-partial {
    background-color: #fefce8;
    color: #ca8a04;
    border-color: #fef08a;
}

.heatmap-day-circle.state-missed {
    background-color: var(--red-50);
    color: var(--red-500);
    border-color: var(--red-100);
}

.heatmap-day-circle.state-none {
    background-color: var(--gray-50);
    color: var(--gray-400);
    border-color: var(--gray-100);
}

.heatmap-day-circle:active {
    transform: scale(0.92);
}


