:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #182a35;
  background: #f5f7fa;
  line-height: 1.5;
  --muted: #536675;
  --border: #dde5eb;
  --green: #11654f;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { outline-offset: 3px; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
a { color: var(--green); }
p, .muted { color: var(--muted); }
h1, h2, h3, p { margin: 0 0 10px; }
h1 { font-size: clamp(1.55rem, 3vw, 2.125rem); letter-spacing: -.04em; line-height: 1.16; }
h2 { font-size: 1.08rem; letter-spacing: -.015em; }
h3 { font-size: .95rem; }

.layout { min-height: 100vh; }
.layout.is-admin { display: grid; grid-template-columns: 196px minmax(0, 1fr); }
.layout:not(.is-admin) .sidebar { display: none; }
.sidebar { display: flex; flex-direction: column; gap: 24px; background: #102b38; color: #f2fbfd; padding: 18px 14px; }
.brand, .top-brand { display: flex; align-items: center; gap: 9px; font-weight: 750; }
.brand small { display: block; color: #bad0d8; font-size: .66rem; letter-spacing: .06em; }
.mark { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: #c9f3e3; color: #11654f; font-size: 1.15rem; }
.nav { display: block; width: 100%; text-align: left; margin-bottom: 4px; padding: 7px 9px; background: transparent; border: 0; border-radius: 7px; color: #dbebee; }
.nav:hover, .nav.active { background: #244855; color: white; }
.profile { margin-top: auto; padding-top: 12px; border-top: 1px solid #49636d; overflow-wrap: anywhere; }
.profile small { display: block; color: #bad0d8; }
.profile button { margin-top: 8px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 51px; padding: 8px max(18px, calc((100vw - 1120px) / 2)); background: white; border-bottom: 1px solid var(--border); }
.is-admin .top { padding-inline: 20px; }
.top-brand { color: inherit; text-decoration: none; font-size: .875rem; }
.top-brand small { margin-left: 5px; color: var(--muted); font-size: .75rem; font-weight: 500; }
.top-actions a { color: var(--muted); font-size: .8rem; font-weight: 650; text-decoration: none; }
.top-actions a:hover { text-decoration: underline; }
.role { display: inline-block; margin-bottom: 10px; padding: 3px 9px; border-radius: 6px; background: #e4f4ed; color: #215340; font-size: .8rem; font-weight: 650; }
.top .role { margin: 0; }

.canvas { display: grid; gap: 16px; max-width: 1156px; margin: auto; padding: 21px 18px; }
.hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(15px, 2.6vw, 24px); border-radius: 13px; background: #102f3d; color: white; }
.hero p { max-width: 55ch; margin: 0; color: #d9ebef; }
.hero .kicker { margin-bottom: 6px; color: #a1ead0; }
.kicker { color: var(--green); font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 750; }
.hero .actions { margin-top: 13px; }
.hero-motif { position: absolute; z-index: -1; inset: 0 0 0 auto; display: flex; align-items: end; justify-content: center; gap: 7%; width: 35%; padding: 10px 3% 12px; background: repeating-linear-gradient(0deg, transparent 0 25px, #bddbe320 26px 27px), repeating-linear-gradient(90deg, transparent 0 31px, #bddbe320 32px 33px); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.hero-motif i { width: 11%; height: 26%; border-radius: 5px 5px 0 0; background: linear-gradient(#8fe7c780, #39698530); }
.hero-motif i:nth-child(2) { height: 43%; }
.hero-motif i:nth-child(3) { height: 36%; }
.hero-motif i:nth-child(4) { height: 63%; }
.hero-motif i:nth-child(5) { height: 80%; }
.primary, .secondary, .quiet { min-height: 36px; padding: 5px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: .875rem; font-weight: 650; }
.primary { background: var(--green); border-color: var(--green); color: white; }
.primary:hover { background: #084d39; }
.secondary { background: white; color: #21444c; }
.secondary:hover { background: #edf5f5; }
.quiet { background: transparent; color: inherit; border-color: #67838d; }
.hero .primary { background: #a0e8cd; border-color: #a0e8cd; color: #122f32; }
.hero .primary:hover { background: #baf4de; }
.hero .secondary { background: #183e4d; color: #f0fbff; border-color: #70939f; }
.hero .secondary:hover { background: #245465; }

.panel, .stat { padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: white; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; min-height: 66px; padding: 8px 10px; background: #f5f8fb; }
.stat span { color: var(--muted); font-size: .8rem; font-weight: 650; }
.stat strong { color: #183745; font-size: 1.3rem; line-height: 1.15; }
.stat:nth-child(2) { background: #eef5ff; }
.stat:nth-child(3) { background: #f4efff; }
.stat:nth-child(4) { background: #fff7e8; }
.stat:nth-child(5) { background: #eaf7f0; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.service { display: grid; grid-template-columns: 30px 1fr; column-gap: 9px; align-content: start; }
.service-icon { display: grid; grid-row: span 2; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #e3f4ef; color: var(--green); }
.service h3, .service p { margin: 0; }
.service p { font-size: .85rem; }

.actions, .filters, .sheet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters { margin-bottom: 10px; }
.filters input { flex: 1 1 175px; }
.filters select { width: auto; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 8px; border-top: 1px solid var(--border); font-size: .875rem; }
th { color: var(--muted); white-space: nowrap; }
.ticket-link { padding: 0; border: 0; background: none; color: var(--green); font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; background: #edf1ef; color: #34483e; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.status-0 { background: #e5efff; color: #214a8a; }
.status-1 { background: #eee8ff; color: #533c8b; }
.status-2 { background: #fff0d5; color: #6e4800; }
.status-3 { background: #dff3e7; color: #15573a; }
.empty { padding: 16px; border-radius: 8px; background: #f3f7f4; text-align: center; color: var(--muted); }

.narrow { max-width: 670px; }
.auth { width: min(100%, 420px); margin: 14px auto; }
form { display: grid; gap: 11px; }
label { display: grid; gap: 4px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 37px; padding: 6px 9px; border: 1px solid #b8c9d0; border-radius: 7px; background: white; color: inherit; }
textarea { min-height: 90px; resize: vertical; }
.sheet-row { flex-wrap: nowrap; margin-bottom: 6px; }
.sheet-row input { min-width: 0; }
.help, .meta { color: var(--muted); font-size: .83rem; }
.error { margin: 0; color: #972234; }
.error:empty { display: none; }
.section, .detail-head { margin-top: 12px; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply { padding: 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.reply p { margin: 4px 0; }
.links { padding-left: 20px; }
.receipt label { margin-bottom: 8px; }
.receipt button { margin-right: 6px; }
.receipt input { font-family: Consolas, monospace; }

@media (max-width: 1050px) {
  .is-admin .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .layout.is-admin { grid-template-columns: 148px minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-grid { grid-template-columns: 1fr; }
  .hero-motif { width: 44%; opacity: .38; }
}
@media (max-width: 540px) {
  .layout.is-admin { display: block; }
  .sidebar { padding: 10px 12px; gap: 8px; }
  .sidebar nav, .profile { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .nav { width: auto; margin: 0; }
  .profile { padding-top: 6px; }
  .profile button { margin: 0; }
  .is-admin .top-brand { display: none; }
  .is-admin .top { justify-content: end; min-height: auto; }
  .top-brand small { display: none; }
  .canvas { padding: 14px 12px; gap: 12px; }
  .stats, .is-admin .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
