:root {
    /* Colors - Slate Palette */
    --bg-app: #09090b;
    --bg-card: #18181b;
    --bg-card-hover: #27272a;
    --bg-input: #09090b;
    
    --text-primary: #fafafa;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #06b6d4;
    --accent-hover: #0891b2;
    --accent-dim: rgba(6, 182, 212, 0.15);
    
    --status-success: #4ade80;
    --status-warning: #facc15;
    --status-danger: #f87171;
    
    --border-color: #334155;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0 0 var(--space-md) 0; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-secondary); }

/* Layout */
.app-container {
    max-width: 600px; /* Mobile-first constraint for desktop view */
    margin: 0 auto;
    padding-bottom: 80px; /* Space for bottom nav */
    min-height: 100vh;
    background: var(--bg-app);
    position: relative;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.header {
    padding: var(--space-lg) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

/* Components */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    border-color: #475569;
}

.section {
    padding: 0 var(--space-md);
    margin-bottom: var(--space-xl);
}

.section-title {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 16px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #0284c7);
    color: #fff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Role Badge */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-dim);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Timeline */
.timeline {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    scrollbar-width: none;
}
.timeline::-webkit-scrollbar { display: none; }

.timeline-day {
    flex: 0 0 auto;
    width: 48px;
    height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #27272a;
    border: 1px solid transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.timeline-day.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.timeline-day .day-name { font-size: 10px; font-weight: 600; text-transform: uppercase; margin-bottom: 2px; }
.timeline-day .day-num { font-size: 18px; font-weight: 700; }

.streak-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 4px;
    background: var(--border-color);
}
.streak-dot.complete { background: var(--status-success); }
.streak-dot.missed { background: var(--status-danger); }

/* Med Card */
.med-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.med-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #27272a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-primary);
    flex-shrink: 0;
    border: none;
}

.med-info { flex: 1; }
.med-title { font-weight: 600; font-size: 18px; margin-bottom: 2px; }
.med-meta { color: var(--text-secondary); font-size: 14px; display: flex; gap: 8px; }

.med-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-md);
}

/* Navigation */
.nav-bottom {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: #09090b; /* Solid dark background as per screenshot darkness */
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 16px;
    z-index: 900;
}

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

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

.nav-icon {
    width: 20px;
    height: 20px;
    background: #3f3f46; /* Default grey square */
    border-radius: 4px;
}

.nav-item.active .nav-icon {
    background: var(--accent-primary); /* Active blue square */
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Utilities */
.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-warning { background: rgba(250, 204, 21, 0.2); color: var(--status-warning); }
.badge-danger { background: rgba(248, 113, 113, 0.2); color: var(--status-danger); }

/* Forms */
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 14px; }
.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Alert Overlay */
.alert-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(248, 113, 113, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    backdrop-filter: blur(4px);
}
.alert-box {
    background: #2b1212;
    border: 1px solid var(--status-danger);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 100%;
}

/* User Toggle */
.user-toggle {
    background: #1e293b;
    border-radius: 20px;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #334155;
}
.user-toggle-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 700;
}

.placeholder-icon {
    width: 24px; height: 24px;
    background: currentColor;
    opacity: 0.8;
}
