/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: Arial, Helvetica, sans-serif; background: #f4f6f4; color: #1e2e1f; line-height: 1.55; }
a { color: #345737; text-decoration: none; }
a:hover { color: #8bbd3e; text-decoration: underline; }

/* ===================== LOGIN ===================== */
.login-page { background: linear-gradient(160deg, #2a4a2c, #345737); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { background: #fff; border-radius: 12px; padding: 2.5rem 2rem; width: 100%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo h1 { font-size: 1.4rem; color: #345737; }
.login-logo p  { font-size: 0.85rem; color: #5a6b5b; margin-top: 0.25rem; }
.login-form .form-group { margin-bottom: 1rem; }
.login-form label { display: block; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.05em; color: #5a6b5b; margin-bottom: 0.35rem; }
.login-form input { width: 100%; padding: 0.6rem 0.85rem; border: 1px solid #d4e4c0; border-radius: 6px; font-size: 0.95rem; outline: none; transition: border-color 0.2s; }
.login-form input:focus { border-color: #345737; }
.btn-full { width: 100%; }

/* ===================== NAV ===================== */
.app-nav { background: #2a4a2c; display: flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem; height: 52px; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,0.2); flex-wrap: wrap; }
.nav-brand a { color: #fff; font-weight: bold; font-size: 1rem; white-space: nowrap; }
.nav-links { display: flex; list-style: none; gap: 0.25rem; flex: 1; }
.nav-links a { color: #b5d47a; font-size: 0.82rem; padding: 0.3rem 0.65rem; border-radius: 4px; font-weight: 600; letter-spacing: 0.03em; transition: background 0.15s, color 0.15s; }
.nav-links a:hover, .nav-links a.active { background: rgba(139,189,62,0.18); color: #fff; text-decoration: none; }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; color: rgba(255,255,255,0.6); white-space: nowrap; }
.nav-user em { color: #b5d47a; font-style: normal; }
.btn-logout { background: rgba(255,255,255,0.1); color: #fff !important; padding: 0.25rem 0.7rem; border-radius: 4px; font-size: 0.78rem; transition: background 0.15s; }
.btn-logout:hover { background: rgba(255,255,255,0.2); text-decoration: none; }

/* ===================== LAYOUT ===================== */
.app-main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.app-footer { text-align: center; font-size: 0.75rem; color: #8a9a8b; padding: 1.5rem; border-top: 1px solid #d4e4c0; margin-top: 2rem; }

/* ===================== PAGE HEADERS ===================== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.5rem; }
.page-header h1 { font-size: 1.5rem; color: #2a4a2c; }
.subhead { color: #5a6b5b; font-size: 0.9rem; margin-top: 0.2rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; margin-top: 1.5rem; }
.section-header h2 { font-size: 1.1rem; color: #2a4a2c; }

/* ===================== BUTTONS ===================== */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; font-family: Arial, sans-serif; font-size: 0.875rem; font-weight: 600; padding: 0.5rem 1.1rem; border-radius: 5px; border: none; cursor: pointer; transition: background 0.15s, transform 0.1s; text-decoration: none; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: #345737; color: #fff; }
.btn-primary:hover { background: #2a4a2c; color: #fff; }
.btn-outline { background: transparent; color: #345737; border: 1px solid #345737; }
.btn-outline:hover { background: #f0f7f0; }
.btn-success { background: #4a8a4e; color: #fff; }
.btn-success:hover { background: #345737; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm  { font-size: 0.8rem;  padding: 0.35rem 0.8rem; }
.btn-xs  { font-size: 0.74rem; padding: 0.25rem 0.6rem; }

/* ===================== ALERTS ===================== */
.alert { padding: 0.7rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; font-weight: 600; }
.alert-error   { background: #fdecea; border: 1px solid #e57373; color: #b71c1c; }
.alert-success { background: #e8f5e9; border: 1px solid #81c784; color: #1b5e20; }

/* ===================== STAT CARDS ===================== */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card { background: #fff; border: 1px solid #d4e4c0; border-radius: 8px; padding: 1.25rem 1rem; text-align: center; }
.stat-num { font-size: 2rem; font-weight: 900; color: #345737; line-height: 1; }
.stat-label { font-size: 0.78rem; color: #5a6b5b; margin-top: 0.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* ===================== JOB CARDS ===================== */
.job-list { display: flex; flex-direction: column; gap: 0.75rem; }
.job-card { background: #fff; border: 1px solid #d4e4c0; border-radius: 8px; padding: 1rem 1.25rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.job-card.job-done { opacity: 0.6; }
.job-client { font-weight: 700; font-size: 1rem; color: #2a4a2c; }
.job-service { color: #345737; font-size: 0.88rem; font-weight: 600; }
.job-title   { color: #5a6b5b; font-size: 0.85rem; }
.job-address { color: #7a8a7b; font-size: 0.8rem; margin-top: 0.25rem; }
.job-notes   { color: #5a6b5b; font-size: 0.82rem; margin-top: 0.35rem; font-style: italic; }
.job-card-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }

/* ===================== CALENDAR ===================== */
.calendar-toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.view-tabs { display: flex; gap: 0.35rem; }
.cal-nav { display: flex; align-items: center; gap: 0.5rem; }
.cal-label { font-weight: 700; color: #2a4a2c; font-size: 0.95rem; min-width: 180px; text-align: center; }

.cal-day { background: #fff; border: 1px solid #d4e4c0; border-radius: 8px; margin-bottom: 0.75rem; overflow: hidden; }
.cal-day-header { background: #f0f7f0; padding: 0.5rem 1rem; font-weight: 700; font-size: 0.9rem; color: #2a4a2c; display: flex; align-items: center; gap: 0.5rem; }
.cal-today .cal-day-header { background: #345737; color: #fff; }
.cal-empty { padding: 0.75rem 1rem; color: #aaa; font-size: 0.85rem; font-style: italic; }
.cal-job { display: flex; align-items: flex-start; justify-content: space-between; padding: 0.6rem 1rem; border-top: 1px solid #f0f7f0; gap: 1rem; flex-wrap: wrap; }
.cal-job.cal-job-done { opacity: 0.55; }
.cal-job-info { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.88rem; }
.cal-job-title { color: #5a6b5b; }
.cal-job-addr  { color: #8a9a8b; font-size: 0.8rem; }
.cal-job-status { display: flex; gap: 0.4rem; align-items: center; }

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: #d4e4c0; border: 1px solid #d4e4c0; border-radius: 8px; overflow: hidden; }
.month-header { background: #2a4a2c; color: #fff; text-align: center; font-size: 0.75rem; font-weight: 700; padding: 0.4rem; text-transform: uppercase; letter-spacing: 0.06em; }
.month-cell { background: #fff; min-height: 90px; padding: 0.4rem; font-size: 0.78rem; }
.month-cell.month-pad { background: #f8f9f8; }
.month-today { background: #f0f9e8; }
.month-day-num { font-weight: 700; color: #345737; margin-bottom: 0.3rem; }
.month-today .month-day-num { background: #345737; color: #fff; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; }
.month-job-pill { background: #e8f5e0; color: #2a4a2c; border-radius: 3px; padding: 1px 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.72rem; }
.month-job-more { color: #8bbd3e; font-size: 0.72rem; font-weight: 600; }

/* ===================== TABLES ===================== */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #d4e4c0; font-size: 0.875rem; }
.data-table th { background: #2a4a2c; color: #fff; padding: 0.6rem 0.9rem; text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table td { padding: 0.6rem 0.9rem; border-bottom: 1px solid #eef4ee; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fcf8; }
.row-done td, .row-inactive td { opacity: 0.55; }

/* ===================== BADGES ===================== */
.badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-today    { background: #345737; color: #fff; }
.badge-recur    { background: #e8f5e0; color: #2a4a2c; border: 1px solid #8bbd3e; }
.badge-done     { background: #e8f5e9; color: #2e7d32; }
.badge-pending  { background: #fff8e1; color: #f57f17; }
.badge-active   { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #f5f5f5; color: #757575; }
.badge-paused   { background: #fff3e0; color: #e65100; }
.badge-completed { background: #e3f2fd; color: #1565c0; }

/* ===================== FORMS ===================== */
.app-form { background: #fff; border: 1px solid #d4e4c0; border-radius: 8px; padding: 1.5rem; max-width: 700px; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 160px; }
.form-group-lg { flex: 2; }
.form-group-sm { flex: 0 0 100px; min-width: 80px; }
.form-group label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #5a6b5b; }
.form-group input,
.form-group select,
.form-group textarea { padding: 0.5rem 0.75rem; border: 1px solid #d4e4c0; border-radius: 5px; font-size: 0.9rem; font-family: Arial, sans-serif; outline: none; transition: border-color 0.2s; background: #fff; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #345737; }
.form-group textarea { resize: vertical; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }
.input-sm { padding: 0.3rem 0.6rem; font-size: 0.82rem; border: 1px solid #d4e4c0; border-radius: 4px; }

/* ===================== SEARCH ===================== */
.search-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }
.search-input { padding: 0.45rem 0.8rem; border: 1px solid #d4e4c0; border-radius: 5px; font-size: 0.9rem; width: 280px; outline: none; }
.search-input:focus { border-color: #345737; }

/* ===================== DETAIL GRID ===================== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-block { background: #fff; border: 1px solid #d4e4c0; border-radius: 8px; padding: 1rem 1.25rem; }
.detail-block h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #5a6b5b; margin-bottom: 0.5rem; }
.detail-block p { font-size: 0.9rem; margin-bottom: 0.25rem; }
.detail-full { grid-column: 1 / -1; }

/* ===================== MISC ===================== */
.card { background: #fff; border: 1px solid #d4e4c0; border-radius: 8px; padding: 1.25rem 1.5rem; margin-top: 1.5rem; }
.card h2 { font-size: 1rem; color: #2a4a2c; margin-bottom: 1rem; }
.empty-state { background: #fff; border: 1px dashed #d4e4c0; border-radius: 8px; padding: 2rem; text-align: center; color: #8a9a8b; font-size: 0.9rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 700px) {
  .app-nav { height: auto; padding: 0.5rem 1rem; }
  .nav-links { flex-wrap: wrap; gap: 0.15rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .month-grid { font-size: 0.65rem; }
  .month-cell { min-height: 60px; }
  .cal-job { flex-direction: column; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* ===================== SERVICE CHECKLIST ===================== */
.service-checklist { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 0; }
.check-item { display: flex; align-items: center; gap: 0.4rem; background: #f0f7f0; border: 1px solid #d4e4c0; border-radius: 5px; padding: 0.35rem 0.75rem; font-size: 0.875rem; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.check-item:hover { background: #e0f0e0; border-color: #8bbd3e; }
.check-item input[type="checkbox"] { cursor: pointer; accent-color: #345737; width: 15px; height: 15px; }
.check-item:has(input:checked) { background: #d4edcc; border-color: #345737; font-weight: 600; color: #2a4a2c; }
