* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
    background: #f4f6f5;
    color: #223;
}

/* Login page */
.login-box {
    max-width: 360px;
    margin: 10vh auto;
    background: #fff;
    padding: 32px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.login-box h1 { font-size: 1.3rem; margin-top: 0; text-align: center; color: #2e7d32; }
.login-box form label { display: block; margin-bottom: 14px; font-size: 0.9rem; color: #555; }
.login-box input { width: 100%; padding: 8px 10px; margin-top: 4px; border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; }
.login-box button { width: 100%; padding: 10px; background: #2e7d32; color: #fff; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; }
.login-box button:hover { background: #256428; }

.error { color: #c62828; background: #ffebee; padding: 8px 12px; border-radius: 6px; font-size: 0.9rem; }

/* App shell */
.topbar {
    background: #2e7d32;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.topbar .brand { font-weight: bold; }
.topbar nav a {
    color: #e8f5e9;
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.95rem;
}
.topbar nav a:hover, .topbar nav a.active { color: #fff; text-decoration: underline; }

.content { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }

.stat-cards { display: flex; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.stat-card { background: #fff; border-radius: 8px; padding: 16px 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); min-width: 140px; }
.stat-value { font-size: 1.8rem; font-weight: bold; color: #2e7d32; }
.stat-label { font-size: 0.85rem; color: #666; }

.muted { color: #888; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-top: 8px;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}
.data-table th { background: #eef5ee; color: #2e7d32; }
.data-table tr.row-overdue { background: #fff3e0; }

.badge { padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; }
.badge-scheduled { background: #e3f2fd; color: #1565c0; }
.badge-completed { background: #e8f5e9; color: #2e7d32; }
.badge-cancelled { background: #fce4ec; color: #ad1457; }

.btn {
    display: inline-block;
    background: #2e7d32;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}
.btn:hover { background: #256428; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; background: #2e7d32; color: #fff; border: none; border-radius: 6px; cursor: pointer; }

.link-btn { background: none; border: none; color: #c62828; cursor: pointer; padding: 0; font-size: 0.9rem; text-decoration: underline; }

.month-nav { display: flex; align-items: center; gap: 16px; margin: 12px 0; flex-wrap: wrap; }
.month-nav a { color: #2e7d32; text-decoration: none; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form select { padding: 6px; border-radius: 6px; border: 1px solid #ccc; }

.form-box {
    background: #fff;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    max-width: 560px;
}
.form-box label { display: block; margin-bottom: 14px; font-size: 0.9rem; color: #444; }
.form-box input[type=text], .form-box input[type=date], .form-box select, .form-box textarea {
    width: 100%; padding: 8px 10px; margin-top: 4px; border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem;
}
.checkbox-label { display: flex !important; align-items: center; gap: 6px; }
.checkbox-label.inline { display: inline-flex !important; margin-right: 14px; }
.checkbox-group { display: block; margin-top: 4px; }
.form-actions { margin-top: 18px; display: flex; gap: 12px; align-items: center; }
.form-actions a { color: #666; }
