@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f4f6f1;
  --panel: #ffffff;
  --panel-soft: #f9faf6;
  --ink: #171c16;
  --muted: #6f786b;
  --line: #e1e7db;
  --brand: #7fa12b;
  --brand-strong: #57741a;
  --brand-dark: #141a13;
  --accent: #c79a3a;
  --soft: #eef5df;
  --danger: #b83b3b;
  --radius: 8px;
  --shadow: 0 18px 45px rgba(28, 36, 25, 0.1);
  --shadow-soft: 0 10px 24px rgba(28, 36, 25, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f8faf4 0%, var(--bg) 42%, #eef2e8 100%);
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(400px, 0.95fr);
  background: var(--brand-dark);
}

.login-brand {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  background-position: center;
  background-size: cover;
  color: #fff;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.hero-logo {
  width: min(210px, 48vw);
  height: auto;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.brand-copy h1 {
  max-width: 720px;
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 5vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.brand-copy p {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
  line-height: 1.7;
}

.login-panel {
  display: grid;
  align-content: center;
  padding: 46px;
  background: linear-gradient(180deg, #fbfcf8, #eef3e8);
}

.login-box {
  width: min(100%, 440px);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(225, 231, 219, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-box h2,
.view-title h2,
.section-title h3 {
  margin: 0;
}

.login-box h2 {
  font-size: 1.72rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #596351;
  font-size: 0.82rem;
  font-weight: 800;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.textarea {
  min-height: 112px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(127, 161, 43, 0.14);
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #8fb239, var(--brand));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(87, 116, 26, 0.18);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.btn:hover {
  background: linear-gradient(180deg, #789b2a, var(--brand-strong));
  box-shadow: 0 10px 22px rgba(87, 116, 26, 0.24);
  transform: translateY(-1px);
}

.btn.secondary {
  background: #eef2eb;
  color: #20261f;
  box-shadow: none;
}

.btn.secondary:hover {
  background: #e3eadf;
  box-shadow: none;
}

.btn.danger {
  background: #f5e8e8;
  color: var(--danger);
  box-shadow: none;
}

.btn.danger:hover {
  background: #eedada;
  box-shadow: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 42%),
    var(--brand-dark);
  color: #fff;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.side-logo {
  width: 88px;
  height: auto;
  padding: 7px;
  border-radius: var(--radius);
  background: #fff;
}

.side-head strong {
  display: block;
  font-size: 1.02rem;
}

.side-head span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 42px;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  font-weight: 750;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav button.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.content {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.view-title h2 {
  font-size: 1.95rem;
  line-height: 1.15;
}

.view-title p {
  margin: 7px 0 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu {
  display: none;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
}

.grid.two.wide-left {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.56fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section,
.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(225, 231, 219, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.section {
  padding: 21px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title h3 {
  font-size: 1.08rem;
  font-weight: 800;
}

.metric {
  padding: 19px;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 16px 0 auto;
  width: 74px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand);
  opacity: 0.42;
}

.metric span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
}

.metric strong {
  display: block;
  margin-top: 9px;
  font-size: 2rem;
  line-height: 1.1;
}

.list {
  display: grid;
  gap: 11px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.row-main {
  min-width: 0;
}

.row-main strong,
.row-main span {
  display: block;
}

.row-main strong {
  line-height: 1.35;
}

.row-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-select {
  width: auto;
  min-width: 190px;
  min-height: 42px;
}

.booking-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.booking-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: var(--radius);
  background: #eef4e5;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 800;
}

.booking-chip small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.booking-chip.attendance-present {
  background: #e4f4e8;
}

.booking-chip.attendance-absent {
  background: #fff0e6;
}

.booking-chip button {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eadada;
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.booking-chip .whatsapp-mini {
  width: auto;
  min-width: 42px;
  padding: 0 8px;
  background: #dff4e8;
  color: #167344;
}

.booking-chip .attendance-mini {
  width: 24px;
  height: 22px;
  border-radius: 6px;
  color: #fff;
}

.booking-chip .attendance-mini.present {
  background: #2e8b57;
}

.booking-chip .attendance-mini.absent {
  background: #b86a2f;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-strong);
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.pill.warn {
  background: #fff1e3;
  color: #94601a;
}

.pill.paid {
  background: #e3f4e8;
  color: #1f7a3f;
}

.pill.danger-pill {
  background: #f4e7e7;
  color: var(--danger);
}

.history-head,
.report-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.history-head .field {
  width: min(100%, 360px);
}

.history-profile {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
  text-align: right;
}

.history-profile h3 {
  width: 100%;
  margin: 0;
  font-size: 1.3rem;
}

.history-profile span {
  color: var(--muted);
  font-size: 0.9rem;
}

.note-box {
  min-height: 84px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcf8;
  color: var(--muted);
  line-height: 1.62;
  white-space: pre-wrap;
}

.note-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.note-box p {
  margin: 0;
}

.report-hero h3 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.report-hero p {
  margin: 0;
}

.report-summary {
  display: grid;
  gap: 10px;
}

.report-summary span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}

.report-summary strong {
  color: var(--ink);
}

.empty {
  padding: 18px;
  border: 1px dashed #ccd7c2;
  border-radius: var(--radius);
  color: var(--muted);
  background: #fbfcf8;
  text-align: center;
}

.client-card {
  display: grid;
  gap: 12px;
  padding: 17px;
}

.client-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.client-card h4 {
  margin: 0;
  font-size: 1.12rem;
}

.client-meta {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.42;
}

.alert {
  display: none;
  margin: 12px 0 0;
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff1e8;
  color: #8b421b;
  font-weight: 700;
}

.alert.show {
  display: block;
}

.dashboard-main,
.report-grid {
  margin-top: 18px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-title {
  margin-top: 18px;
}

.agenda-row {
  align-items: flex-start;
}

.split-actions {
  justify-content: flex-start;
}

.small-empty {
  margin-top: 10px;
  padding: 10px;
  text-align: left;
}

.drawer-backdrop {
  display: none;
}

@media (max-width: 920px) {
  body {
    background: #f5f7f1;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100svh;
  }

  .login-brand {
    min-height: 30svh;
    padding: 26px 22px;
    gap: 34px;
  }

  .login-panel {
    padding: 22px;
    align-content: start;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(88vw, 320px);
    padding: 18px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    z-index: 15;
    inset: 0;
    background: rgba(5, 12, 10, 0.48);
  }

  .drawer-backdrop.open {
    display: block;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .content {
    padding: 14px;
  }

  .grid.two,
  .grid.two.wide-left {
    grid-template-columns: 1fr;
  }

  .grid.three,
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    align-items: flex-start;
    margin: -14px -14px 18px;
    padding: 12px 14px;
    background: rgba(245, 247, 241, 0.96);
    border-bottom: 1px solid rgba(225, 231, 219, 0.9);
    backdrop-filter: blur(12px);
  }

  .view-title h2 {
    font-size: 1.5rem;
  }

  .section {
    padding: 18px;
  }

  .metric {
    padding: 16px;
  }

  .metric strong {
    font-size: 1.55rem;
  }

  .client-card {
    padding: 15px;
  }
}

@media (max-width: 560px) {
  .hero-logo {
    width: 142px;
    padding: 7px;
  }

  .brand-copy h1 {
    font-size: 2rem;
    line-height: 1.06;
  }

  .brand-copy p {
    font-size: 0.96rem;
    line-height: 1.55;
  }

  .login-box,
  .section {
    padding: 16px;
  }

  .login-box {
    box-shadow: 0 12px 28px rgba(28, 36, 25, 0.08);
  }

  .login-box h2 {
    font-size: 1.45rem;
  }

  .content {
    padding: 10px;
  }

  .topbar {
    margin: -10px -10px 14px;
    padding: 10px;
    gap: 10px;
  }

  .view-title h2 {
    font-size: 1.28rem;
  }

  .view-title p {
    font-size: 0.88rem;
  }

  .grid {
    gap: 12px;
  }

  .grid.three,
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .metric {
    min-height: 108px;
  }

  .metric span {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .metric strong {
    font-size: 1.42rem;
  }

  .row {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: flex-start;
  }

  .row-actions .btn,
  .row-actions .select {
    width: 100%;
    min-width: 0;
  }

  .compact-select {
    width: 100%;
  }

  .topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
  }

  .topbar-actions,
  .topbar-actions .btn {
    width: auto;
  }

  .topbar-actions {
    display: flex;
    justify-content: flex-end;
  }

  .topbar .pill {
    font-size: 0.72rem;
    padding-inline: 8px;
    white-space: nowrap;
  }

  .mobile-menu {
    width: 44px;
    min-width: 44px;
    padding-inline: 0;
  }

  .history-head,
  .report-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .history-head .field,
  .report-hero .btn {
    width: 100%;
  }

  .history-profile {
    justify-content: flex-start;
    text-align: left;
  }

  .client-card-head {
    flex-direction: column;
    gap: 8px;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .time-grid {
    grid-template-columns: 1fr;
  }

  .booking-chip {
    width: 100%;
    justify-content: space-between;
  }

  .pill {
    white-space: normal;
  }
}
