* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --green: #1a472a; --green-light: #2d6a4f; --green-pale: #d8f3dc;
  --gold: #c9a227; --gold-light: #f0d060;
  --bg: #f5f5f0; --card: #ffffff; --text: #2d3436; --muted: #636e72;
  --danger: #d63031; --warning: #fdcb6e; --success: #00b894;
  --radius: 12px; --shadow: 0 2px 8px rgba(0,0,0,0.08);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; padding-bottom: 80px; }
.hidden { display: none !important; }

/* Header */
.header { background: var(--green); color: white; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.header h1 { font-size: 18px; font-weight: 600; }
.header .subtitle { font-size: 12px; opacity: 0.8; }
.header button { background: none; border: none; color: white; font-size: 20px; cursor: pointer; padding: 4px 8px; }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid #e0e0e0; display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav button { flex: 1; padding: 10px 4px 8px; background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); cursor: pointer; }
.bottom-nav button.active { color: var(--green); }
.bottom-nav button .icon { font-size: 22px; }

/* Pages */
.page { padding: 16px; max-width: 600px; margin: 0 auto; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card h3 { font-size: 16px; font-weight: 600; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-normal { background: var(--green-pale); color: var(--green); }
.badge-concern { background: var(--warning); color: #7f6c00; }
.badge-urgent { background: var(--danger); color: white; }
.badge-feed { background: #dfe6e9; color: var(--text); }
.badge-turnout { background: #c8e6c9; color: #2e7d32; }
.badge-observation { background: #fff3e0; color: #e65100; }

/* Stats Row */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 14px 12px; text-align: center; box-shadow: var(--shadow); }
.stat-card .number { font-size: 28px; font-weight: 700; color: var(--green); }
.stat-card .label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 16px; background: white; }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23636e72' viewBox='0 0 16 16'%3E%3Cpath d='m8 11-5-5h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 20px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%; }
.btn-primary { background: var(--green); color: white; }
.btn-primary:active { background: var(--green-light); }
.btn-secondary { background: #e9ecef; color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-gold { background: var(--gold); color: white; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }

/* Voice Button */
.voice-btn { width: 60px; height: 60px; border-radius: 50%; background: var(--danger); color: white; border: none; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; margin: 0 auto; box-shadow: 0 4px 12px rgba(214, 48, 49, 0.3); transition: all 0.2s; }
.voice-btn.recording { animation: pulse 1s infinite; background: #e74c3c; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214,48,49,0.4); } 50% { box-shadow: 0 0 0 15px rgba(214,48,49,0); } }
.voice-text { margin-top: 12px; padding: 12px; background: #f8f9fa; border-radius: 8px; min-height: 60px; font-style: italic; color: var(--muted); }
.voice-text.has-text { color: var(--text); font-style: normal; }

/* Horse List */
.horse-item { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; }
.horse-item:active { background: #f8f9fa; }
.horse-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--green-pale); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.horse-info { flex: 1; }
.horse-info .name { font-weight: 600; font-size: 15px; }
.horse-info .detail { font-size: 12px; color: var(--muted); }

/* Activity Feed */
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.activity-body { flex: 1; }
.activity-body .activity-header { font-size: 13px; }
.activity-body .activity-header strong { color: var(--green); }
.activity-body .activity-summary { font-size: 13px; color: var(--muted); margin-top: 2px; }
.activity-body .activity-time { font-size: 11px; color: #b2bec3; }

/* Login */
.login-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--green); }
.login-box { background: white; border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 360px; text-align: center; }
.login-box h1 { font-size: 24px; color: var(--green); margin-bottom: 4px; }
.login-box .tagline { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.login-box .form-group { text-align: left; }
.login-logo { font-size: 48px; margin-bottom: 12px; }

/* Quick Actions */
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.quick-action { background: var(--card); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); cursor: pointer; border: none; width: 100%; }
.quick-action:active { background: #f8f9fa; }
.quick-action .qa-icon { font-size: 28px; margin-bottom: 6px; }
.quick-action .qa-label { font-size: 13px; font-weight: 600; color: var(--text); }

/* Section headers */
.section-header { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 16px 0 8px; }

/* Toast */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--green); color: white; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 999; animation: slideUp 0.3s; }
@keyframes slideUp { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Checkbox/toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.toggle-row label { font-size: 14px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--green); }

@media (min-width: 768px) {
  .page { padding: 24px; }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
}
