* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: #f8f9fa;
    color: #2c3e50;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    padding-top: 70px;
    padding-bottom: 70px; /* Mobile bottom nav space */
}

.container { max-width: 1200px; margin: auto; padding: 0 1rem; }

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    z-index: 1000;
    height: 60px;
}
.nav-brand { font-size: 1.25rem; font-weight: bold; color: #f39c12; text-decoration: none; display: flex; align-items: center; height: 100%; }
.burger { display: block; background: none; border: none; font-size: 1.5rem; cursor: pointer; padding: 0.5rem; color: #2c3e50; }

.nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex-direction: column;
}
.nav-links.active { display: flex; }
.nav-links a { padding: 1rem; text-decoration: none; color: #2c3e50; border-bottom: 1px solid #dee2e6; }
.nav-links a:hover, .nav-links a.active { color: #f39c12; background: #f8f9fa; }

.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    display: flex;
    z-index: 1000;
}
.bottom-nav-item {
    flex: 1; text-align: center; padding: 0.5rem 0; color: #2c3e50; text-decoration: none; font-size: 0.75rem;
}
.bottom-nav-item.active { color: #f39c12; }
.bottom-nav-item span { font-size: 1.25rem; }

/* Cards & Buttons */
.card { background: white; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); padding: 1.5rem; margin-bottom: 1rem; }
.card-header { font-weight: bold; font-size: 1.25rem; margin-bottom: 1rem; border-bottom: 1px solid #dee2e6; padding-bottom: 0.5rem; }
.card-body { }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem; border: none; border-radius: 8px; cursor: pointer;
    font-size: 1rem; min-height: 44px; transition: 0.2s;
    text-decoration: none;
}
.btn-primary { background: #f39c12; color: white; }
.btn-primary:hover { background: #e67e22; }
.btn-danger { background: #e74c3c; color: white; }
.btn-secondary { background: #95a5a6; color: white; }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; min-height: auto; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: #2c3e50; }
.form-input, .form-textarea, .form-select {
    width: 100%; padding: 0.75rem; border: 1px solid #dee2e6; border-radius: 8px;
    font-size: 16px; font-family: inherit; transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: #f39c12; outline: none; }
.form-textarea { min-height: 120px; resize: vertical; }
.form-row, .form-inline { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > * { flex: 1; }

/* Alerts */
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-info { background: #d1ecf1; color: #0c5460; }

/* Layout Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

/* Recipes */
.recipe-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.recipe-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.08); transition: transform 0.2s; }
.recipe-card:hover { transform: translateY(-3px); }
.recipe-card-img { height: 200px; overflow: hidden; }
.recipe-card-img img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card-body { padding: 1rem; }
.recipe-meta { font-size: 0.85rem; color: #7f8c8d; margin-top: 0.5rem; }
.recipe-category { display: inline-block; padding: 0.2rem 0.6rem; background: #fff3cd; color: #856404; border-radius: 25px; font-size: 0.8rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.25rem; margin: 2rem 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid #dee2e6; color: #2c3e50; text-decoration: none; }
.pagination a:hover, .pagination .active { background: #f39c12; color: white; border-color: #f39c12; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { background: #f8f9fa; font-weight: 600; }
.table th, .table td { padding: 0.75rem; border-bottom: 1px solid #dee2e6; text-align: left; }
.table-responsive { overflow-x: auto; }
.admin-table th, .admin-table td { font-size: 0.9rem; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 25px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* Calendar */
.calendar { margin: 1rem 0; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-day { padding: 0.5rem; min-height: 40px; border: 1px solid #dee2e6; border-radius: 4px; font-size: 0.85rem; position: relative; }
.calendar-day.today { background: #fff3cd; font-weight: bold; }
.calendar-day.other-month { color: #ccc; }
.calendar-event { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin: 1px; }
.calendar-event.type-infusion { background: #f39c12; }
.calendar-event.type-distill { background: #e74c3c; }
.calendar-event.type-bottling { background: #27ae60; }
.calendar-event.type-other { background: #3498db; }
.calendar-day.has-event { border-color: #f39c12; }

/* Notes */
.note-card { background: white; padding: 1rem; border-radius: 8px; border-left: 4px solid #f39c12; margin-bottom: 1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.note-title { font-weight: bold; margin-bottom: 0.5rem; font-size: 1.1rem; }
.note-text { white-space: pre-wrap; }
.note-date { font-size: 0.8rem; color: #7f8c8d; margin-top: 0.5rem; }

/* Reminders */
.reminder-item { background: white; padding: 1rem; border-radius: 8px; margin-bottom: 0.5rem; box-shadow: 0 2px 10px rgba(0,0,0,0.08); display: flex; justify-content: space-between; align-items: center; }
.reminder-done { opacity: 0.5; text-decoration: line-through; }
.reminder-type { font-size: 0.8rem; color: #7f8c8d; display: block; margin-top: 0.25rem; }

/* Profile Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { background: white; padding: 1.5rem; border-radius: 12px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.stat-number { font-size: 2rem; font-weight: 700; color: #f39c12; }
.stat-label { color: #7f8c8d; font-size: 0.9rem; }

/* Misc */
.hero { background: linear-gradient(135deg, #f39c12, #e67e22); color: white; padding: 3rem 1.5rem; border-radius: 12px; text-align: center; margin-bottom: 2rem; }
.hero-title { font-size: 2rem; }
.hero-text { font-size: 1.1rem; opacity: 0.9; margin-top: 0.5rem; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: #2c3e50; position: relative; border-left: 4px solid #f39c12; padding-left: 0.75rem; }

.calc-form { background: white; padding: 1.5rem; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.calc-result { background: #fff9e6; padding: 1.5rem; border-radius: 12px; border: 2px solid #f39c12; margin-top: 1rem; }
.calc-result-item { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #f0e0b8; }
.calc-result-item:last-child { border-bottom: none; }
.calc-result-label { color: #7f8c8d; }
.calc-result-value { font-weight: 700; color: #e67e22; font-size: 1.1rem; }

.comment-item { padding: 1rem; border-bottom: 1px solid #dee2e6; }
.comment-author { font-weight: 600; color: #2c3e50; }
.comment-date { font-size: 0.8rem; color: #7f8c8d; }
.comment-text { margin-top: 0.5rem; white-space: pre-wrap; }
.empty-state { text-align: center; padding: 3rem; color: #7f8c8d; }

.install-container { max-width: 600px; margin: 2rem auto; }
.install-step { background: white; padding: 2rem; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.check-item { display: flex; justify-content: space-between; padding: 0.75rem; border-bottom: 1px solid #dee2e6; }
.check-ok { color: #27ae60; font-weight: bold; }
.check-fail { color: #e74c3c; font-weight: bold; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #7f8c8d; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.flex { display: flex; }
.flex-between { justify-content: space-between; align-items: center; }

a { color: #f39c12; text-decoration: none; }
a:hover { text-decoration: underline; }
a.btn:hover { text-decoration: none; }

/* Media Queries */
@media (max-width: 480px) {
    .calendar-day { padding: 3px; min-height: 38px; font-size: 0.75rem; text-align: center; }
    .calendar-event { width: 6px; height: 6px; margin: 1px; }
    .card { padding: 1rem; }
    .btn { padding: 0.6rem 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 480px) {
    .recipe-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
    body { padding-bottom: 0; } /* No bottom nav space */
    .burger { display: none; }
    .nav-links { display: flex; flex-direction: row; position: static; background: none; box-shadow: none; align-items: center; }
    .nav-links a { border-bottom: none; padding: 0.5rem 1rem; border-radius: 8px; }
    .bottom-nav { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .recipe-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-title { font-size: 2.5rem; }
}
@media (min-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .recipe-grid { grid-template-columns: repeat(4, 1fr); }
    .calendar-day { min-height: 60px; }
}

@media print {
    .navbar, .bottom-nav { display: none; }
    body { padding: 0; background: white; }
}
