:root {
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --primary-light: #40916c;
  --accent: #f4a261;
  --accent-dark: #e76f51;
  --bg: #f8f9fa;
  --card: #ffffff;
  --text: #212529;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --success: #2d6a4f;
  --danger: #dc3545;
  --warning: #ffc107;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.logo span { font-size: 1.8rem; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav a, .nav button {
  color: white;
  background: transparent;
  border: none;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s;
}

.nav a:hover, .nav button:hover {
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

.nav a.active {
  background: rgba(255,255,255,0.25);
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.lang-btn {
  background: rgba(255,255,255,0.2) !important;
  padding: 0.3rem 0.6rem !important;
  font-size: 0.85rem !important;
  border-radius: 6px !important;
}

.lang-btn.active {
  background: white !important;
  color: var(--primary-dark) !important;
}

.user-badge {
  background: var(--accent);
  color: #222;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Main */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: calc(100vh - 140px);
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 50%, #40916c 100%);
  color: white;
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
  font-weight: 800;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.3rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #222;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: white;
  color: var(--primary-dark);
}

.btn-secondary:hover {
  background: #f0f0f0;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary-dark);
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover { background: #c82333; }

.btn-success {
  background: var(--success);
  color: white;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card h2, .card h3 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

/* Grid */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Groomer card */
.groomer-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.groomer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}

.groomer-card-img {
  height: 140px;
  background: linear-gradient(135deg, #d8f3dc, #95d5b2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

.groomer-card-body {
  padding: 1.1rem;
}

.groomer-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
  color: var(--primary-dark);
}

.groomer-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #f4a261;
  font-weight: 600;
  font-size: 0.95rem;
}

.stars { letter-spacing: 1px; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.3rem;
  margin-bottom: 0.25rem;
}

.badge-mobile { background: #caf0f8; color: #0077b6; }
.badge-salon { background: #e9d8fd; color: #6b46c1; }
.badge-dog { background: #fed7aa; color: #c2410c; }
.badge-cat { background: #fce7f3; color: #be185d; }

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.checkbox-item input { width: 16px; height: 16px; cursor: pointer; }

/* Filters */
.filters {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filters .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 140px;
}

/* Profile */
.profile-header {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8f3dc, #95d5b2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  flex-shrink: 0;
}

.profile-info h1 {
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 0.3rem;
}

.services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.service-tag {
  background: #d8f3dc;
  color: var(--primary-dark);
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Reviews */
.review {
  border-left: 3px solid var(--primary);
  padding: 0.9rem 1rem;
  background: #f8faf9;
  border-radius: 0 8px 8px 0;
  margin-bottom: 0.9rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.review-author { font-weight: 600; }
.review-date { color: var(--text-muted); font-size: 0.8rem; }

/* Messages */
.messages-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  min-height: 420px;
}

.conversations-list {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.conv-item {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.conv-item:hover, .conv-item.active {
  background: #e8f5e9;
}

.conv-item h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.conv-item p { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-area {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--primary-dark);
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.msg {
  max-width: 75%;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.msg-mine {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-theirs {
  align-self: flex-start;
  background: #e9ecef;
  border-bottom-left-radius: 4px;
}

.chat-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.9rem;
  border-top: 1px solid var(--border);
}

.chat-input input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

/* Admin */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
}

.admin-sidebar {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 0;
}

.admin-sidebar button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 1.2rem;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.admin-sidebar button:hover,
.admin-sidebar button.active {
  background: #e8f5e9;
  color: var(--primary-dark);
  font-weight: 600;
}

.admin-content {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f1f8f4;
  font-weight: 600;
  color: var(--primary-dark);
}

tr:hover { background: #f8faf9; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal h2 {
  margin-bottom: 1.25rem;
  color: var(--primary-dark);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* Alerts */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.alert-success { background: #d8f3dc; color: #1b4332; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-info { background: #caf0f8; color: #023e8a; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 1.25rem;
  border-radius: var(--radius);
  text-align: center;
}

.stat-card .num {
  font-size: 2rem;
  font-weight: 800;
}

.stat-card .label {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.9rem;
  margin-top: 2rem;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty .icon { font-size: 3rem; margin-bottom: 0.75rem; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.7rem; }
  .form-row { grid-template-columns: 1fr; }
  .messages-layout, .admin-layout { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .header-inner { justify-content: center; }
  .nav { justify-content: center; }
}

/* Order form builder */
.service-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: #f8faf9;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.service-item input[type="text"],
.service-item input[type="number"] {
  flex: 1;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.service-item .price { max-width: 90px; }
/* Calendar */
.cal-wrap { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 900px) {
  .cal-wrap { grid-template-columns: 320px 1fr; }
}
.cal-settings .day-row {
  display: grid;
  grid-template-columns: 90px 40px 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.cal-settings .day-row input[type="time"] {
  padding: 0.35rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}
.cal-day {
  background: #f8faf9;
  border-radius: 8px;
  min-height: 100px;
  padding: 0.4rem;
  border: 1px solid var(--border);
}
.cal-day-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
  text-align: center;
}
.cal-day.today { border-color: var(--primary); background: #e8f5e9; }
.cal-day.other-month { opacity: 0.45; }
.cal-event {
  font-size: 0.7rem;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
  margin-bottom: 0.25rem;
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event.pending { background: var(--accent); color: #222; }
.slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.slot-btn {
  padding: 0.45rem 0.75rem;
  border: 1.5px solid var(--primary);
  background: white;
  color: var(--primary-dark);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.slot-btn:hover, .slot-btn.selected {
  background: var(--primary);
  color: white;
}
.slot-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}
.cal-nav h3 { margin: 0; color: var(--primary-dark); }
