:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  background: #eef2f5;
  color: #16293b;
  --navy: #142637;
  --muted: #536678;
  --line: #dbe3eb;
  --orange: #ffb868;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid #2b6cb0;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.site-header { background: var(--navy); color: white; }
.header-inner { display: flex; min-height: 68px; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 8px; background: var(--orange); color: var(--navy); font-size: .78rem; }
.demo-tag { font-size: .8rem; border: 1px solid #657a8c; padding: .35rem .65rem; border-radius: 999px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 2rem; padding: 3rem 0 2rem; }
.hero h1 { margin: .25rem 0 .65rem; font-size: clamp(2rem, 4.7vw, 3.5rem); line-height: 1.07; letter-spacing: -.055em; }
.hero p { margin: 0; color: var(--muted); }
.hero .section-label { color: #764604; text-transform: uppercase; letter-spacing: .13em; font-size: .8rem; font-weight: 760; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .55rem .95rem; border: 1px solid transparent; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.primary { background: var(--orange); color: #2d1b09; }
.primary:hover { background: #f4a954; }
.primary span { font-size: 1.2em; line-height: 1; }
.subtle { background: white; border-color: #cbd7e2; color: #244763; }
.subtle:hover { background: #edf4f9; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.metric { display: grid; gap: .4rem; padding: 1.1rem 1.25rem; border-radius: 12px; background: white; border: 1px solid var(--line); }
.metric span { color: var(--muted); font-size: .9rem; font-weight: 650; }
.metric strong { font-size: 2rem; line-height: 1.1; }
.records { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.records-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: 1.15rem 1.25rem .4rem; }
h2 { margin: 0; font-size: 1.3rem; }
.records-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: .8rem; padding: .8rem 1.25rem 1.2rem; }
label { display: block; font-size: .9rem; font-weight: 650; }
input, select, textarea { display: block; margin-top: .35rem; width: 100%; min-height: 42px; padding: .5rem .65rem; border: 1px solid #b8c8d5; border-radius: 8px; color: #16293b; background: white; }
select { appearance: none; padding-right: 1.7rem; background-image: linear-gradient(45deg, transparent 50%, #536678 50%), linear-gradient(135deg, #536678 50%, transparent 50%); background-position: calc(100% - 15px) center, calc(100% - 10px) center; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f3f6f9; color: #3e5467; font-size: .84rem; font-weight: 700; }
td, th { padding: .88rem .75rem; border-top: 1px solid var(--line); }
td:first-child, th:first-child { padding-left: 1.25rem; }
td:last-child, th:last-child { padding-right: 1.25rem; }
td { font-size: .94rem; vertical-align: top; }
td time, td button { white-space: nowrap; }
td small { display: block; color: var(--muted); margin-top: .25rem; font-size: .83rem; }
.description { min-width: 12rem; overflow-wrap: anywhere; }
.description p { margin: 0; white-space: pre-wrap; }
.description .follow-up { margin-top: .3rem; color: var(--muted); font-size: .84rem; }
.status { display: inline-block; padding: .3rem .55rem; border-radius: 7px; background: #ffefcf; color: #694606; font-size: .82rem; font-weight: 680; white-space: nowrap; }
.status.resolved { background: #dcefe8; color: #1e5b46; }
.row-action { min-height: 34px; padding: .3rem .65rem; font-size: .85rem; }
.empty { padding: 1rem 1.25rem 1.5rem; margin: 0; color: var(--muted); }
.storage-note { margin: 1rem 0 2rem; color: var(--muted); font-size: .875rem; }
.feedback { position: fixed; bottom: 1rem; right: 1rem; max-width: calc(100% - 2rem); margin: 0; padding: .85rem 1rem; border-radius: 8px; color: white; background: var(--navy); }
dialog { width: min(580px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 0; border: 1px solid var(--line); border-radius: 14px; color: inherit; }
dialog::backdrop { background: rgb(20 38 55 / 60%); }
form { padding: 1.25rem; }
.dialog-heading, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin: 1rem 0; }
.form-grid .full { grid-column: 1 / -1; }
.optional { font-weight: 400; color: var(--muted); }
.form-actions { justify-content: end; }
#form-error { color: #a12429; }
@media (max-width: 740px) {
  .shell { width: calc(100% - 28px); }
  .hero { align-items: start; flex-direction: column; gap: 1rem; padding: 2rem 0 1.4rem; }
  .metrics { gap: .55rem; }
  .metric { padding: .7rem; }
  .metric span { font-size: .8rem; }
  .metric strong { font-size: 1.65rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  .filters button { justify-self: start; }
  th, td { white-space: normal; }
}
@media (max-width: 380px) {
  .header-inner { align-items: start; flex-direction: column; padding-block: .65rem; gap: .45rem; }
  .form-grid { grid-template-columns: 1fr; }
}
