:root {
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #059669;
    --accent-light: #d1fae5;
    --danger: #ef4444;
    --warn: #f59e0b;
    --border: #e5e7eb;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 90px;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    padding: 20px 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header .date {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 12px;
    font-weight: 600;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.big-stat {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
}

.progress {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, background 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn.secondary {
    background: var(--text);
}

.btn.danger {
    background: var(--danger);
    padding: 8px;
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: #f9fafb;
    margin-bottom: 12px;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 20px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 500;
}

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

.nav-item svg {
    width: 24px;
    height: 24px;
}

.modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted);
    cursor: pointer;
}

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

th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.95rem;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.low { background: #fee2e2; color: #991b1b; }
.badge.normal { background: #d1fae5; color: #065f46; }
.badge.high { background: #fef3c7; color: #92400e; }

.chip {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text);
}

.chip.active {
    background: var(--text);
    color: white;
    border-color: var(--text);
}

.filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.privacy-note {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    margin-top: 20px;
}