:root {
  --navy: #232323;
  --accent: #6f7eff;
  --line: #dde2e8;
  --muted: #6b7680;
  --bg: #f4f4f4;
  --ok: #2e9e6b;
  --warn: #d9822b;
  --bad: #c0392b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: #1b232b;
  line-height: 1.5;
  background: var(--bg);
}
a {
  color: var(--navy);
}
h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}
h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}
.muted,
small {
  color: var(--muted);
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 32px 60px;
}

/* sidebar */
body.has-side {
  padding-left: 104px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 104px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 18px 10px;
  gap: 18px;
  z-index: 10;
}
.sidebar .brand {
  display: block;
  padding: 4px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar .brand img {
  width: 100%;
  height: auto;
  display: block;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.sidebar nav a,
.linklike {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 4px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 0.74rem;
  line-height: 1.2;
  text-align: center;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.8;
}
.sidebar nav a img,
.linklike svg {
  width: 26px;
  height: 26px;
  display: block;
}
.sidebar nav a:hover,
.linklike:hover {
  background: rgba(255, 255, 255, 0.07);
  opacity: 1;
}
.sidebar nav a.on {
  background: #343434;
  opacity: 1;
  font-weight: 600;
}
form.inline {
  display: inline;
  margin: 0;
}

/* cards & layout */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 20px;
}
.grid {
  display: grid;
  gap: 16px;
}
.stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 20px 0;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
}
.stat b {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--navy);
}
.two {
  grid-template-columns: 1fr 1fr;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* forms */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 12px 0 4px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="url"],
input[type="color"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c5ccd3;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
input[type="color"] {
  padding: 2px;
  height: 42px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 16px;
}
.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn.accent {
  background: var(--accent);
  color: #fff;
}
.btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
  margin: 12px 0;
}
.check input {
  width: auto;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.copybox {
  display: flex;
  gap: 8px;
}
.copybox input {
  flex: 1;
}

/* flash */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  background: #e5f5ed;
  color: #1d6b49;
}
.flash.err {
  background: #fbe9e7;
  color: #922b21;
}

/* tables */
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
tr:last-child td {
  border-bottom: 0;
}
td.n {
  white-space: nowrap;
}
.tablewrap {
  overflow-x: auto;
}

/* pills & chips */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #e8ecf0;
  color: #3a4650;
  white-space: nowrap;
}
.s-requested,
.s-preparing {
  background: #e8ecf0;
}
.s-estimate_ready,
.s-listed {
  background: #fdf0d9;
  color: #8a5300;
}
.s-scheduled,
.s-under_contract {
  background: #e1ecfa;
  color: #1e4f8a;
}
.s-in_progress,
.s-repairs {
  background: #e6e1fa;
  color: #43358a;
}
.s-completed,
.s-closed {
  background: #e0f4e9;
  color: #1d6b49;
}
.chip {
  display: inline-block;
  font-size: 0.8rem;
  background: #eef1f4;
  border-radius: 8px;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
}
.chip.soon {
  background: #fdf0d9;
  color: #8a5300;
}
.chip.late {
  background: #fbe9e7;
  color: #922b21;
}
.attention {
  border-left: 4px solid var(--accent);
}
.attention li {
  margin: 6px 0;
}
.priority {
  color: var(--bad);
  font-weight: 700;
}

/* timeline / files / gallery */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:last-child {
  border: 0;
}
.timeline time {
  color: var(--muted);
  font-size: 0.8rem;
}
.timeline p {
  margin: 0;
}
.timeline small {
  display: block;
}
.files {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.files li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.gallery a {
  text-decoration: none;
  font-size: 0.8rem;
  color: var(--muted);
}
.gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--line);
}

