:root {
  --green: #157a45;
  --green-dark: #0d4f2c;
  --green-deep: #08331c;
  --green-soft: #e8f6ee;
  --lime: #c6f135;
  --navy: #0b1f33;
  --ink: #122033;
  --muted: #5b6b7c;
  --line: #e4ebe6;
  --paper: #f4f7f5;
  --white: #ffffff;
  --clay: #e85d04;
  --amber: #f4a261;
  --blue: #2b6cb0;
  --violet: #6d28d9;
  --rose: #be185d;
  --teal: #0f766e;
  --danger: #c0392b;
  --warn: #d97706;
  --ok: #15803d;
  --shadow: 0 10px 30px rgba(11, 31, 51, 0.08);
  --radius: 14px;
  --sidebar: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
}
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.hidden { display: none !important; }

/* ========== LOGIN ========== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.login-hero {
  background:
    linear-gradient(160deg, rgba(8,51,28,.88), rgba(11,31,51,.72)),
    radial-gradient(circle at 20% 80%, rgba(198,241,53,.25), transparent 45%),
    #0d4f2c;
  color: white;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 340px;
  height: 340px;
  border: 28px solid rgba(198,241,53,.12);
  border-radius: 50%;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.ball {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8ff7a, var(--lime) 45%, #8fb50f);
  box-shadow: inset -4px -6px 0 rgba(0,0,0,.08);
  position: relative;
}
.ball::before, .ball::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(13,79,44,.35);
  border-radius: 50%;
  width: 28px; height: 28px;
  top: 4px;
}
.ball::before { left: -10px; }
.ball::after { right: -10px; }
.login-hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: 52px;
  line-height: 1.05;
  margin: 40px 0 16px;
  max-width: 520px;
}
.login-hero p { max-width: 440px; color: rgba(255,255,255,.82); font-size: 16px; }
.hero-meta { display: flex; gap: 28px; font-size: 13px; color: rgba(255,255,255,.75); }
.hero-meta strong { display: block; color: var(--lime); font-size: 15px; }

.login-panel {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea, .input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdfc;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21,122,69,.12);
}
.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .15s ease;
}
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); }
.btn-dark { background: var(--navy); color: white; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--green-soft); }
.btn-danger { background: #fde8e6; color: var(--danger); }
.btn-warn { background: #fff4e0; color: #9a5b00; }
.btn-lime { background: var(--lime); color: var(--green-deep); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.err { color: var(--danger); font-size: 13px; margin: 8px 0; min-height: 18px; }

.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.demo-chip {
  border: 1px solid var(--line);
  background: #fbfdfc;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
}
.demo-chip strong { display: block; font-size: 13px; }
.demo-chip span { color: var(--muted); }

/* ========== SHELL ========== */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100%; }
.sidebar {
  background: var(--green-deep);
  color: white;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 14px;
}
.side-brand .name { font-weight: 700; letter-spacing: .04em; }
.side-brand .name small { display: block; font-weight: 500; opacity: .65; letter-spacing: .12em; font-size: 10px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav button {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.78);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav button:hover { background: rgba(255,255,255,.06); color: white; }
.nav button.active { background: rgba(198,241,53,.16); color: var(--lime); }
.nav .section-label {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.38);
  padding: 14px 12px 6px;
}
.side-user {
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green-deep);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.side-user .who { font-size: 13px; }
.side-user .who span { display: block; opacity: .6; font-size: 11px; }
.linkish { background: none; border: 0; color: rgba(255,255,255,.55); font-size: 12px; padding: 0; margin-top: 4px; }

