/**
 * Just Coolers jobs dashboard.
 *
 * The same blue and the same pill buttons as the website, so it feels like the
 * business rather than a tool bolted on. Built for a phone held one-handed on a
 * job and a laptop at a desk in the evening, with no compromise in between:
 * one column and big targets small, two columns and more on screen large.
 */

:root {
  --blue: #0077c8;
  --blue-dark: #005fa3;
  --navy: #163274;
  --ink: #1f2933;
  --ink-soft: #55677a;
  --ink-faint: #7d8ea0;
  --line: #dce7ef;
  --wash: #eef8ff;
  --panel: #f6fafd;
  --warn: #b3261e;
  --warn-wash: #fdf2f1;
  --good: #1b7a4b;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 12px 28px rgba(15, 55, 90, 0.07);
  --font: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

/* Signing in ---------------------------------------------------------- */

.signin {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 18px;
  background: linear-gradient(160deg, var(--navy) 0%, #0d1f49 100%);
}

.signin__card {
  width: 100%;
  max-width: 24rem;
  padding: 28px 24px 24px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
}

.signin__title { margin: 0; font-size: 1.5rem; font-weight: 800; }
.signin__lede { margin: 4px 0 20px; color: var(--ink-soft); font-size: 0.95rem; }
.signin__error {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--warn-wash);
  border-radius: 10px;
  color: var(--warn);
  font-size: 0.9rem;
}

.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field__input,
.field select,
textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.field__input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

/* Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn--quiet { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--quiet:hover { border-color: var(--blue); color: var(--blue); }
.btn--warn { background: #fff; border-color: var(--line); color: var(--warn); }
.btn--warn:hover { border-color: var(--warn); }
.btn--wide { width: 100%; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }

/* Chrome --------------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--navy);
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.bar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 68rem;
  margin: 0 auto;
  padding: 12px 16px;
}
.bar__brand { font-weight: 800; letter-spacing: -0.01em; }
.bar__out {
  margin-left: auto;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.bar__out:hover { color: #fff; }

.tabs { display: flex; gap: 4px; }
.tab {
  padding: 6px 14px;
  background: none;
  border: 0;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.tab--on { background: rgba(255, 255, 255, 0.16); color: #fff; }

.main { max-width: 68rem; margin: 0 auto; padding: 18px 16px 48px; }
.loading { color: var(--ink-faint); }
.updated {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 16px 28px;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

/* Groups and cards ------------------------------------------------------ */

.group { margin-bottom: 28px; }
.group__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 750;
}
.group__count {
  color: var(--ink-faint);
  font-size: 0.85rem;
  font-weight: 600;
}
.group__empty {
  margin: 0;
  padding: 16px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.cards { display: grid; gap: 12px; }
@media (min-width: 46rem) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  display: block;
  width: 100%;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.card:hover { border-color: var(--blue); }
.card--urgent { border-left-color: var(--warn); }
.card--booked { border-left-color: var(--good); }
.card--new { border-left-color: var(--blue); }

.card__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}
.card__name { font-weight: 700; }
.card__flag {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.card__flag--urgent { background: var(--warn-wash); color: var(--warn); }
.card__flag--booked { background: #e8f6ee; color: var(--good); }
.card__flag--stage { background: var(--wash); color: var(--blue-dark); }

.card__meta { color: var(--ink-soft); font-size: 0.9rem; }
.card__price { font-weight: 700; color: var(--ink); }
.card__why { margin-top: 6px; color: var(--warn); font-size: 0.85rem; }

/* The job sheet --------------------------------------------------------- */

.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(15, 30, 50, 0.45); }
.sheet__panel {
  position: absolute;
  inset: auto 0 0 0;
  max-height: 92dvh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
@media (min-width: 46rem) {
  .sheet__panel {
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(38rem, calc(100vw - 48px));
    max-height: 86dvh;
    border-radius: var(--radius-lg);
  }
}

.sheet__head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.sheet__title { margin: 0; font-size: 1.15rem; font-weight: 750; }
.sheet__close {
  margin-left: auto;
  width: 2rem;
  height: 2rem;
  background: none;
  border: 0;
  color: var(--ink-faint);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.sheet__body { padding: 16px 20px 0; }

.rows { margin: 0 0 18px; }
.row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}
.row:last-child { border-bottom: 0; }
.row__key { flex: 0 0 8.5rem; color: var(--ink-soft); }
.row__val { flex: 1 1 auto; font-weight: 600; }

.actions { display: grid; gap: 10px; margin-bottom: 18px; }
@media (min-width: 30rem) {
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .btn--wide { grid-column: 1 / -1; }
}

.doing {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--wash);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.doing--bad { background: var(--warn-wash); color: var(--warn); }

.inline { display: grid; gap: 10px; margin-bottom: 18px; }
.inline__row { display: flex; gap: 10px; }
.inline__row .field__input { flex: 1 1 auto; }

/* The diary ------------------------------------------------------------- */

.day { margin-bottom: 22px; }
.day__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
  font-size: 0.95rem;
  font-weight: 750;
}
.day--today .day__head { border-bottom-color: var(--blue); color: var(--blue-dark); }
.day--past .day__head { border-bottom-color: var(--warn); color: var(--warn); }
.day__when { margin-left: auto; color: var(--ink-faint); font-size: 0.8rem; font-weight: 600; }

/* Photos ---------------------------------------------------------------- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.shot {
  display: block;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 20, 35, 0.9);
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
}

/* Messages -------------------------------------------------------------- */

.msg { margin-bottom: 18px; }
.msg__list { display: grid; gap: 8px; }
.msg__preview {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.86rem;
  white-space: pre-wrap;
  max-height: 14rem;
  overflow-y: auto;
}
.msg__send { display: grid; gap: 8px; margin-top: 10px; }
@media (min-width: 30rem) { .msg__send { grid-template-columns: repeat(3, 1fr); } }
.msg__after { display: grid; gap: 8px; margin-top: 10px; }
.msg__note {
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

/* Clients --------------------------------------------------------------- */

.find { margin-bottom: 16px; }
.find__input {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font: inherit;
  background: #fff;
}
.find__input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.find__count { margin: 8px 2px 0; color: var(--ink-faint); font-size: 0.82rem; }

.who {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.who:hover { border-color: var(--blue); }
.who__main { min-width: 0; }
.who__name { font-weight: 700; }
.who__meta {
  color: var(--ink-soft);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who__right { margin-left: auto; text-align: right; flex: 0 0 auto; }
.who__open {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 700;
}
.who__spent { color: var(--ink-faint); font-size: 0.78rem; }

.history { margin-top: 4px; }
.history__row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.history__row:last-child { border-bottom: 0; }
.history__stage {
  flex: 0 0 7rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
}
.history__what { flex: 1 1 auto; }
.history__money { margin-left: auto; font-weight: 700; white-space: nowrap; }

.field__input--time { flex: 0 0 7.5rem; }
