:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
  line-height: 1.5;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e9f1;
  --surface: #fff;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(24, 39, 75, .07);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #f4f7fb; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f8faff 0, #f4f7fb 260px); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 2px; }

.topbar {
  height: 76px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(226,232,240,.9);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: max-content; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; color: #fff; font-size: 21px; font-weight: 850;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 7px 16px rgba(37,99,235,.25);
}
.brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.brand small { display: block; color: #8490a3; font-size: 10px; margin-top: 1px; }
.main-nav { display: flex; align-self: stretch; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-item {
  border: 0; background: transparent; color: #667085; padding: 0 13px;
  border-bottom: 3px solid transparent; white-space: nowrap; font-size: 13px; font-weight: 650;
}
.nav-item:hover { color: var(--ink); background: #f8fafc; }
.nav-item.active { color: var(--brand); border-bottom-color: var(--brand); background: linear-gradient(180deg, transparent, #eff6ff); }
.identity { text-align: right; font-size: 12px; min-width: max-content; }
.identity strong { display: block; color: #344054; }
.role { color: #98a2b3; }
.icon-button {
  width: 40px; height: 40px; padding: 0; border-radius: 11px; border: 1px solid #dfe5ed;
  background: #fff; color: #475467; font-size: 19px; display: inline-grid; place-items: center;
}
.icon-button:hover { background: #f8fafc; border-color: #cbd5e1; }
.notification-bell { position: relative; margin-left: auto; font-size: 21px; }
.notification-bell > span { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid #fff; border-radius: 99px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 850; }

.shell { max-width: 1320px; margin: 0 auto; padding: 42px 28px 64px; }
.view { animation: view-in .2s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 7px; color: var(--brand); font-size: 10px; font-weight: 850; letter-spacing: .13em; }
h1 { margin: 0 0 6px; font-size: clamp(28px, 3vw, 38px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin: 0 0 5px; font-size: 20px; letter-spacing: -.015em; }
h3 { color: #344054; }
.muted { color: var(--muted); margin: 0; font-size: 13px; }

.primary, .secondary {
  min-height: 42px; border-radius: 10px; padding: 10px 16px; font-weight: 700;
  border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center;
  justify-content: center; gap: 7px; transition: transform .12s, box-shadow .12s, background .12s;
}
.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(37,99,235,.18); }
.primary:hover { background: var(--brand-dark); box-shadow: 0 8px 20px rgba(37,99,235,.24); transform: translateY(-1px); }
.primary:disabled { cursor: not-allowed; background: #98a2b3; box-shadow: none; transform: none; opacity: .72; }
.secondary { background: #fff; color: #344054; border-color: #d8e0ea; }
.secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.wide { width: 100%; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.metrics > div, .panel, .template-card {
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.metrics > div { padding: 19px 20px; position: relative; overflow: hidden; }
.metrics > div::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #bfdbfe; }
.metrics span, .metrics em { display: block; color: #7b8798; font-size: 11px; font-style: normal; }
.metrics strong { display: block; margin: 5px 0 2px; font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.panel { padding: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.search { display: flex; align-items: center; gap: 7px; padding: 0 12px; height: 42px; border: 1px solid #dce3ec; border-radius: 10px; color: #98a2b3; background: #f9fbfd; }
.search:focus-within { border-color: #93b4fa; box-shadow: 0 0 0 3px #dbeafe; background: #fff; }
.search input { width: 255px; border: 0; padding: 0; background: transparent; outline: 0; }

.filters { display: flex; align-items: center; gap: 6px; padding: 0 0 16px; border-bottom: 1px solid #e9edf3; overflow-x: auto; scrollbar-width: none; }
.filter { min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: #667085; padding: 7px 12px; white-space: nowrap; font-weight: 600; font-size: 12px; }
.filter:hover { background: #f2f4f7; color: #344054; }
.filter.active { background: var(--brand-soft); color: var(--brand); }
.filters > select { margin-left: auto; min-width: 170px; }
.tickets-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid #e9edf3; }
.tickets-toolbar .filters { flex: 1; min-width: 0; padding: 0; border: 0; }
.tickets-display-controls { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.tickets-page-size { display: grid; grid-template-columns: auto 72px; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tickets-page-size select { min-height: 38px; padding-block: 7px; }
.tickets-view-toggle { display: flex; }
.tickets-view-toggle .secondary { min-height: 38px; padding: 7px 11px; border-radius: 0; }
.tickets-view-toggle .secondary:first-child { border-radius: 9px 0 0 9px; }
.tickets-view-toggle .secondary:last-child { margin-left: -1px; border-radius: 0 9px 9px 0; }
.tickets-view-toggle .active { position: relative; z-index: 1; color: var(--brand); border-color: #8cb1ef; background: var(--brand-soft); }
.tickets-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding-top: 18px; }
.tickets-cards .ticket { grid-template-columns: minmax(0,1fr); gap: 16px; min-height: 260px; padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: border-color .12s,box-shadow .12s,transform .12s; }
.tickets-cards .ticket:hover { border-color: #bfd0e6; box-shadow: 0 10px 25px rgba(24,39,75,.08); transform: translateY(-1px); }
.tickets-cards .ticket-completed { margin: 0; padding: 19px; }
.tickets-cards .ticket-side { justify-content: flex-end; padding-top: 14px; border-top: 1px solid #edf0f4; }
.tickets-cards .ticket-side small { text-align: left; }
.tickets-rows { margin: 18px -24px 0; }
.ticket-row { display: grid; grid-template-columns: minmax(210px,1.15fr) minmax(220px,1.35fr) 130px minmax(190px,1fr); gap: 16px; align-items: center; min-height: 72px; padding: 11px 24px; border-bottom: 1px solid var(--line); }
.ticket-row:not(.ticket-row-head):hover { background: #f8fbff; }
.ticket-row-main { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 10px; align-items: center; }
.ticket-row-main strong,.ticket-row-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-row-main strong { margin-top: 3px; color: #344054; font-size: 12px; }
.ticket-row-main small { margin-top: 2px; color: #7b8798; font-size: 10px; }
.ticket-row > p { margin: 0; color: #526174; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-row-date { color: #667085; font-size: 11px; }
.ticket-row-controls { display: grid; gap: 7px; }
.ticket-row-controls select { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.ticket-row-controls .status-value { justify-self: stretch; text-align: center; }
.ticket-row-head { min-height: 40px; background: #f7f9fc; color: #667085; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.tickets-panel > .objects-pagination { margin-bottom: -8px; }
.notifications-panel { padding-top: 18px; }
.notifications-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.notifications-toolbar > label:first-child { display: grid; gap: 5px; width: min(280px,100%); color: var(--muted); font-size: 11px; font-weight: 700; }
.unread-filter { display: flex; align-items: center; gap: 8px; color: #475467; font-size: 12px; font-weight: 650; }
.unread-filter input { width: 17px; height: 17px; }
.notifications-list { display: grid; }
.notification-item { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 13px; padding: 16px 8px; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item > i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #f2f4f7; color: #667085; font-style: normal; }
.notification-item.unread { margin-inline: -12px; padding-inline: 20px; background: #f4f8ff; }
.notification-item.unread > i { background: #dbeafe; color: var(--brand); }
.notification-item > div > div { display: flex; align-items: center; gap: 8px; }
.notification-item strong { font-size: 13px; }
.notification-item div span { padding: 2px 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.notification-item p { margin: 3px 0; color: #475467; font-size: 12px; }
.notification-item small { color: #98a2b3; font-size: 10px; }

input, select, textarea {
  width: 100%; min-width: 0; border: 1px solid #d8e0ea; border-radius: 9px;
  padding: 10px 11px; color: #263548; background: #fff; transition: border .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: #b8c4d3; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #73a1f8; box-shadow: 0 0 0 3px #dbeafe; }
textarea { resize: vertical; min-height: 90px; }

.ticket { display: grid; grid-template-columns: minmax(0,1fr) 230px; gap: 28px; padding: 21px 5px; border-bottom: 1px solid #e9edf3; }
.ticket:last-child { border-bottom: 0; }
.ticket-completed { margin-inline: -12px; padding-inline: 17px; border: 1px solid #ccebdc !important; border-radius: 12px; background: #f0faf5; }
.ticket-completed + .ticket { border-top-color: transparent; }
.ticket-completed .ticket-side small { color: #267355; }
.ticket-main { min-width: 0; }
.ticket-title { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ticket-link { border: 0 !important; padding: 0 !important; background: transparent !important; color: var(--brand) !important; font-weight: 800 !important; }
.ticket-link:hover { text-decoration: underline; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 3px #f1f5f9; }
.dot.critical { background: #e5484d; } .dot.high { background: #f59e0b; } .dot.normal { background: #3b82f6; } .dot.low { background: #94a3b8; }
.badge { padding: 3px 8px; border-radius: 99px; background: #f2f4f7; font-size: 10px; font-weight: 750; }
.badge.critical { color: #b42318; background: #fff1f1; } .badge.high { color: #a15c07; background: #fff8e7; } .badge.normal { color: #175cd3; background: #eff6ff; } .badge.low { color: #536981; }
.badge.plan-badge { color: #6941c6; background: #f4f0ff; }
.ticket h3 { margin: 10px 0 5px; font-size: 15px; }
.ticket h3 span, .ticket p { color: #667085; font-weight: 400; }
.ticket p { margin: 0 0 13px; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-meta { display: flex; gap: 18px; flex-wrap: wrap; color: #7b8798; font-size: 11px; }
.ticket-side { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 9px; }
.ticket-side small { color: #a15c07; font-weight: 600; text-align: right; }
.status-value { align-self: flex-end; border-radius: 99px; background: #eef2f6; padding: 6px 10px; font-size: 11px; font-weight: 650; }
.engineer-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.engineer-badges span { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border: 1px solid #bfdbfe; border-radius: 99px; background: #eff6ff; color: #1d4ed8; font-size: 10px; font-weight: 750; }
.engineer-badges em { color: #98a2b3; font-size: 11px; font-style: normal; }
.engineer-edit { min-height: 32px; padding: 5px 9px; font-size: 10px; }
.engineer-assignment-list { display: grid; gap: 7px; max-height: 340px; overflow-y: auto; }
.engineer-assignment-list label { display: grid; grid-template-columns: 20px 34px 1fr; gap: 9px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.engineer-assignment-list label:has(input:checked) { border-color: #93b4fa; background: var(--brand-soft); }
.engineer-assignment-list input { width: 17px; height: 17px; }

.template-grid { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 16px !important; }
.template-card { padding: 22px !important; display: flex; flex-direction: column; min-height: 180px; }
.template-card:hover { border-color: #cad7e7; box-shadow: 0 14px 34px rgba(24,39,75,.10); }
.template-card h2 { font-size: 17px !important; }
.template-card > .secondary { margin-top: auto; align-self: flex-start; }
.template-card ol { padding-left: 21px !important; color: #526174 !important; font-size: 13px !important; }
.template-card li { margin: 8px 0; }
.objects-toolbar { display: grid; grid-template-columns: minmax(280px,1fr) auto auto; gap: 14px; align-items: end; margin-bottom: 16px; padding: 16px 18px; }
.objects-toolbar .search input { width: 100%; }
.objects-page-size { display: grid; grid-template-columns: auto 80px; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.objects-view-toggle { display: flex; }
.objects-view-toggle .secondary { min-height: 42px; border-radius: 0; }
.objects-view-toggle .secondary:first-child { border-radius: 9px 0 0 9px; }
.objects-view-toggle .secondary:last-child { margin-left: -1px; border-radius: 0 9px 9px 0; }
.objects-view-toggle .active,.objects-pagination .active { position: relative; z-index: 1; color: var(--brand); border-color: #8cb1ef; background: var(--brand-soft); }
.objects-rows { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.objects-row { display: grid; grid-template-columns: minmax(210px,1.25fr) minmax(190px,1.15fr) minmax(150px,1fr) minmax(150px,.8fr) auto; gap: 16px; align-items: center; min-height: 70px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.objects-row:last-child { border-bottom: 0; }
.objects-row:hover:not(.objects-row-head) { background: #f8fbff; }
.objects-row > div strong,.objects-row > div small { display: block; }
.objects-row > div small { margin-bottom: 3px; color: var(--brand); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.objects-row > span { color: #526174; font-size: 11px; }
.objects-row .object-open { min-height: 34px; padding: 6px 11px; }
.objects-row-head { min-height: 42px; background: #f7f9fc; color: #667085; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.objects-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.objects-pagination > div { display: flex; align-items: center; gap: 5px; }
.objects-pagination button { min-width: 38px; min-height: 36px; padding: 6px 9px; }
.objects-pagination button:disabled { cursor: default; opacity: .45; }

.visit-list { display: grid; gap: 12px; }
.visit { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px 20px; align-items: center; padding: 19px 22px; }
.visit-actions { grid-column: 1/-1; display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.visit-actions button { border: 1px solid #d8e0ea; background: #fff; border-radius: 8px; padding: 8px 12px; font-weight: 650; color: #475467; }
.visit-actions button:last-child { color: #fff; background: var(--success); border-color: var(--success); }
.calendar-toolbar { display: grid; grid-template-columns: auto minmax(180px,1fr) minmax(180px,1fr) auto; gap: 14px; align-items: end; margin-bottom: 16px; padding: 16px 18px; }
.calendar-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.calendar-period { display: grid; grid-template-columns: 42px 150px 42px; gap: 6px; }
.calendar-period .secondary { min-height: 42px; padding: 8px; }
.calendar-legend { display: flex; gap: 13px; padding-bottom: 10px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.calendar-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.calendar-legend .fact-dot { background: var(--success); }
.calendar-board { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.calendar-grid { min-width: 0; }
.calendar-weekdays,.calendar-month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekday { padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafc; color: #526174; text-align: center; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.calendar-weekday.weekend { color: #b54708; background: #fff8eb; }
.calendar-day { position: relative; display: flex; min-width: 0; min-height: 125px; padding: 12px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); text-align: left; flex-direction: column; align-items: flex-start; transition: background .12s, box-shadow .12s; }
.calendar-day.weekend { background: #fbfcfe; }
.calendar-day:not(.calendar-day-empty):hover { z-index: 1; background: #f3f7ff; box-shadow: inset 0 0 0 2px #93b4fa; }
.calendar-day.has-visits { background: #f8fbff; }
.calendar-day-empty { background: #f5f7fa; cursor: default; }
.calendar-day-number { display: grid; place-items: center; width: 29px; height: 29px; margin-bottom: 14px; border-radius: 50%; font-size: 14px; font-weight: 850; }
.calendar-day.has-visits .calendar-day-number { color: #fff; background: var(--brand); }
.calendar-day-count { font-size: 13px; font-weight: 750; }
.calendar-day:not(.has-visits) .calendar-day-count { color: #98a2b3; font-weight: 500; }
.calendar-day-summary { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: #667085; font-size: 10px; }
.calendar-day-summary i { width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--brand); }
.calendar-day-summary i:first-child { margin-left: 0; }
.calendar-day-summary .fact-dot { background: var(--success); }
.calendar-day-dialog { width: min(860px,calc(100% - 28px)); padding: 24px; }
.calendar-day-cards { display: grid; gap: 12px; max-height: 65vh; overflow-y: auto; padding: 2px; }
.calendar-detail-card { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 11px; background: #fbfdff; }
.calendar-detail-card.has-fact { border-left-color: var(--success); background: #f5fcf8; }
.calendar-detail-card p { margin: 4px 0; color: #667085; font-size: 11px; }
.calendar-detail-card span { color: #526174; font-size: 11px; }
.calendar-detail-card dl { display: flex; gap: 18px; margin: 0; }
.calendar-detail-card dl div { min-width: 60px; }
.calendar-detail-card dt { color: #98a2b3; font-size: 9px; text-transform: uppercase; }
.calendar-detail-card dd { margin: 2px 0 0; font-size: 11px; font-weight: 750; }
.checklist-group { display: grid; gap: 8px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.checklist-group header { display: flex; justify-content: space-between; gap: 10px; }
.checklist-group header span { color: var(--muted); font-size: 10px; }
.reference-template { border-color: #93c5fd !important; box-shadow: 0 12px 32px rgba(37,99,235,.12) !important; }
.reference-option { display: flex !important; align-items: center; justify-content: start; gap: 9px; }
.reference-option input { width: auto; }
.entity-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.entity-actions .secondary { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.entity-actions .danger { color: #b42318; border-color: #f5c6c6; }
.entity-actions .danger:hover { background: #fff1f1; }
.comments-list { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.comments-list article, .act-card { margin: 9px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.comments-list article p, .act-card p { margin: 0 0 5px; }
.comments-list small, .act-card small { color: var(--muted); }
.engineer-avatar { width: 52px; height: 52px; flex: 0 0 auto; border-radius: 50%; object-fit: cover; border: 2px solid #dbe7f7; background: #eef4fb; }
.engineer-avatar.small { width: 38px; height: 38px; }
.engineer-avatar-fallback { display: grid; place-items: center; color: #315b91; font-size: 25px; }
.engineer-avatar-fallback.small { font-size: 19px; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.user-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.object-engineer-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 18px 0 28px; }
.engineer-profile-card { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfd; }
.engineer-profile-card strong,.engineer-profile-card a { display: block; }
.engineer-profile-card a { margin-top: 3px; color: #526174; font-size: 11px; text-decoration: none; }
#object-engineers-form { display: grid; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.engineer-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.engineer-picker label { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.engineer-picker label:has(input:checked) { border-color: #7aa7ef; background: var(--brand-soft); }
.engineer-picker small { display: block; color: var(--muted); font-size: 10px; }
.engineer-picker input { width: auto; }
#object-engineers-form .primary { justify-self: start; }
.acts-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.act-card { display: grid; gap: 6px; }
.act-card .print-act { justify-self: start; min-height: 34px; padding: 6px 10px; }
.users-title-row { display: flex; align-items: center; gap: 10px; }
.users-title-row h1 { margin-bottom: 6px; }
.help-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; margin: 0 0 6px; padding: 0; border: 1px solid #bfd1ed; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 15px; font-weight: 800; }
.help-button:hover { background: #dbeafe; border-color: #8eb1eb; }
.app-popup { width: min(560px,calc(100% - 28px)); }
.app-popup form { padding: 26px; }
.popup-text { margin: 0 0 18px; color: #475467; line-height: 1.6; }
.popup-fields { display: grid; gap: 15px; }
.popup-fields label { display: grid; gap: 6px; color: #475467; font-size: 12px; font-weight: 700; }
.danger-primary { background: #d92d20; box-shadow: 0 6px 14px rgba(217,45,32,.18); }
.danger-primary:hover { background: #b42318; }
.roles-help { display: grid; gap: 10px; }
.roles-help article { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 12px; padding: 13px; border: 1px solid #e4e9f1; border-radius: 11px; background: #f9fbfd; }
.roles-help article > i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 18px; font-style: normal; }
.roles-help strong { display: block; margin-bottom: 3px; color: #344054; }
.roles-help p { margin: 0; color: #667085; font-size: 12px; line-height: 1.5; }
.directory-tabs { display: flex; gap: 4px; margin-bottom: 14px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.directory-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 0; border-radius: 8px; background: transparent; color: #667085; font-size: 12px; font-weight: 700; }
.directory-tabs button.active { color: var(--brand); background: var(--brand-soft); }
.directory-tabs span { min-width: 22px; padding: 2px 6px; border-radius: 99px; background: #eef2f6; color: #526174; font-size: 9px; }
.directory-card { min-width: 0; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.directory-card-head { display: grid; grid-template-columns: minmax(180px,.45fr) minmax(320px,1fr); gap: 22px; align-items: end; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.directory-add { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin: 0; }
.directory-items { display: grid; }
.directory-items > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; min-height: 52px; padding: 8px 4px 8px 12px; border-bottom: 1px solid #e8edf3; }
.directory-items > div:last-child { border-bottom: 0; }
.directory-items .entity-actions { margin: 0; padding: 0; }
select[multiple] { min-height: 118px; padding: 6px; }
select[multiple] option { padding: 8px; border-radius: 6px; }
select[multiple] option:checked { background: var(--brand-soft) linear-gradient(0deg,var(--brand-soft),var(--brand-soft)); color: var(--brand); }
.choice-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 5px; padding: 0; color: #475467; font-size: 12px; font-weight: 700; }
.choice-field > .muted { margin-bottom: 9px; font-size: 11px; }
.choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.choice-option { min-width: 0; min-height: 46px; display: grid !important; grid-template-columns: 20px minmax(0,1fr) 22px; align-items: center; gap: 9px !important; padding: 10px 11px; border: 1px solid #d8e0ea; border-radius: 10px; background: #fff; cursor: pointer; font-size: 13px !important; font-weight: 600 !important; transition: border .12s, background .12s, box-shadow .12s; }
.choice-option:hover { border-color: #a9b9ce; background: #f9fbfd; }
.choice-option:has(input:checked) { border-color: #73a1f8; background: var(--brand-soft); box-shadow: inset 0 0 0 1px #bfdbfe; color: #175cd3; }
.choice-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); box-shadow: none; }
.choice-option span { min-width: 0; overflow-wrap: anywhere; }
.choice-option i { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #fff; color: transparent; font-size: 12px; font-style: normal; }
.choice-option:has(input:checked) i { background: var(--brand); color: #fff; }

.loading, .empty { padding: 48px 20px; color: #7b8798; text-align: center; }
.toast { position: fixed; inset: auto 24px 24px auto; margin: 0; width: max-content; max-width: min(420px,calc(100% - 32px)); z-index: 9999; border: 1px solid #344054; border-radius: 12px; padding: 14px 18px; background: #182230; color: #fff; box-shadow: 0 20px 50px rgba(15,23,42,.38); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s; line-height: 1.45; }
.toast::backdrop { background: transparent; }
.toast.show { opacity: 1; transform: none; }

.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 0,#dbeafe 0,transparent 35%), linear-gradient(145deg,#f8faff,#eef3f9); }
.login-form { width: min(420px,100%); padding: 34px; display: grid; gap: 19px; background: rgba(255,255,255,.96); border: 1px solid #e0e7ef; border-radius: 20px; box-shadow: 0 24px 70px rgba(24,39,75,.14); }
.login-brand { padding-bottom: 20px; border-bottom: 1px solid #eaedf2; }
.login-form h1 { font-size: 27px; }
.login-form label, .form-grid label { display: grid; gap: 6px; color: #475467; font-size: 12px; font-weight: 700; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; }

.table-wrap { overflow: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 13px; border-bottom: 1px solid #eaedf2; text-align: left; white-space: nowrap; }
th { color: #667085; background: #f8fafc; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:hover { background: #f9fbfd; }
.state { display: inline-flex; padding: 5px 9px; border-radius: 99px; background: #f2f4f7; color: #667085; font-size: 11px; font-weight: 700; }
.state.active { color: #027a48; background: #ecfdf3; }

dialog { width: min(700px,calc(100% - 28px)); max-height: calc(100dvh - 36px); overflow: auto; border: 1px solid #dce3ec; border-radius: 18px; padding: 0; box-shadow: 0 28px 80px rgba(15,23,42,.28); }
dialog::backdrop { background: rgba(15,23,42,.58); backdrop-filter: blur(3px); }
dialog form, .card-dialog > div { padding: 28px !important; }
.card-dialog { width: min(1040px,calc(100% - 28px)) !important; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.ticket-dialog-actions { display: flex; align-items: center; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.span-2 { grid-column: span 2; }
.dialog-actions { position: sticky; bottom: -28px; display: flex; justify-content: flex-end; gap: 9px; margin: 22px -28px -28px; padding: 16px 28px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.card-layout { display: grid !important; grid-template-columns: minmax(0,1.45fr) minmax(280px,.75fr) !important; gap: 36px !important; }
.card-layout aside { padding-left: 26px; border-left: 1px solid var(--line); }
.card-description { white-space: pre-wrap; }
.details { display: grid; grid-template-columns: 1fr 1fr; margin: 20px 0; }
.details dt { color: #7a8796; font-size: 10px; text-transform: uppercase; }
.details dd { margin: 3px 0 0; font-size: 13px; }
.card-control { display: grid; gap: 6px; margin: 18px 0; }
.card-section-head { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.check-items { display: grid; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; border: 1px solid #e0e6ed; font-size: 13px; }
.check-item.done span { color: #83909e; text-decoration: line-through; }
.check-item input { min-width: auto; }
.timeline { margin-left: 7px; padding-left: 20px; border-left: 2px solid #dbe4ee; }
.timeline > div { position: relative; padding-bottom: 22px; }
.timeline i { position: absolute; top: 3px; left: -26px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline strong,.timeline time,.timeline small { display: block; }
.timeline time,.timeline small { color: #8290a0; font-size: 11px; }
.timeline p { margin: 4px 0; font-size: 12px; }
.ticket-tabs { display: flex; gap: 6px; margin: -4px 0 24px; padding-bottom: 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ticket-tabs::-webkit-scrollbar { display: none; }
.ticket-tabs button { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 9px; background: transparent; color: #667085; font-size: 13px; font-weight: 700; white-space: nowrap; }
.ticket-tabs button:hover { background: #f2f4f7; color: #344054; }
.ticket-tabs button.active { background: var(--brand-soft); color: var(--brand); }
.ticket-tabs i { width: 20px; height: 20px; display: grid; place-items: center; font-style: normal; font-size: 17px; }
.ticket-tab-panels { min-height: 430px; }
.ticket-tab-panel { display: none; max-width: 820px; animation: view-in .18s ease-out; }
.ticket-tab-panel.active { display: block; }
.ticket-tab-panel > h3:first-child { margin-top: 0; }
.ticket-tab-panel .card-control { max-width: 560px; padding: 16px; border: 1px solid #dbe5f1; border-radius: 12px; background: #f8fafc; }
.ticket-tab-panel .check-items { margin-bottom: 20px; }
.ticket-tab-panel .timeline { max-width: 600px; }
.ticket-tab-panel.acts-section { margin-top: 0; padding-top: 0; border-top: 0; }
.flow-content > * { margin-top: 0; }
.flow-content > * + * { margin-top: 16px; }
.flow-content > h3 { margin-bottom: 7px; color: #344054; }
.flow-content > h3:not(:first-child) { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.flow-content > h3 + p { margin-top: 0; }
.flow-content > p { color: #536174; line-height: 1.65; }
.flow-content > aside, .flow-content > form { margin-top: 18px; }
.view .page-head + * { margin-top: 0; }
.template-card p + p, .act-card p + small { margin-top: 8px; }
.dialog-head h2 + .muted { margin-top: 6px; }
.form-grid label > input, .form-grid label > select, .form-grid label > textarea { margin-top: 2px; }
.card-description { padding: 14px; border-radius: 11px; background: #f8fafc; color: #475467 !important; }
.details { gap: 10px !important; }
.details div { background: #f8fafc !important; border: 1px solid #edf1f5; border-radius: 10px !important; padding: 12px !important; }
.details dt { font-weight: 750; letter-spacing: .06em; }
.check-item { min-height: 48px; border-radius: 10px !important; padding: 9px 11px !important; }
.check-item input { width: 18px; height: 18px; }
.check-item span { flex: 1; }
.fault-button { min-height: 32px; padding: 5px 9px; color: #b42318; }
.timeline { border-left-color: #d9e5f7 !important; }
.timeline i { box-shadow: 0 0 0 4px #eff6ff; }
.sla-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.sla-form h3 { grid-column: 1/-1; margin: 0; }
#comment-form { display: grid; gap: 9px; }
#comment-form .primary { justify-self: start; }

.filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  border: 1px solid var(--line);
  background: #fff;
  color: #475467;
  transition: all .15s ease;
}
.filter:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ink);
}
.filter.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: #93c5fd;
  box-shadow: 0 1px 3px rgba(37,99,235,.12);
}
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 99px;
  background: #f2f4f7;
  color: #475467;
}
.filter.active .filter-count {
  background: var(--brand);
  color: #fff;
}

.time-badge {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
  font-weight: 700 !important;
}

.defect-info {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.defect-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.defect-reason {
  margin: 0;
  color: #9b2c2c;
  font-size: 13px;
  font-weight: 550;
}
.defect-thumb-container {
  display: inline-block;
  width: max-content;
}
.defect-thumbnail {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #feb2b2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform .15s ease;
  display: block;
}
.defect-thumbnail:hover {
  transform: scale(1.05);
}

.ticket-systems-field {
  margin-top: 4px;
}
.ticket-systems-field .choice-grid {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fafbfc;
}

.regulations-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.regulation-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(24,39,75,0.04);
}
.regulation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.regulation-header h4 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--ink);
}
.regulation-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-item-row {
  padding: 10px 12px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #fbfcfe;
  transition: background .15s ease;
}
.check-item-row.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.check-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.check-item-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}
.check-item-text {
  font-size: 13px;
  color: var(--ink);
}
.check-item-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.check-item-meta {
  margin-top: 6px;
  padding-left: 28px;
}

.files-category-section {
  margin-top: 22px;
}
.category-header {
  margin-bottom: 12px;
}
.category-header h4 {
  margin: 0 0 2px;
  font-size: 15px;
  color: var(--ink);
}
.object-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.object-file-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(24,39,75,0.03);
  transition: box-shadow .15s ease, transform .15s ease;
}
.object-file-card:hover {
  box-shadow: 0 6px 16px rgba(24,39,75,0.08);
  transform: translateY(-2px);
}
.object-file-preview {
  height: 120px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.object-file-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.object-file-icon {
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  color: #64748b;
}
.object-file-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.object-file-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.object-file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}
.object-file-note {
  margin: 0;
  font-size: 11px;
  color: #475467;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.object-file-actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  gap: 8px;
}
.button-sm {
  min-height: 32px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
}
.empty-files {
  grid-column: 1 / -1;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  text-align: center;
}

.object-requests-list, .object-works-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.object-request-item, .work-log-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.object-request-head, .work-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.object-comment-form {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.object-comment-form textarea {
  width: 100%;
}

body[data-active-view="analytics"] .shell,
.shell:has(#analytics-view:not([hidden])) {
  max-width: 100%;
  width: 100%;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}
#analytics-view {
  width: 100%;
}
#analytics-view .panel {
  width: 100%;
}

.analytics-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.analytics-toolbar input[type="search"] {
  flex: 1 1 260px;
  min-width: 200px;
  min-height: 42px;
  padding: 8px 14px 8px 36px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2398a2b3" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat 12px center;
  background-size: 15px 15px;
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.analytics-toolbar input[type="search"]:focus {
  border-color: #73a1f8;
  box-shadow: 0 0 0 3px #dbeafe;
}
.analytics-toolbar select {
  min-height: 42px;
  width: auto;
  padding: 8px 12px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.analytics-toolbar input[type="month"] {
  min-height: 42px;
  width: auto;
  padding: 8px 12px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}
.analytics-toolbar a.secondary {
  white-space: nowrap;
}
.analytics-panel .table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
  max-width: 100%;
}
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.analytics-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 2;
  font-weight: 750;
  padding: 12px 14px;
}
.analytics-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.analytics-table th.sortable:hover {
  background-color: #edf2f7;
  color: var(--brand);
}
.analytics-table th .sort-indicator {
  display: inline-block;
  margin-left: 5px;
  font-size: 11px;
  color: #98a2b3;
  transition: color .15s ease;
}
.analytics-table th.sortable:hover .sort-indicator,
.analytics-table th.is-sorted .sort-indicator {
  color: var(--brand);
  font-weight: 800;
}
.analytics-table td {
  padding: 12px 14px;
  vertical-align: middle;
}
.analytics-table tr:hover {
  background: #f8fbff;
}
.analytics-table tr.is-weekend {
  background: #fdfbf7;
}
.analytics-table tr.is-weekend:hover {
  background: #fbf7ef;
}
.analytics-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.analytics-pagination > div {
  display: flex;
  align-items: center;
  gap: 6px;
}
.analytics-pagination button {
  min-width: 38px;
  min-height: 36px;
  padding: 6px 10px;
}
.analytics-pagination button:disabled {
  cursor: default;
  opacity: .45;
}
.analytics-pagination .active {
  position: relative;
  z-index: 1;
  color: var(--brand);
  border-color: #8cb1ef;
  background: var(--brand-soft);
}
.day-type {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.day-work {
  background: #f0fdf4;
  color: #166534;
}
.day-weekend {
  background: #fff1f2;
  color: #9f1239;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-serviced {
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid #a6f4c5;
}
.status-planned {
  background: #eff8ff;
  color: #175cd3;
  border: 1px solid #b2ddff;
}
.status-overdue {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}
.status-unplanned {
  background: #fff9f5;
  color: #c4320a;
  border: 1px solid #fedf89;
}
.status-not-required {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.diff-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
}
.diff-pos {
  background: #ecfdf3;
  color: #027a48;
}
.diff-neg {
  background: #fef3f2;
  color: #b42318;
}
.diff-zero {
  background: #f2f4f7;
  color: #667085;
}
.load-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
}
.load-success {
  background: #ecfdf3;
  color: #027a48;
}
.load-warning {
  background: #fef0c7;
  color: #b54708;
}
.load-danger {
  background: #fee4e2;
  color: #d92d20;
}
.load-muted {
  background: #f2f4f7;
  color: #667085;
}
.badge-yes {
  background: #eff8ff;
  color: #175cd3;
}
.badge-no {
  background: #f2f4f7;
  color: #667085;
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}
.link-btn:hover {
  color: var(--brand-dark);
}

@media (max-width: 1060px) {
  .topbar { padding: 0 18px; gap: 14px; }
  .brand small { display: none; }
  .nav-item { padding-inline: 10px; }
  .template-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .objects-row { grid-template-columns: minmax(190px,1.2fr) minmax(180px,1fr) minmax(150px,1fr) auto; }
  .objects-row > span:nth-of-type(3),.objects-row-head > span:nth-of-type(4) { display: none; }
  .tickets-toolbar { align-items: stretch; flex-direction: column; }
  .tickets-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tickets-display-controls { justify-content: space-between; }
  .ticket-row { grid-template-columns: minmax(190px,1fr) minmax(180px,1fr) minmax(190px,1fr); }
  .ticket-row-date,.ticket-row-head > span:nth-child(3) { display: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: 72px; }
  .topbar { height: 64px; padding: 0 14px; position: sticky; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .brand small, .identity .role { display: none; }
  .identity { margin-left: auto; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .notification-bell { margin-left: 0; flex: 0 0 40px; }
  .main-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: 66px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid #dfe5ed; box-shadow: 0 -8px 24px rgba(24,39,75,.08); justify-content: flex-start; }
  .nav-item { flex: 1 0 78px; height: 52px; padding: 5px 8px; border: 0; border-radius: 10px; font-size: 10px; }
  .nav-item.active { border: 0; background: var(--brand-soft); }
  .shell { padding: 27px 14px 36px; }
  .page-head { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .page-head .primary, .page-head .secondary { width: 100%; }
  h1 { font-size: 29px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .metrics > div { padding: 15px; }
  .metrics strong { font-size: 25px; }
  .panel { padding: 15px; border-radius: 12px; }
  .panel-head { align-items: stretch; flex-direction: column; gap: 14px; }
  .search, .search input { width: 100%; }
  .filters { margin-inline: -15px; padding: 0 15px 14px; }
  .filters > select { margin-left: 4px; min-width: 155px; }
  .tickets-toolbar .filters { margin-inline: -15px; padding: 0 15px 14px; }
  .tickets-display-controls { align-items: stretch; flex-direction: column; }
  .notifications-toolbar { align-items: stretch; flex-direction: column; }
  .tickets-page-size { grid-template-columns: 1fr 90px; }
  .tickets-view-toggle .secondary { flex: 1; }
  .tickets-cards { grid-template-columns: 1fr; gap: 10px; }
  .tickets-cards .ticket { min-height: 0; }
  .tickets-rows { margin-inline: -15px; overflow-x: auto; }
  .ticket-row { min-width: 680px; padding-inline: 15px; }
  .ticket { grid-template-columns: 1fr; gap: 14px; padding: 18px 2px; }
  .ticket-completed { margin-inline: -5px; padding-inline: 10px; }
  .ticket-side { padding-top: 12px; border-top: 1px dashed #e1e7ef; }
  .ticket-side small { text-align: left; }
  .ticket-meta { display: grid; gap: 5px; }
  .template-grid { grid-template-columns: 1fr !important; }
  .template-card { min-height: 0; }
  .objects-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .directory-tabs { overflow-x: auto; }
  .directory-tabs button { flex: 1 0 auto; }
  .directory-card-head { grid-template-columns: 1fr; }
  .directory-items > div { grid-template-columns: minmax(0,1fr) auto; }
  .objects-page-size { grid-template-columns: 1fr 90px; }
  .objects-view-toggle .secondary { flex: 1; }
  .objects-rows { overflow-x: auto; }
  .objects-row { min-width: 690px; }
  .objects-pagination, .analytics-pagination { align-items: flex-start; flex-direction: column; }
  .visit { grid-template-columns: 1fr; }
  .visit-actions { display: grid; grid-template-columns: repeat(2,1fr); }
  .calendar-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .calendar-period { grid-template-columns: 42px minmax(0,1fr) 42px; }
  .calendar-legend { padding: 2px 0; }
  .calendar-board { overflow-x: auto; }
  .calendar-grid { min-width: 650px; }
  .calendar-day { min-height: 96px; padding: 8px; }
  .calendar-day-number { margin-bottom: 8px; }
  .calendar-day-count { font-size: 11px; }
  .calendar-detail-card { grid-template-columns: 1fr; gap: 11px; }
  .calendar-detail-card dl { justify-content: space-between; }
  .calendar-detail-card .transfer-visit { width: 100%; }
  .object-engineer-cards,.engineer-picker { grid-template-columns: 1fr; }
  dialog { width: 100%; max-width: none; max-height: 94dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; }
  dialog form, .card-dialog > div { padding: 21px 16px calc(20px + env(safe-area-inset-bottom)) !important; }
  .card-dialog { width: 100% !important; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .choice-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .dialog-actions { bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 20px -16px calc(-20px - env(safe-area-inset-bottom)); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .dialog-actions > * { flex: 1; }
  .card-layout { grid-template-columns: 1fr !important; gap: 25px !important; }
  .card-layout aside { padding: 22px 0 0; border: 0; border-top: 1px solid var(--line); }
  .details { grid-template-columns: 1fr !important; }
  .check-item { align-items: flex-start; flex-wrap: wrap; }
  .fault-button { margin-left: 28px; }
  .toast { inset: auto 16px 82px 16px; width: auto; }
  .help-button { margin-left: 0; }
  .ticket-tabs { margin-inline: -16px; padding-inline: 16px; }
  .ticket-tabs button { flex: 1 0 auto; padding-inline: 12px; }
  .ticket-tab-panels { min-height: 58dvh; }
  .table-wrap { margin-inline: -15px; }
  th, td { padding: 12px; }
  input, select, textarea { font-size: 16px !important; }
  .shell, .card-layout, .dialog-body, dialog, .main-nav, .tickets-rows, .objects-rows, .calendar-board, .table-wrap, .ticket-tabs, .directory-tabs, .regulations-container, .object-files-grid, .ticket-systems-field .choice-grid {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 390px) {
  .metrics { grid-template-columns: 1fr; }
  .identity { display: none; }
  .topbar { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