.main { min-width: 0; }
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.topbar .crumbs { color: var(--muted); font-size: 13px; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.search {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 220px;
  font-size: 13px;
}
.content { padding: 22px; }

/* ========== CARDS / GRID ========== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.kpi .value { font-size: 28px; font-weight: 700; margin: 6px 0 2px; }
.kpi .hint { font-size: 12px; color: var(--muted); }
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-h {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-h h3 { font-size: 15px; }
.panel-b { padding: 16px; }
.split { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid #f0f4f1; vertical-align: middle; }
tr:hover td { background: #f8fbf9; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}
.tag-green { background: #e7f7ee; color: #146c38; }
.tag-orange { background: #ffedd5; color: #9a4b08; }
.tag-blue { background: #e0edff; color: #1e4f99; }
.tag-violet { background: #eee4ff; color: #5b21b6; }
.tag-rose { background: #fce7f3; color: #9d174d; }
.tag-teal { background: #ccfbf1; color: #0f766e; }
.tag-gray { background: #eef2f4; color: #4b5b6a; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-lime { background: #ecfccb; color: #3f6212; }

/* ========== SCHEDULER ========== */
.sched-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.date-nav { display: flex; align-items: center; gap: 8px; }
.date-nav .date-label { font-weight: 700; min-width: 210px; text-align: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; }

.grid-wrap { overflow: auto; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.court-grid {
  display: grid;
  min-width: 920px;
  grid-template-columns: 78px repeat(4, 1fr);
}
.g-head, .g-time, .g-cell {
  border-bottom: 1px solid #eef3ef;
  border-right: 1px solid #eef3ef;
}
.g-head {
  position: sticky; top: 0; z-index: 2;
  background: #f7faf8;
  padding: 12px;
  font-weight: 700;
  font-size: 13px;
}
.g-head small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.g-time {
  background: #fbfdfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  display: flex;
  align-items: flex-start;
}
.g-cell {
  min-height: 64px;
  position: relative;
  background: white;
}
.g-cell.morning { background: #f7fff9; }
.g-cell.evening { background: #fffaf4; }
.g-cell.open:hover { background: #eef8f1; cursor: pointer; }
.slot {
  position: absolute;
  inset: 3px 4px;
  border-radius: 6px;
  padding: 8px 10px 8px 8px;
  color: #1a1a1a;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.06);
}
.slot strong { display: block; font-size: 12px; padding-right: 28px; font-weight: 700; }
.slot .meta { opacity: .92; }
.coach-tag {
  position: absolute;
  top: 6px; right: 6px;
  background: #16a34a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 4px;
}
.pay-tag {
  position: absolute;
  bottom: 6px; right: 6px;
  font-weight: 800;
  font-size: 13px;
}
.reserve-btn {
  display: inline-block;
  margin: 14px auto 0;
  border: 1px solid #d7dee6;
  background: #fff;
  color: #4b5b6a;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
}
.g-cell.open { display: flex; justify-content: center; }
.t-rental { background: #2f4ea3; color: #fff; }
.t-private { background: #f2e34a; color: #1a1a1a; }
.t-am { background: #f5b942 !important; color: #1a1a1a !important; }
.t-semi { background: #e53935; color: #fff; }
.t-pgroup { background: #f59e0b; color: #1a1a1a; }
.t-group { background: #22c55e; color: #08331c; }
.t-kids { background: #9c27b0; color: #fff; }
.t-promo { outline: 2px dashed var(--lime); }
.slot.unpaid { box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }

/* ========== MODAL ========== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(11,31,51,.46);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 50;
  overflow: auto;
}
.modal {
  background: white;
  width: min(720px, 100%);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.modal-h {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-h h3 { font-size: 18px; }
.modal-b { padding: 18px; }
.modal-f { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.price-box {
  background: var(--green-soft);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.price-box .amt { font-size: 24px; font-weight: 700; color: var(--green-dark); }
.muted { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 6px; }

/* ========== PACKAGES ========== */
.pkg-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: white;
}
.pkg-card h4 { font-size: 15px; margin-bottom: 4px; }
.pkg-prices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.pkg-prices div {
  background: var(--paper);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}
.pkg-prices small { display: block; color: var(--muted); font-size: 11px; }
.pkg-prices b { font-size: 13px; }

.client-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f4f1;
}
.progress {
  height: 8px;
  background: #e6eee8;
  border-radius: 99px;
  overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--green); }

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.pill-toggle { display: flex; background: var(--paper); border-radius: 10px; padding: 3px; }
.pill-toggle button {
  border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.pill-toggle button.on { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }

@media (max-width: 980px) {
  .login-wrap, .shell, .kpis, .split, .two, .three, .form-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex !important; }
}
.mobile-nav { display: none; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  background: var(--navy);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.2);
  font-size: 13px;
  font-weight: 600;
  max-width: 360px;
}
.toast-ok { background: var(--green-dark); }
.toast-warn { background: #9a5b00; }
code { font-size: 12px; background: var(--paper); padding: 1px 6px; border-radius: 6px; }
