/* The app's colours: terracotta for taught classes, violet for self-practice, purple for events,
   teal for the counter, on the studio's cream. */
:root {
  --lurra: #c75c2e;
  --lurra-light: #f6e7dc;
  --cream: #faf5ef;
  --card: #ffffff;
  --ink: #2d2622;
  --muted: #8a7f78;
  --line: #ece3da;
  --autonomous: #7a5ad8;
  --event: #b03bc6;
  --sale: #0e9fb3;
  --expense: #3c78d8;
  --paid: #2fa84f;
  --due: #e0862a;
  --radius: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 30px; margin: 4px 0 18px; letter-spacing: -0.02em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lurra); margin: 28px 0 10px; }
small, .muted { color: var(--muted); }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 10px 24px;
  background: rgba(250, 245, 239, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.brand span { font-weight: 400; color: var(--muted); font-size: 14px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; background: #fff; border-radius: 999px; padding: 4px;
      box-shadow: 0 1px 4px rgba(0,0,0,.06); }
nav a { padding: 6px 14px; border-radius: 999px; font-weight: 500; }
nav a:hover { text-decoration: none; background: var(--lurra-light); }
nav a.on { background: var(--lurra-light); color: var(--lurra); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px;
         background: var(--lurra); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

main { padding: 20px 24px 40px; max-width: 1500px; margin: 0 auto; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 28px; }

/* Navigation between weeks / months */
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 18px; }
.pager .label { text-align: center; min-width: 220px; }
.pager .label b { display: block; font-size: 17px; }
.pager .label small { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.pager a.arrow { font-size: 22px; color: var(--lurra); padding: 4px 12px; border-radius: 8px; }
.pager a.arrow:hover { background: var(--lurra-light); text-decoration: none; }
.pager a.today { font-size: 12px; color: var(--lurra); font-weight: 600; }

/* The week */
.week { display: grid; grid-template-columns: repeat(var(--days), minmax(170px, 1fr)); gap: 10px; align-items: start; }
.day-head { text-align: center; background: var(--lurra-light); border-radius: 10px; padding: 8px 4px;
            margin-bottom: 8px; border: 2px solid transparent; }
.day-head .wd { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day-head .n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.day-head .mo { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day-head.today { background: var(--lurra); color: #fff; }
.day-head.today .wd, .day-head.today .mo { color: rgba(255,255,255,.8); }
.closed { background: #fff3cd; color: #7a5b00; border-radius: 8px; padding: 6px 8px; font-size: 12px; margin-bottom: 8px; }
.empty-day { color: var(--muted); font-size: 12px; text-align: center; padding: 14px 0; }

.card { border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: var(--lurra-light);
        border: 1.5px solid transparent; }
.card.owed { border-color: #3a302b; }
.card .time { font-size: 12px; font-weight: 700; }
.card .kind { font-size: 12px; font-weight: 700; padding-bottom: 5px; margin-bottom: 4px;
              border-bottom: 1px solid rgba(0,0,0,.08); }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { display: flex; align-items: center; gap: 4px; font-size: 13px; padding: 1.5px 0; }
.card li .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card li small { font-size: 11px; }
.card li.struck .who { text-decoration: line-through; color: var(--muted); }
.card .foot { font-size: 11px; color: var(--muted); margin-top: 3px; }
.card.class .time, .card.class .kind { color: var(--lurra); }
.card.autonomous { background: #efeafb; } .card.autonomous .time, .card.autonomous .kind { color: var(--autonomous); }
.card.event { background: #f8e6fb; } .card.event .time, .card.event .kind { color: var(--event); }
.card.sale { background: #e1f5f8; } .card.sale .time, .card.sale .kind { color: var(--sale); }
.card.expense { background: #e6effc; } .card.expense .kind { color: var(--expense); }
.card li .sub { display: block; font-size: 11px; color: var(--muted); }

.pay { flex: none; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px; white-space: nowrap; }
.pay.paid { background: var(--paid); color: #fff; }
.pay.due { border: 1.5px solid var(--due); color: var(--due); }
.mark { font-style: normal; font-size: 12px; flex: none; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Panels, tables, tiles */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.05); padding: 6px 0; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
     font-weight: 600; padding: 8px 14px; border-bottom: 1px solid var(--line); }
td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.dim td { color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.tile b { display: block; font-size: 22px; letter-spacing: -0.01em; }
.tile small { font-size: 12px; }
.tile.good b { color: var(--paid); } .tile.warn b { color: var(--due); } .tile.accent b { color: var(--lurra); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar form.search { display: flex; flex: 1; max-width: 320px; }
.toolbar input[type=search] { flex: 1; min-width: 220px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
                              font: inherit; background: #fff; }
.seg { display: inline-flex; background: #fff; border-radius: 10px; padding: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.seg a { padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.seg a.on { background: var(--lurra-light); color: var(--lurra); font-weight: 600; }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
          background: var(--lurra); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; }
.namecell { display: flex; align-items: center; gap: 10px; }
.tag { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--lurra-light);
       color: var(--lurra); margin-left: 4px; line-height: 18px; }
.tag.grey { background: #eee; color: var(--muted); }

.client-head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.client-head h1 { margin: 0; }
.client-head .contact { color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 24px; }

/* Changes */
.change { display: flex; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.change:last-child { border-bottom: none; }
.change .at { width: 46px; flex: none; color: var(--muted); font-size: 13px; padding-top: 1px; }
.change .icon { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center;
                justify-content: center; font-size: 15px; background: var(--lurra-light); }
.change .icon.cancelled { background: #fde8e0; } .change .icon.moved, .change .icon.move_requested { background: #e6effc; }
.change .icon.booked { background: #e3f4e6; } .change .icon.purchased { background: #f8e6fb; }
.change .icon.recovered { background: #efeafb; } .change .icon.left { background: #eee; }
.change .what { flex: 1; }
.change .what b a { color: var(--ink); }
.change .go { font-size: 12px; color: var(--lurra); white-space: nowrap; }

/* Year chart */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 16px 16px 0; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.chart .bar i { display: block; border-radius: 5px 5px 0 0; background: #e8b9a3; }
.chart .bar i.pending { background: #f6c99a; border-radius: 0; }
.chart .bar.current i { background: var(--lurra); } .chart .bar.current i.pending { background: var(--due); }
.chart .bar span { font-size: 11px; color: var(--muted); padding: 4px 0 8px; }
.chart .bar a { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart .bar a:hover { text-decoration: none; opacity: .8; }

@media (max-width: 900px) {
  main { padding: 14px 12px 30px; }
  .top { padding: 10px 12px; gap: 10px; }
  .week { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .hide-narrow { display: none; }
}

/* Buttons, menus and forms (the panel edits too) */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
       color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 10px;
       cursor: pointer; text-decoration: none; white-space: nowrap; list-style: none; }
.btn:hover { text-decoration: none; border-color: var(--lurra); }
.btn.primary { background: var(--lurra); border-color: var(--lurra); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: #b3261e; border-color: #f0c8c4; }
.btn.danger:hover { background: #fdecea; border-color: #b3261e; }
.btn.ghost { background: transparent; }
.btn.small { font-size: 12.5px; padding: 4px 10px; border-radius: 8px; }
.btn.on-ok { background: #e3f4e6; border-color: var(--paid); color: #1d7a37; }
.btn.on-warn { background: #fdeee0; border-color: var(--due); color: #a35512; }
button.pay { cursor: pointer; font-family: inherit; background: none; }
button.pay.paid { background: var(--paid); border: 1.5px solid var(--paid); }
form.inline { display: inline; margin: 0; }
.nowrap { white-space: nowrap; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin: 4px 0 12px; }
.notice { background: #e8f4ec; color: #1d5e33; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.notice.warn { background: #fff3cd; color: #6b5100; }
.pad { padding: 14px 16px; }
.center { text-align: center; }
.code { font: 600 34px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; margin: 10px 0; }
.uses-app { color: #1f6feb; font-weight: 600; font-size: 14px; margin-top: 4px; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }

details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > div { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 220px; background: #fff;
                     border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.14); padding: 6px; display: flex;
                     flex-direction: column; gap: 2px; }
details.menu.right > div { left: auto; right: 0; }
details.menu > div > a { padding: 8px 12px; border-radius: 8px; }
details.menu > div > a:hover { background: var(--lurra-light); text-decoration: none; }
details.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
details.menu .pad { gap: 8px; }
details.menu .stack { display: flex; flex-direction: column; gap: 6px; }
details.day-add > summary { text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 10px;
                            padding: 4px; font-size: 16px; }
details.day-add > summary:hover { color: var(--lurra); border-color: var(--lurra); }
details.day-add { display: block; }

.card { position: relative; }
.card a.cover { position: absolute; inset: 0; border-radius: 10px; }
.card a.cover:hover { background: rgba(0,0,0,.03); }
.card a.above, .card .pay, .card .mark { position: relative; z-index: 1; }

.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; padding: 18px; max-width: 900px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form label small { font-weight: 400; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; font-size: 14px; }
.form .actions, .form > small { grid-column: 1 / -1; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line);
                          border-radius: 9px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(199, 92, 46, .35); border-color: var(--lurra); }
.form textarea { grid-column: 1 / -1; }
.form label:has(textarea) { grid-column: 1 / -1; }

/* Sign in */
body.signin { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.signin-box { text-align: center; max-width: 380px; padding: 30px 22px; }
.signin-icon { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.signin-box h1 { margin: 14px 0 0; }
button.apple { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 18px;
               background: #000; color: #fff; border: 0; border-radius: 12px; padding: 13px 18px; font: 600 17px -apple-system, sans-serif;
               cursor: pointer; }
button.apple svg { width: 17px; height: 20px; }
.studio-choice { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 16px; text-align: left; font-size: 14px; color: var(--muted); }
.studio-choice select { width: 100%; }
details.menu.studio > div > a.on { font-weight: 600; color: var(--lurra); }
details.first-time { margin-top: 18px; text-align: left; font-size: 14px; }
details.first-time summary { cursor: pointer; color: var(--lurra); }
details.first-time input { width: 100%; margin-top: 8px; text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 900px) {
  .top .who { margin-left: 0; }
  .form { grid-template-columns: 1fr; }
}
.langs { display: inline-flex; gap: 2px; }
.langs a { font-size: 12px; padding: 3px 6px; border-radius: 6px; color: var(--muted); }
.langs a.on { background: var(--lurra-light); color: var(--lurra); font-weight: 600; }
.langs-signin { margin-top: 22px; display: flex; gap: 12px; justify-content: center; font-size: 13px; }
.langs-signin a { color: var(--muted); } .langs-signin a.on { color: var(--lurra); font-weight: 600; }
.small-input { width: 90px; padding: 4px 8px; font-size: 14px; text-align: right; }
.form .days { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.toolbar select, .toolbar input { max-width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: #fff;
        border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.chip input { display: none; }
.chip.on { background: var(--lurra-light); border-color: var(--lurra); color: var(--lurra); font-weight: 600; }
.inline-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.inline-row input, .inline-row select { padding: 4px 8px; font-size: 14px; }
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.month { padding: 10px 12px; }
.month h3 { margin: 2px 0 8px; font-size: 15px; color: var(--lurra); text-transform: capitalize; }
.month table td, .month table th { padding: 2px; text-align: center; border: 0; font-size: 12px; }
.month .wk a { color: var(--muted); font-size: 10px; }
.month a.d { display: inline-block; width: 26px; line-height: 26px; border-radius: 50%; font-size: 12.5px; }
.month a.d:hover { background: var(--lurra-light); text-decoration: none; }
.month a.d.busy { font-weight: 700; color: var(--lurra); }
.month a.d.closed { background: #fbe7b5; color: #7a5b00; text-decoration: line-through; }
.month a.d.today { background: var(--lurra); color: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar { overflow: hidden; }
.quicklinks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: -8px 0 14px; }
tr.highlight td { background: #fff8e1; }

/* Warnings before saving, and the overlap resolver. */
.warnings { margin: 0; padding: 10px 18px 10px 34px; }
.warnings li { margin: 6px 0; }
.resolve td { vertical-align: top; }
.resolve .choice { display: flex; gap: 10px; flex-wrap: wrap; }
.resolve .choice label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.arrow-to { color: var(--lurra); font-weight: 600; }
fieldset.checks { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0; }
fieldset.checks legend { color: var(--muted); font-size: .9em; padding: 0 4px; }
fieldset.checks .check { margin: 4px 0; }
.resolve b.warn { color: var(--due); }
.badge.warn { background: var(--due); }
.overlap-group { margin-bottom: 14px; padding: 0; overflow: hidden; }
.overlap-group .group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
                             padding: 10px 16px; background: #fff3cd; color: #6b5100; font-size: 14px; }
.overlap-group .problem { display: flex; justify-content: space-between; align-items: center; gap: 10px;
                          padding: 8px 16px 4px; color: var(--due); font-weight: 600; font-size: 13px; }
.overlap-group .booking { padding: 6px 16px 6px 34px; }
.overlap-group .booking:last-child { border-bottom: none; }

/* The month under a date field (daypicker.js). */
.daypicker { max-width: 320px; margin: -4px 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.daypicker .dp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.daypicker .dp-head button { border: none; background: none; font-size: 20px; padding: 0 8px; cursor: pointer; color: var(--ink); }
.daypicker .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.daypicker .dp-wd { font-size: 10px; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.daypicker .dp-day { position: relative; border: none; background: none; height: 34px; border-radius: 50%; font-size: 14px;
                     cursor: pointer; color: var(--ink); }
.daypicker .dp-day:hover:not(:disabled) { background: var(--lurra-light); }
.daypicker .dp-day:disabled { color: #cbbfb5; cursor: default; }
.daypicker .dp-day.today { color: var(--lurra); font-weight: 600; }
.daypicker .dp-day.on { background: var(--lurra-light); color: var(--lurra); font-weight: 700; }
.daypicker .dp-day.marked::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px;
                                   margin-left: -2.5px; border-radius: 50%; background: var(--lurra); }

/* Card or cash, under «Pagado»: two pills, blue and green when chosen; out of sight while the box
   just before them is not ticked. */
fieldset.method { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
fieldset.method legend { float: left; margin-right: 6px; color: var(--muted); font-size: 14px; }
fieldset.method .pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px;
  background: var(--line); cursor: pointer; font-size: 14px; }
fieldset.method .pill input { position: absolute; opacity: 0; pointer-events: none; }
fieldset.method .pill.card:has(input:checked) { background: #0a84ff; color: #fff; }
fieldset.method .pill.cash:has(input:checked) { background: #30a14e; color: #fff; }
fieldset.method .pill.unknown:has(input:checked) { background: #8e8e93; color: #fff; }
label.check:has(input[type=checkbox]:not(:checked)) + fieldset.method { display: none; }
label.check:has(input[type=checkbox]:not(:checked)) + label.payday,
label.check:has(input[type=checkbox]:not(:checked)) + label.payday + fieldset.method { display: none; }
.paid-with { font-size: 12px; margin-right: 3px; }
button.pay.cash-button { margin-left: 3px; border: 1.5px solid var(--line); padding: 0 5px; }
.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.methods details summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.methods .card-total b { color: #0a84ff; }
.methods .cash-total b { color: #30a14e; }
