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

:root {
  --primary: #2D5A3D;
  --primary-light: #4A8B5C;
  --accent: #D4A574;
  --bg: #FAF8F5;
  --card-bg: #FFFFFF;
  --text: #2C2C2C;
  --text-light: #6B6B6B;
  --border: #E8E4DF;
  --success: #2D8A4E;
  --warning: #D4A017;
  --danger: #C0392B;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.screen { display: none; }
.screen.active { display: block; }

/* Login */
#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.logo-container { text-align: center; margin-bottom: 2rem; }
.logo-container h1 { font-size: 1.8rem; color: var(--primary); font-weight: 700; }
.subtitle { color: var(--text-light); margin-top: 0.25rem; font-size: 1rem; }

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 380px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-light);
}

input[type="tel"], input[type="password"], input[type="text"], textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-small {
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-light);
}

.help-text { text-align: center; font-size: 0.8rem; color: var(--text-light); margin-top: 1rem; }

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--primary);
  color: white;
}

header h2 { font-size: 1.1rem; font-weight: 600; }

#logout-btn { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.3); }

/* Tabs */
.tabs {
  display: flex;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab {
  flex: 1;
  padding: 0.85rem;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Tab content */
.tab-content { display: none; padding: 1rem; }
.tab-content.active { display: block; }

/* Assignment cards */
.assignment-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 4px solid var(--primary);
}

.assignment-card:active { transform: scale(0.98); }
.assignment-card.urgent { border-left-color: var(--danger); }
.assignment-card.today { border-left-color: var(--warning); }

.assignment-card .property-name { font-weight: 700; font-size: 1rem; }
.assignment-card .assignment-type { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.assignment-card .assignment-time { font-size: 0.9rem; color: var(--text); margin-top: 0.35rem; }
.assignment-card .assignment-meta { font-size: 0.8rem; color: var(--text-light); margin-top: 0.25rem; }

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.pending { background: #FFF3CD; color: #856404; }
.status-badge.assigned { background: #D1ECF1; color: #0C5460; }
.status-badge.accepted { background: #D4EDDA; color: #155724; }
.status-badge.in_progress { background: #CCE5FF; color: #004085; }
.status-badge.completed { background: #D4EDDA; color: #155724; }

.empty-state { text-align: center; color: var(--text-light); padding: 3rem 1rem; font-size: 0.95rem; }

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  font-size: 1.5rem; cursor: pointer;
  color: var(--text-light);
}

#modal-details { margin: 1rem 0; }
#modal-details .detail-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
#modal-details .detail-label { font-size: 0.85rem; color: var(--text-light); }
#modal-details .detail-value { font-size: 0.9rem; font-weight: 600; }

#modal-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

.btn-accept { background: var(--success); color: white; border: none; padding: 0.85rem; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.btn-start { background: var(--primary); color: white; border: none; padding: 0.85rem; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.btn-complete { background: var(--success); color: white; border: none; padding: 0.85rem; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.btn-decline { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); padding: 0.75rem; border-radius: 8px; font-size: 0.9rem; cursor: pointer; }

/* Responsive */
@media (min-width: 600px) {
  #login-screen { padding: 3rem; }
  .tab-content { padding: 1.5rem; }
}