/* public landing + login */
body.landing {
  background: var(--navy);
  color: #fff;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
body.landing::before {
  content: "";
  position: fixed;
  left: -140px;
  bottom: -160px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.9;
}
.landing main {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 64px;
  justify-items: center;
}
.landing h1 {
  font-size: clamp(2.8rem, 11vw, 7rem);
  letter-spacing: 0.06em;
  line-height: 1;
  margin: 0;
  font-weight: 900;
  max-width: 100%;
  padding-left: 0.06em;
}
.landing .logo {
  height: auto;
  max-height: 72px;
  max-width: 80%;
  width: auto;
  object-fit: contain;
}
@media (max-width: 700px) {
  body.landing::before {
    display: none;
  }
  .landing h1 {
    font-size: clamp(2rem, 10vw, 4rem);
    letter-spacing: 0.04em;
  }
}
.landing .btn {
  background: var(--accent);
  color: #16232e;
  padding: 12px 30px;
  font-size: 1rem;
}
.authcard {
  max-width: 420px;
  margin: 8vh auto 0;
}
.authcard .card {
  padding: 28px;
}
.authcard img.logo {
  height: 44px;
  display: block;
  margin: 0 auto 18px;
}

@media (max-width: 760px) {
  .two {
    grid-template-columns: 1fr;
  }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 0;
  }
  body.has-side {
    padding-left: 0;
    padding-bottom: 76px;
  }
  .sidebar {
    inset: auto 0 0 0;
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 6px 8px;
    gap: 4px;
  }
  .sidebar .brand {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    justify-content: space-around;
    gap: 2px;
  }
  .sidebar nav a,
  .linklike {
    padding: 8px 2px;
    font-size: 0.68rem;
  }
  .sidebar .logout {
    width: 25%;
  }
  .sidebar nav a {
    flex: 1;
  }
}

/* dashboard, lists, comments, profile form */
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat img {
  flex: none;
  padding: 10px;
  box-sizing: content-box;
  width: 28px;
  height: 28px;
  background: #eef0ff;
  border-radius: 12px;
}
.stat b {
  display: block;
}
.s-pending {
  background: #fdf0d9;
  color: #8a5300;
}
.s-none {
  background: #eef1f4;
  color: #6b7680;
}
.tick {
  color: var(--ok);
  font-weight: 800;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.filters input[type="search"] {
  flex: 1 1 240px;
  width: auto;
  margin: 0;
}
.filters select {
  width: auto;
  margin: 0;
}
.subhead {
  margin: 22px 0 10px;
  font-size: 1rem;
}
.comments {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.comment {
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.comment.by-admin {
  background: #eef0ff;
  border-color: #d5d9ff;
}
.comment p {
  margin: 6px 0 0;
}
.comment .gallery {
  margin-top: 8px;
}
.commentform textarea {
  min-height: 70px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  align-items: start;
}
.form-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.form-grid .full {
  grid-column: 1 / -1;
}
.field label {
  margin-top: 0;
}
.field input[type="file"] {
  width: 100%;
}
.hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.logobox {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  margin: 6px 0 8px;
  padding: 8px;
  background: #f6f7f9;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.logobox img {
  max-height: 100%;
  max-width: 100%;
}
input[type="color"].swatch {
  width: 64px;
  height: 40px;
  padding: 2px;
}
@media (max-width: 760px) {
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
}

/* search bar & top bar */
.searchbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 16px 0 20px;
  box-shadow: 0 2px 10px rgba(35, 35, 35, 0.04);
}
.sb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}
.sb-field.grow {
  flex: 1 1 260px;
}
.sb-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #232323;
}
.sb-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sb-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(111, 126, 255, 0.2);
}
.sb-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  padding: 0;
}
.searchbar select {
  height: 42px;
  width: 100%;
  background-color: #f6f7f9;
}
.searchbar .btn {
  height: 42px;
  padding: 0 26px;
}
.topbar {
  display: flex;
  justify-content: flex-end;
  margin: -16px 0 12px;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.92rem;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}
@media (max-width: 760px) {
  .topbar {
    margin-top: 0;
  }
  .sb-field {
    flex: 1 1 100%;
  }
}

/* admin dashboard */
a.stat {
  color: inherit;
  text-decoration: none;
}
a.stat:hover {
  border-color: var(--accent);
}
.deadlines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.deadlines li {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.deadlines li:last-child {
  border: 0;
  padding: 0;
}
.deadlines .chip {
  justify-self: start;
}
