:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #242c37;
  background: #f3f5f8;
  --nav: #1a2330;
  --ink: #242c37;
  --muted: #566273;
  --line: #e0e5ec;
  --blue: #39617b;
  --blue-hover: #2b4e65;
  --white: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
:focus-visible { outline: 2px solid #3679a7; outline-offset: 2px; }
[hidden] { display: none !important; }
.icon { display: block; width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.shell { display: grid; grid-template-columns: 14rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--nav); color: #fff; min-height: 100vh; position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; gap: 1.9rem; padding: 2.1rem 1rem 1.35rem; }
.sidebar nav { display: grid; gap: .38rem; }
.sidebar a { display: flex; align-items: center; gap: .62rem; min-height: 2.65rem; color: #e4ebf1; text-decoration: none; padding: .45rem .65rem; border-radius: .46rem; font-weight: 600; font-size: .9rem; }
.sidebar a:hover, .sidebar a:focus-visible { color: #fff; background: #303f50; }
.sidebar a .icon { color: #a9c4d7; }
.private { display: flex; align-items: center; gap: .58rem; border-top: 1px solid #3b4857; margin-top: auto; padding: 1rem .3rem .1rem; color: #c5d0dc; font-size: .82rem; }
.private .icon { color: #a9c4d7; width: .95rem; height: .95rem; }
main { width: 100%; max-width: 100rem; margin-inline: auto; padding: 2.35rem clamp(1.3rem, 3.2vw, 3.25rem) 2.8rem; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: .9rem; margin-bottom: 1.65rem; }
.heading > div { min-width: 0; }
.brand-logo { display: block; width: min(100%, 19rem); height: auto; margin-bottom: .82rem; }
h1, h2, p { margin: 0; }
h1 { line-height: 1.08; font-weight: 750; font-size: clamp(2rem, 3.2vw, 2.7rem); letter-spacing: -.044em; }
h2 { font-size: 1.16rem; letter-spacing: -.025em; line-height: 1.2; }
.description { margin-top: .55rem; color: var(--muted); line-height: 1.45; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border-radius: .48rem; min-height: 2.5rem; padding: .42rem .83rem; border: 1px solid transparent; font-weight: 650; font-size: .88rem; white-space: nowrap; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: var(--blue-hover); }
.main-action { min-height: 2.75rem; padding-inline: .94rem; margin-bottom: .08rem; }
.secondary { background: #fff; border-color: #ccd7e1; color: #365570; }
.secondary:hover, .icon-button:hover { background: #edf3f7; }
.plain { background: transparent; color: var(--blue); }
.plain:hover { background: #e8f0f6; }
.icon-button { width: 2.35rem; min-height: 2.35rem; border: 0; border-radius: .42rem; display: inline-grid; place-items: center; background: transparent; color: #4b5564; padding: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .88rem; margin-bottom: 1.25rem; }
.metric, .panel { background: var(--white); border: 1px solid var(--line); border-radius: .72rem; box-shadow: 0 1px 2px #232a3609; }
.metric { text-decoration: none; min-height: 5.6rem; padding: .87rem 1rem; display: flex; align-items: flex-start; gap: .67rem; color: var(--ink); }
.metric:hover { border-color: #adbdcb; background: #fcfdff; }
.metric-icon, .section-icon { display: grid; place-items: center; border-radius: .54rem; width: 2.38rem; height: 2.38rem; flex: none; }
.blue-icon { background: #e9f1f7; color: #426682; }
.amber-icon { background: #fff3db; color: #865a13; }
.red-icon { background: #fceeea; color: #9b3b30; }
.metric-label { display: block; font-size: .9rem; font-weight: 620; line-height: 1.25; }
.metric-number { display: block; font-size: 1.68rem; font-weight: 750; letter-spacing: -.05em; line-height: 1.1; margin-top: .24rem; }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-height: 3rem; margin-bottom: .7rem; }
.filter-field { display: flex; align-items: center; gap: .5rem; min-height: 2.52rem; min-width: 0; padding-inline: .65rem; border: 1px solid #d5dce5; background: #fff; border-radius: .46rem; color: #5a6c7e; }
.filter-field:not(.type-filter) { flex: 0 1 20.5rem; }
.filter-field input, .filter-field select { width: 100%; border: 0; min-height: 2.3rem; color: var(--ink); padding-block: .28rem; background-color: #fff; font-size: .9rem; }
.filter-field input::placeholder { color: var(--muted); }
select { appearance: none; padding-right: 1.75rem !important; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m2.5 4.5 3.5 3 3.5-3' fill='none' stroke='%23535e70' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .54rem center; }
.match-count { margin-left: auto; font-size: .85rem; color: var(--muted); }
.panel { margin-bottom: 1rem; overflow: hidden; }
.section-heading { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.section-heading p, .dialog-heading p { color: var(--muted); font-size: .9rem; line-height: 1.35; margin-top: .24rem; }
.check-list { width: 100%; border-collapse: collapse; text-align: left; }
.check-list th { color: var(--muted); font-size: .84rem; background: #f8fafc; font-weight: 650; }
.check-list td, .check-list th { padding: .65rem .76rem; border-bottom: 1px solid var(--line); }
.check-list td:first-child, .check-list th:first-child { padding-left: 1.15rem; }
.check-list td:last-child { padding-right: 1.15rem; text-align: right; }
.check-list tr:last-child td { border-bottom: 0; }
.check-list td { font-size: .91rem; }
.check-customer, .check-type, .check-detail { display: block; overflow-wrap: anywhere; }
.check-detail { margin-top: .16rem; color: var(--muted); font-size: .83rem; line-height: 1.28; }
.check-date { white-space: nowrap; }
.status { display: inline-flex; align-items: center; white-space: nowrap; padding: .23rem .5rem; border-radius: 1rem; background: #edf1f5; color: #415268; font-size: .8rem; font-weight: 650; }
.status.overdue { background: #fbece9; color: #a13225; }
.status.soon { background: #fff2d7; color: #7b540d; }
.status.closed { background: #eaf4ee; color: #22634b; }
.empty { padding: 1.4rem 1.15rem; color: var(--muted); font-size: .94rem; }
.history summary { padding: .95rem 1.15rem; font-weight: 650; }
.history-count { margin-left: .35rem; color: var(--muted); font-weight: 500; }
.notice { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .65rem; padding: .75rem 1rem; margin-bottom: .85rem; border-radius: .6rem; }
.notice, .form-error { background: #fff0ec; color: #932f21; }
dialog { width: min(40rem, calc(100vw - 1.2rem)); max-height: calc(100vh - 1rem); overflow: auto; border: 1px solid #d7dce4; border-radius: .8rem; padding: 0; background: #fff; color: var(--ink); box-shadow: 0 20px 75px #1419274a; }
dialog::backdrop { background: #171d2a78; }
.dialog-heading { padding: 1.05rem 1.18rem .8rem; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 1.4rem; }
.form-fields { display: grid; gap: .7rem; padding: .8rem 1.18rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .62rem; }
fieldset.address-group { border: 1px solid var(--line); border-radius: .5rem; min-inline-size: 0; margin: 0; padding: .56rem .62rem .64rem; }
.address-group legend { padding-inline: .24rem; }
.address-fields { grid-template-columns: minmax(0, 2fr) minmax(0, .7fr) minmax(0, 1.25fr); }
.form-fields label, .form-fields legend { display: block; color: #333d4b; font-size: .9rem; font-weight: 620; }
.form-fields small { color: var(--muted); font-weight: 480; font-size: .8rem; }
.form-fields :is(input:not([type="checkbox"]), select, textarea) { display: block; width: 100%; min-width: 0; min-height: 2.35rem; margin-top: .25rem; padding: .4rem .53rem; background-color: #fff; border: 1px solid #d4dce5; border-radius: .42rem; color: var(--ink); font-size: .94rem; font-weight: 400; }
.form-fields textarea { resize: vertical; }
.completion { border: 1px solid var(--line); background: #f7f9fc; border-radius: .5rem; padding: .54rem .65rem; display: grid; gap: .54rem; }
.form-fields .checkbox { display: flex; align-items: center; gap: .52rem; min-height: 1.55rem; }
.checkbox input { accent-color: var(--blue); width: 1rem; height: 1rem; }
.field-help { color: var(--muted); font-size: .83rem; margin-top: .3rem; }
.cycle-reset { min-height: 1.7rem; padding: .2rem .38rem; margin-top: .2rem; }
.dialog-footer { display: flex; align-items: center; gap: .35rem; padding: .76rem 1.18rem; border-top: 1px solid var(--line); }
.footer-actions { display: flex; gap: .55rem; margin-left: auto; }
.danger { color: #a1392b; background: transparent; }
.danger:hover { background: #fbece9; }
.danger-solid { background: #a1392b; color: #fff; }
.danger-solid:hover { background: #86291e; }
.form-error { padding: .43rem .62rem; border-radius: .45rem; font-size: .9rem; }
.toast { position: fixed; z-index: 5; bottom: 1rem; right: 1rem; max-width: min(27rem, calc(100% - 2rem)); padding: .7rem 1rem; border-radius: .58rem; background: #263345; color: #fff; box-shadow: 0 6px 20px #1e25312e; font-size: .91rem; }
@media (max-width: 1120px) {
  .shell { grid-template-columns: 11.9rem minmax(0, 1fr); }
  .sidebar { padding-inline: .8rem; }
  main { padding-inline: 1.3rem; }
}
@media (max-width: 890px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; min-height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .56rem; padding: .63rem .86rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .private { display: none; }
  main { padding: 1.35rem .85rem 2rem; }
}
@media (max-width: 650px) {
  .heading { align-items: flex-start; flex-wrap: wrap; }
  .sidebar nav { gap: .1rem; }
  .sidebar a { font-size: .84rem; padding-inline: .4rem; min-height: 2.2rem; }
  .sidebar a .icon { width: .9rem; height: .9rem; }
  .metrics { gap: .37rem; }
  .metric { padding: .55rem .43rem; display: block; min-height: 0; }
  .metric-icon { width: 1.74rem; height: 1.74rem; margin-bottom: .35rem; }
  .metric-icon .icon { width: 1rem; height: 1rem; }
  .metric-label { font-size: .81rem; }
  .metric-number { font-size: 1.39rem; }
  .check-list, .check-list tbody, .check-list tr, .check-list td { display: block; }
  .check-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .check-list tr { border-bottom: 1px solid var(--line); padding: .67rem .92rem; display: grid; gap: .31rem; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .check-list tr:last-child { border-bottom: 0; }
  .check-list td, .check-list td:first-child, .check-list td:last-child { padding: .08rem 0; border: 0; }
  .check-list td:nth-child(1), .check-list td:nth-child(2) { grid-column: 1 / -1; }
  .check-list td:last-child { grid-column: 2; }
  .filter-field:not(.type-filter) { flex: 1 1 100%; }
}
@media (max-width: 435px) {
  .form-fields, .dialog-heading, .dialog-footer { padding-inline: .72rem; }
  .address-fields { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
  .address-fields label:first-child { grid-column: 1 / -1; }
  .section-heading { padding-inline: .8rem; }
}
.private { display: grid; gap: .25rem; }
.private .button { justify-content: flex-start; color: #d4e2ec; padding-inline: .65rem; }
.private .button:hover { background: #303f50; }
.account-page { min-height: 100vh; }
.account-main { width: min(100%, 57rem); padding-top: 3rem; }
.account-heading { margin-bottom: 1.35rem; }
.account-panel { padding: 1.15rem; }
.account-form { display: grid; gap: .7rem; max-width: 32rem; margin-top: .85rem; }
.account-form:first-child { margin-top: 0; }
.account-form button { justify-self: start; }
.account-form label, .team-controls label { display: grid; gap: .28rem; font-weight: 650; font-size: .9rem; color: #333d4b; }
.account-form :is(input, select), .team-controls select { min-width: 0; width: 100%; background-color: #fff; border: 1px solid #d4dce5; border-radius: .42rem; padding: .45rem .55rem; height: 2.5rem; color: var(--ink); font-weight: 400; }
.account-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1rem; }
.account-actions a { text-decoration: none; }
.team-list { margin-block: .9rem; }
.team-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.team-controls { display: flex; flex-wrap: wrap; gap: .52rem; align-items: end; }
.team-controls .checkbox { display: flex; align-items: center; min-height: 2.5rem; }
.account-form h3 { margin: .32rem 0 .05rem; }
.notice.success { background: #eaf4ee; color: #22634b; }
@media (max-width: 890px) {
  .private { display: flex; flex-wrap: wrap; align-items: center; margin: 0; border: 0; padding: 0; }
}
@media (max-width: 450px) {
  .account-form .form-row { grid-template-columns: 1fr; }
}
