:root {
  --blue: #2563eb;
  --blue-soft: #eaf2ff;
  --green: #16a34a;
  --green-soft: #eaf8ef;
  --orange: #f59e0b;
  --orange-soft: #fff5e6;
  --violet: #8b5cf6;
  --violet-soft: #f3e8ff;
  --red: #ef4444;
  --red-soft: #fdecec;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 292px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand, .login-brand { display: flex; gap: 14px; align-items: center; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 12px 22px rgba(37, 99, 235, .22);
}
.brand-title { font-weight: 800; font-size: 18px; }
.brand-subtitle { color: var(--muted); font-size: 12px; line-height: 1.3; }
.sidebar-nav { display: grid; gap: 8px; margin-top: 34px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 650;
}
.nav-item i { font-size: 18px; }
.nav-item.active, .nav-item:hover { background: var(--blue-soft); color: var(--blue); }
.sidebar-tip {
  margin-top: auto;
  background: #f6f9ff;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 8px;
}
.tip-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
}
.sidebar-tip span, small, .text-muted { color: var(--muted) !important; }
.app-main { margin-left: 292px; width: calc(100% - 292px); padding: 28px; }
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 26px;
}
.topbar h1 { font-size: 32px; font-weight: 850; margin: 0; letter-spacing: 0; }
.top-search {
  flex: 1;
  min-width: 260px;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 16px;
  height: 50px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .04);
}
.top-search input { border: 0; outline: 0; width: 100%; color: var(--text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 15px;
  color: var(--text);
}
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: #fff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  font-size: 11px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}
.profile-button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 7px;
}
.profile-copy { display: grid; text-align: left; line-height: 1.15; }
.profile-copy strong { font-size: 14px; }
.profile-copy small { font-size: 12px; }
.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: var(--blue);
}
.avatar-sm { width: 38px; height: 38px; font-size: 14px; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.kpi-card, .content-card, .person-card, .bottom-banner {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, .85);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.kpi-card { padding: 20px; display: flex; align-items: center; gap: 16px; min-height: 124px; }
.kpi-card span, .person-stats span { color: var(--muted); font-size: 13px; }
.kpi-card strong { display: block; font-size: 27px; line-height: 1.1; margin: 4px 0; }
.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.accent-green .kpi-icon { background: var(--green-soft); color: var(--green); }
.accent-blue .kpi-icon { background: var(--blue-soft); color: var(--blue); }
.accent-orange .kpi-icon { background: var(--orange-soft); color: var(--orange); }
.accent-violet .kpi-icon { background: var(--violet-soft); color: var(--violet); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, .9fr); gap: 20px; margin-bottom: 20px; }
.people-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.person-card { padding: 20px; }
.person-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.person-head h3 { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.status-pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}
.status-pill.success { background: var(--green-soft); color: var(--green); }
.status-pill.muted { background: #f1f5f9; color: var(--muted); }
.person-stats { display: grid; gap: 10px; }
.person-stats strong { display: block; color: var(--text); font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.modern-progress { height: 8px; background: #eef2f7; border-radius: 999px; margin-top: 18px; }
.modern-progress div { height: 100%; background: var(--blue); border-radius: inherit; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 8px; }
.content-card { padding: 22px; }
.compact-card, .form-card { max-width: 920px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-title-row h2, .content-card h2, .bottom-banner h2 { font-size: 20px; font-weight: 850; margin: 0; }
.calendar-nav { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 750; }
.calendar-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
}
.mini-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days { text-align: center; font-size: 12px; font-weight: 800; }
.cal-day {
  min-height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--muted);
  font-weight: 700;
}
.cal-day.selected { background: var(--blue); color: #fff; }
.cal-day.outside-month { opacity: .34; }
.dot, .legend { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot { position: absolute; bottom: 5px; }
.dynamic-dot.dot-1 { left: calc(50% - 12px); }
.dynamic-dot.dot-2 { left: calc(50% - 3px); }
.dynamic-dot.dot-3 { left: calc(50% + 6px); }
.blue { background: var(--blue); }.green { background: var(--green); }.orange { background: var(--orange); }.violet { background: var(--violet); }.red { background: var(--red); }
.legend-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.legend-list span { display: inline-flex; align-items: center; gap: 6px; }
.card-link { display: inline-block; color: var(--blue); font-weight: 750; margin-top: 16px; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr); gap: 20px; margin-bottom: 20px; }
.modern-table { margin: 0; }
.modern-table thead th { color: var(--muted); font-size: 12px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.table-sort-link {
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 850;
}
.bulk-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.service-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.service-search {
  margin: 0;
  max-width: 420px;
  box-shadow: none;
}
.bulk-toolbar .form-select { max-width: 240px; }
.select-col { width: 42px; text-align: center; }
.selected-services {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.selected-services span {
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 750;
}
.modern-table td { border-color: #edf2f7; padding: 16px 10px; }
.modern-table td small { display: block; margin-top: 3px; }
.pagination-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
.page-link {
  border-color: var(--border);
  color: var(--blue);
  font-weight: 750;
}
.page-item.active .page-link {
  background: var(--blue);
  border-color: var(--blue);
}
.badge-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.status-in_progress { background: var(--blue-soft); color: var(--blue); }
.status-to_validate, .status-planned { background: var(--orange-soft); color: var(--orange); }
.status-validated { background: var(--green-soft); color: var(--green); }
.status-late { background: var(--red-soft); color: var(--red); }
.status-cancelled { background: #f1f5f9; color: var(--muted); }
.payment-list { display: grid; gap: 12px; }
.payment-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}
.payment-row em { font-style: normal; font-weight: 800; font-size: 12px; border-radius: 999px; padding: 5px 8px; }
.payment-row .paid { background: var(--green-soft); color: var(--green); }
.payment-row .due { background: var(--orange-soft); color: var(--orange); }
.total-bar {
  margin-top: 18px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  font-weight: 850;
}
.due-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.due-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(22, 163, 74, .14);
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 750;
}
.due-chip span { color: var(--text); }
.bottom-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff, #f3f8ff);
}
.bottom-banner p { color: var(--muted); margin: 6px 0 0; }
.banner-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 24px;
}
.btn { border-radius: 12px; font-weight: 750; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-soft { box-shadow: 0 10px 22px rgba(37, 99, 235, .14); }
.form-control, .form-select {
  border-radius: 14px;
  border-color: var(--border);
  min-height: 46px;
}
.form-label { color: var(--muted); font-weight: 750; font-size: 13px; }
.calendar-shell .fc { color: var(--text); }
.fc .fc-toolbar-title { font-size: 22px; font-weight: 850; }
.fc .fc-button-primary { background: var(--blue); border-color: var(--blue); border-radius: 12px; }
.fc .fc-daygrid-day { background: #fff; }
.fc-theme-standard td, .fc-theme-standard th { border-color: #edf2f7; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top left, #eaf2ff, transparent 34%), var(--bg);
}
.login-panel { width: min(440px, calc(100% - 32px)); }
.login-brand { margin-bottom: 22px; }
.login-brand h1 { font-size: 26px; margin: 0; font-weight: 900; }
.login-brand p { color: var(--muted); margin: 2px 0 0; }
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-card h2 { font-weight: 900; margin-bottom: 22px; }
.login-hint { color: var(--muted); text-align: center; margin: 18px 0 0; font-size: 13px; }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; min-height: auto; }
  .app-shell { display: block; }
  .app-main { margin-left: 0; width: 100%; padding: 18px; }
  .topbar { flex-wrap: wrap; }
  .top-search { order: 3; max-width: none; width: 100%; }
  .people-strip { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .top-actions { width: 100%; justify-content: space-between; }
  .profile-copy { display: none; }
  .card-title-row { align-items: flex-start; flex-direction: column; }
}
