* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --green: #2d5a27;
    --green-light: #4a8c3f;
    --brown: #5c3d2e;
    --brown-light: #8b6f4e;
    --cream: #f5f0e8;
    --white: #ffffff;
    --yellow: #c9a227;
    --red: #b33a3a;
    --gray: #888;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--cream);
    color: var(--brown);
    min-height: 100vh;
}

/* Login page */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    text-align: center;
    background: var(--white);
    padding: 3rem 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    max-width: 360px;
    width: 90%;
}

.login-card h1 {
    font-size: 1.8rem;
    color: var(--green);
    margin-bottom: 0.3rem;
}

.subtitle {
    color: var(--gray);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.bonsai-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--white);
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: box-shadow 0.2s;
}

.google-btn:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Dashboard */
.app-header {
    background: var(--green);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-info span {
    font-size: 0.85rem;
}

.logout-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.4);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

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

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card h2 {
    font-size: 1rem;
    color: var(--green);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Health status */
.health-badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.health-good { background: #d4edda; color: var(--green); }
.health-warning { background: #fff3cd; color: #856404; }
.health-concern { background: #f8d7da; color: var(--red); }
.health-incomplete { background: #e2e3e5; color: #555; }

/* Action buttons */
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.action-btn {
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    color: var(--white);
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn.water { background: #3498db; }
.action-btn.fertilize { background: var(--green-light); }
.action-btn.prune { background: var(--brown-light); }
.action-btn.repot { background: var(--brown); }

/* History */
.history-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.history-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0ebe3;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.history-action {
    font-weight: 500;
    text-transform: capitalize;
}

.history-date {
    color: var(--gray);
    font-size: 0.8rem;
}

/* Photo upload */
.photo-upload {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
}

.photo-upload:hover {
    border-color: var(--green-light);
}

.photo-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.photo-preview {
    margin-top: 0.8rem;
}

.photo-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.analysis-result {
    margin-top: 0.8rem;
    padding: 0.8rem;
    background: var(--cream);
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Settings */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0ebe3;
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-weight: 500;
    text-transform: capitalize;
    font-size: 0.9rem;
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-control input[type="number"] {
    width: 60px;
    padding: 0.3rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
}

.setting-control .unit {
    color: var(--gray);
    font-size: 0.8rem;
}

.telegram-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.save-btn {
    background: var(--green);
    color: var(--white);
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Recommendations */
.rec-list {
    list-style: none;
    padding: 0;
}

.rec-list li {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    padding-left: 1.2rem;
    position: relative;
}

.rec-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--green-light);
    font-weight: bold;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
}

/* Health score */
.health-score {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green);
    margin-left: 0.5rem;
}

.season-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    background: #e8f5e9;
    color: var(--green);
    margin-left: 0.5rem;
}

.detail-chip {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--cream);
    border-radius: 6px;
    font-size: 0.8rem;
    margin: 0.2rem 0.3rem 0.2rem 0;
    color: var(--brown);
}

.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.metrics span {
    background: var(--cream);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* Loading */
.loading {
    text-align: center;
    color: var(--gray);
    padding: 1rem;
    font-size: 0.9rem;
}
