:root {
  --ink: #17383c;
  --ink-2: #36565a;
  --muted: #718682;
  --line: #dce6e2;
  --canvas: #f2f6f4;
  --surface: #fbfdfc;
  --surface-2: #eaf1ee;
  --nav: #102f34;
  --nav-2: #173c41;
  --accent: #b9da4a;
  --accent-dark: #233a11;
  --danger: #b54646;
  --blue: #5878d7;
  --amber: #c98418;
  --green: #4f8158;
  --shadow: 0 14px 38px rgba(25, 59, 58, .08);
  --radius: 16px;
  --control-radius: 10px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
i { line-height: 1; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 3vw, 42px); line-height: 1.1; letter-spacing: -.045em; }
:focus-visible { outline: 3px solid rgba(79, 129, 88, .32); outline-offset: 3px; }
h2 { margin-bottom: 4px; font-size: 18px; letter-spacing: -.02em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

.page-loader { position: fixed; z-index: 50; top: 0; left: 0; width: 100%; height: 3px; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.page-loader span { display: block; width: 35%; height: 100%; background: var(--accent); transform: translateX(-120%); }
.is-loading .page-loader { opacity: 1; }
.is-loading .page-loader span { animation: load-bar .9s ease-in-out infinite; }
@keyframes load-bar { to { transform: translateX(410%); } }

.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; height: 100dvh; padding: 28px 18px 20px; color: #dce9e6; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; color: #f5faf8; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; color: var(--nav); background: var(--accent); border-radius: 12px; font-size: 24px; }
.brand b, .brand small { display: block; line-height: 1; }
.brand b { font-size: 22px; letter-spacing: -.04em; }
.brand small { margin-top: 5px; color: #94aaa6; font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.nav { display: grid; gap: 5px; margin-top: 52px; }
.nav a { position: relative; display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 14px; color: #aabeba; border-radius: 11px; font-weight: 600; transition: color .16s ease, background .16s ease, transform .16s ease; }
.nav a i { font-size: 21px; }
.nav a:hover { color: #f3faf7; background: rgba(255,255,255,.055); }
.nav a:active { transform: scale(.985); }
.nav a.active { color: #f5faf8; background: var(--nav-2); }
.nav a.active::before { position: absolute; left: -18px; width: 4px; height: 24px; content: ""; background: var(--accent); border-radius: 0 4px 4px 0; }
.sidebar-note { display: flex; gap: 10px; margin: auto 8px 22px; padding: 14px; color: #9fb3af; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; }
.sidebar-note i { margin-top: 2px; color: var(--accent); font-size: 18px; }
.sidebar-note p { margin: 0; font-size: 12px; line-height: 1.55; }
.sidebar-note b { color: #dce9e6; font-size: 13px; }
.user-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.user-meta { min-width: 0; }
.user-meta b, .user-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta b { color: #edf5f3; font-size: 14px; }
.user-meta small { color: #91a8a3; font-size: 12px; }
.avatar { display: grid; flex: none; width: 37px; height: 37px; place-items: center; color: var(--nav); background: var(--accent); border-radius: 11px; font-size: 12px; font-weight: 800; }
.avatar.soft { color: #315d5b; background: #dcebe7; }
.avatar.large { width: 52px; height: 52px; border-radius: 14px; font-size: 15px; }
.avatar.tiny { width: 30px; height: 30px; border-radius: 8px; font-size: 10px; }
.icon-button { display: inline-grid; width: 38px; height: 38px; padding: 0; place-items: center; color: inherit; background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-size: 19px; }
.icon-button:hover { background: rgba(127,151,146,.12); }
.sidebar .icon-button { color: #94aaa6; }

.workspace { display: flex; min-width: 0; flex-direction: column; }
.topbar { display: none; height: 66px; align-items: center; gap: 12px; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-brand { font-weight: 800; }
.topbar-context { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 13px; }
.content { width: 100%; max-width: 1560px; margin: 0 auto; padding: 44px 48px 64px; }
.app-footer { display: flex; justify-content: flex-end; margin-top: auto; padding: 20px 48px; }
.sidebar-backdrop { display: none; }

.ghati-credit { display: inline-flex; align-items: center; gap: 12px; width: fit-content; text-align: left; }
.ghati-credit > span:last-child { display: grid; }
.ghati-credit small { font-size: 10px; line-height: 1.2; text-transform: uppercase; letter-spacing: .08em; }
.ghati-credit strong { font-size: 13px; line-height: 1.35; }
.ghati-credit em { font-size: 11px; font-style: normal; line-height: 1.35; }
.ghati-logo { position: relative; display: block; width: 126px; height: 46px; flex: 0 0 126px; overflow: hidden; }
.ghati-logo img { position: absolute; top: 50%; left: 0; display: block; width: 100%; height: auto; transform: translateY(-50%); }
.ghati-credit-dark { position: relative; z-index: 1; margin-top: 24px; color: #edf7f4; }
.ghati-credit-dark small, .ghati-credit-dark em { color: #91a8a3; }
.ghati-credit-light { color: var(--ink); }
.ghati-credit-light small, .ghati-credit-light em { color: var(--muted); }
.ghati-credit-login { display: none; }

.public-demo-alert { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; padding: 14px 16px; color: #6f4f13; background: #fff8df; border: 1px solid #ead79c; border-radius: 12px; }
.public-demo-alert > i { flex: none; margin-top: 2px; color: #a66d0e; font-size: 20px; }
.public-demo-alert p { display: grid; gap: 1px; margin: 0; }
.public-demo-alert strong { color: #61450f; font-size: 13px; }
.public-demo-alert span { font-size: 13px; line-height: 1.45; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.page-heading p { max-width: 640px; margin-bottom: 0; color: var(--muted); }
.page-heading.compact { margin-bottom: 24px; }
.eyebrow { margin-bottom: 10px !important; color: var(--green) !important; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; color: var(--muted); font-size: 13px; font-weight: 650; }
.back-link:hover { color: var(--ink); }
.heading-actions { display: flex; gap: 10px; }
.title-with-avatar { display: flex; align-items: center; gap: 15px; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid transparent; border-radius: var(--control-radius); cursor: pointer; font-weight: 700; white-space: nowrap; transition: transform .14s ease, background .14s ease, border-color .14s ease; }
.button:active { transform: translateY(1px); }
.button.primary { color: var(--accent-dark); background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: #c6e45d; }
.button.secondary { color: var(--ink); background: var(--surface); border-color: #cbd9d5; }
.button.secondary:hover { background: #eaf1ee; border-color: #b7cbc5; }
.button.danger { color: #fff; background: var(--danger); }
.button.danger-outline { color: var(--danger); background: transparent; border-color: #e4bebe; }
.button.danger-outline:hover { background: #fff2f2; }
.button.full { width: 100%; }
.button-loading { opacity: .65; pointer-events: none; }
.text-button { color: var(--green); font-size: 13px; font-weight: 700; }
.push-left { margin-right: auto; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(20,55,56,.02); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 16px; }
.panel-heading h2 { margin-bottom: 3px; font-size: 19px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.panel-heading > a { color: var(--green); font-size: 13px; font-weight: 750; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { min-height: 126px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.metric small, .metric strong, .metric p { display: block; }
.metric small { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric strong { margin-top: 10px; font-size: 31px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric p { margin: 8px 0 0; color: #7e918d; font-size: 12px; }
.metric.featured { display: flex; align-items: center; gap: 17px; color: #f5faf8; background: var(--nav); border-color: var(--nav); }
.metric.featured, .metric.priority { grid-column: span 2; }
.metric.featured small, .metric.featured p { color: #a4b8b4; }
.metric.featured strong { color: var(--accent); transition: opacity .2s ease; }
.metric.featured strong.is-counting { font-variant-numeric: tabular-nums; }
.metric-icon { display: grid; width: 46px; height: 46px; place-items: center; color: var(--accent); background: rgba(185,218,74,.1); border-radius: 13px; font-size: 24px; }
.metric.priority { display: flex; position: relative; align-items: center; gap: 17px; overflow: hidden; background: #f8fbdc; border-color: #d8e89a; }
.metric.priority::after { position: absolute; right: -30px; width: 120px; height: 120px; content: ""; border: 18px solid rgba(125, 158, 25, .07); border-radius: 50%; }
.metric.priority .metric-icon { color: #57730e; background: #e7f1ad; }
.metric.priority strong { color: #405b08; }
.metric.priority > * { position: relative; z-index: 1; }
.dashboard-grid { display: grid; grid-template-columns: minmax(360px, .82fr) minmax(480px, 1.18fr); gap: 18px; margin-bottom: 18px; }
.status-chart-wrap { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 14px; padding: 4px 24px 26px; }
#status-chart { width: 100%; max-width: 210px; }
canvas { display: block; max-width: 100%; }
.chart-legend { display: grid; gap: 13px; }
.chart-legend > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.chart-legend strong { color: var(--ink); }
.legend-color { width: 9px; height: 9px; border-radius: 3px; }
.legend-color.scheduled { background: var(--blue); }
.legend-color.progress { background: #e8a42b; }
.legend-color.done { background: #5f9166; }
.legend-color.cancelled { background: #a7b0ad; }
.revenue-panel canvas { width: calc(100% - 30px); margin: 0 15px 14px; }
.schedule-panel { overflow: hidden; }
.schedule-list { padding: 0 8px 10px; }
.schedule-row { display: grid; grid-template-columns: 52px 65px minmax(180px, 1.4fr) minmax(150px, 1fr) auto 20px; min-height: 72px; align-items: center; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); transition: background .14s ease; }
.schedule-row:hover { background: #f1f6f4; }
.schedule-row.is-near { background: #fbfced; box-shadow: inset 3px 0 0 #b0c94a; }
.schedule-row.is-today { background: #fff8e8; box-shadow: inset 3px 0 0 #d99a2b; }
.schedule-row.is-near:hover { background: #f6f9dc; }
.schedule-row.is-today:hover { background: #fff3d5; }
.schedule-row > .ph-caret-right { color: #9cafab; }
.schedule-date { display: grid; width: 48px; height: 50px; place-content: center; text-align: center; background: var(--surface-2); border-radius: 10px; }
.schedule-date strong { font-size: 18px; line-height: 1; }
.schedule-date span { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.schedule-time, .schedule-tech { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.schedule-main strong, .schedule-main span { display: block; }
.schedule-main span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.proximity { padding: 2px 7px; color: #62751d; background: #edf4c5; border-radius: 5px; font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.proximity.today { color: #89570b; background: #ffe6ad; }

.status { display: inline-flex; min-height: 29px; align-items: center; justify-content: center; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status.scheduled { color: #3859ad; background: #e8edff; }
.status.progress { color: #98620f; background: #fff1d5; }
.status.done { color: #3f7048; background: #e3f2e5; }
.status.cancelled, .status.neutral { color: #667572; background: #e9eeec; }

.filter-bar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; padding: 13px; background: #e7efec; border: 1px solid #d8e4e0; border-radius: 14px; }
.filter-bar label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.filter-bar input, .filter-bar select { height: 42px; padding: 0 12px; background: var(--surface); border: 1px solid #cbd9d5; border-radius: var(--control-radius); outline: none; }
.filter-bar input:focus, .filter-bar select:focus { border-color: #6c9690; box-shadow: 0 0 0 3px rgba(79,129,88,.11); }
.search-field { position: relative; min-width: 260px; flex: 1; }
.search-field i { position: absolute; top: 13px; left: 13px; color: var(--muted); font-size: 17px; }
.search-field input { width: 100%; padding-left: 39px; }
.service-filters .search-field { min-width: 220px; }
.report-filters { align-items: flex-end; }

.table-panel { overflow: hidden; }
.table-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 17px 22px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 13px; }
.table-summary strong { color: var(--ink); }
.table-summary > span { max-width: 500px; color: #5f7571; text-align: right; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 18px; color: #607671; background: #edf3f1; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 17px 18px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 15px; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f7faf9; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: #667c78; font-size: 12px; }
.entity-link { display: flex; align-items: center; gap: 11px; min-width: 230px; }
.entity-link strong { font-size: 14px; }
.entity-link small { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count-badge { display: inline-grid; min-width: 30px; height: 28px; padding: 0 8px; place-items: center; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; font-size: 12px; font-weight: 800; }
.row-actions { width: 132px; text-align: right; }
.table-action { display: inline-flex; min-height: 36px; align-items: center; justify-content: flex-end; gap: 7px; padding: 0 10px; color: #315f58; border-radius: 8px; font-size: 13px; font-weight: 750; white-space: nowrap; }
.table-action:hover { color: var(--ink); background: #e8f0ed; }
.table-readonly { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tech-inline { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.status-select { min-width: 128px; height: 36px; padding: 0 30px 0 10px; border: 0; border-radius: 8px; outline: none; font-size: 12px; font-weight: 750; cursor: pointer; }
.status-select.scheduled { color: #3859ad; background: #e8edff; }
.status-select.progress { color: #98620f; background: #fff1d5; }
.status-select.done { color: #3f7048; background: #e3f2e5; }
.status-select.cancelled { color: #667572; background: #e9eeec; }

.empty-state { display: flex; min-height: 330px; align-items: center; justify-content: center; flex-direction: column; padding: 40px; color: var(--muted); text-align: center; }
.empty-state > i { display: grid; width: 62px; height: 62px; place-items: center; margin-bottom: 16px; color: #5f817c; background: var(--surface-2); border-radius: 18px; font-size: 30px; }
.empty-state h3 { margin-bottom: 5px; color: var(--ink); }
.empty-state p { margin-bottom: 18px; }
.empty-state.small { min-height: 240px; }
.empty-state.wide { grid-column: 1 / -1; }
.empty-inline { padding: 30px 26px; color: var(--muted); }

.form-panel { overflow: hidden; }
.form-panel.narrow { max-width: 980px; }
.form-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding: 30px 34px; border-bottom: 1px solid var(--line); }
.form-section > div:first-child p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; align-content: start; gap: 7px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.field span em { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: #fff; border: 1px solid #c8d6d2; border-radius: var(--control-radius); outline: none; resize: vertical; }
.field textarea { min-height: 106px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #638e87; box-shadow: 0 0 0 3px rgba(79,129,88,.11); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field > small:not(.field-error) { color: var(--muted); font-size: 12px; font-weight: 500; }
.field-error { color: var(--danger); font-size: 12px; }
.span-2 { grid-column: span 2; }
.input-prefix { display: flex; align-items: center; background: #fff; border: 1px solid #c8d6d2; border-radius: var(--control-radius); overflow: hidden; }
.input-prefix span { padding-left: 12px; color: var(--muted); }
.input-prefix input { border: 0; box-shadow: none !important; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 34px; background: #f6f9f8; }

.detail-grid { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.28fr); gap: 18px; }
.contact-card { padding: 26px; }
.contact-card h2 { margin-bottom: 20px; }
.contact-card dl { display: grid; gap: 20px; margin: 0; }
.contact-card dl div { display: grid; gap: 5px; }
.contact-card dt { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.contact-card dd { margin: 0; color: var(--ink-2); }
.history-card { overflow: hidden; }
.timeline { padding: 0 26px 18px; }
.timeline > a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 15px 0; border-top: 1px solid var(--line); }
.timeline-marker { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; }
.timeline-marker.scheduled { color: #3859ad; background: #e8edff; }
.timeline-marker.progress { color: #98620f; background: #fff1d5; }
.timeline-marker.done { color: #3f7048; background: #e3f2e5; }
.timeline-marker.cancelled { color: #667572; background: #e9eeec; }
.timeline-content strong, .timeline-content small { display: block; }
.timeline-content small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.timeline > a > span:last-child { display: grid; justify-items: end; gap: 6px; }
.timeline > a > span:last-child b { font-size: 13px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 20px 24px; border: 1px dashed #dabbbb; border-radius: var(--radius); }
.danger-zone h2 { color: #7d3535; font-size: 14px; }
.danger-zone p { margin: 0; color: var(--muted); font-size: 13px; }

.technician-grid { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 15px; }
.technician-card { padding: 22px; }
.technician-card.inactive { opacity: .7; }
.technician-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.technician-card h2 { margin-bottom: 5px; font-size: 17px; }
.technician-card > p { min-height: 42px; color: var(--muted); font-size: 13px; }
.technician-contact { display: flex; align-items: center; gap: 7px; padding: 12px 0; color: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.technician-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0; }
.technician-stats div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.technician-stats dt { color: var(--muted); font-size: 11px; }
.technician-stats dd { margin: 3px 0 0; font-size: 22px; font-weight: 800; }

.report-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.report-summary article { display: flex; align-items: center; gap: 16px; min-height: 100px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.report-summary article > span { display: grid; width: 43px; height: 43px; place-items: center; color: var(--green); background: var(--surface-2); border-radius: 12px; font-size: 22px; }
.report-summary article.accent { color: #f4faf7; background: var(--nav); border-color: var(--nav); }
.report-summary article.accent > span { color: var(--accent); background: rgba(185,218,74,.1); }
.report-summary small, .report-summary strong { display: block; }
.report-summary small { color: var(--muted); font-size: 12px; }
.report-summary .accent small { color: #a3b6b2; }
.report-summary strong { margin-top: 3px; font-size: 23px; }
.report-summary .accent strong { color: var(--accent); }
.report-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.breakdown-list { padding: 0 24px 20px; }
.breakdown-list > div { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
.breakdown-list.ranked span { display: flex; align-items: center; gap: 10px; }
.breakdown-list.ranked span b { display: grid; width: 23px; height: 23px; place-items: center; color: var(--muted); background: var(--surface-2); border-radius: 7px; font-size: 10px; }
.report-table-heading { border-bottom: 1px solid var(--line); }

.toast { position: fixed; z-index: 40; top: 24px; right: 26px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 15px; color: #eaf5f2; background: var(--nav); border: 1px solid #34575a; border-radius: 12px; box-shadow: var(--shadow); transition: opacity .2s ease, transform .2s ease; }
.toast > i { color: var(--accent); font-size: 20px; }
.toast.error > i { color: #f0a4a4; }
.toast button { color: #afc1bd; background: none; border: 0; cursor: pointer; }
.toast-hidden { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.confirm-dialog { width: min(440px, calc(100vw - 28px)); padding: 26px; color: var(--ink); background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: 0 30px 90px rgba(11,35,37,.24); }
.confirm-dialog::backdrop { background: rgba(10,32,34,.55); backdrop-filter: blur(3px); }
.dialog-icon { display: grid; width: 44px; height: 44px; place-items: center; margin-bottom: 15px; color: var(--danger); background: #fdecec; border-radius: 12px; font-size: 23px; }
.confirm-dialog h2 { font-size: 21px; }
.confirm-dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }

.login-body { min-height: 100dvh; background: var(--surface); }
.login-layout { display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(440px, .95fr); min-height: 100dvh; }
.login-story { position: relative; display: flex; min-height: 100dvh; flex-direction: column; padding: 46px clamp(42px, 6vw, 90px); overflow: hidden; color: #edf7f4; background: var(--nav); }
.login-story::after { position: absolute; right: -18%; bottom: -30%; width: 70vw; height: 70vw; content: ""; border: 1px solid rgba(185,218,74,.16); border-radius: 50%; box-shadow: 0 0 0 70px rgba(185,218,74,.035), 0 0 0 150px rgba(185,218,74,.025); }
.login-story .brand { position: relative; z-index: 1; padding: 0; }
.login-copy { position: relative; z-index: 1; max-width: 650px; margin: auto 0; }
.kicker { display: inline-block; margin-bottom: 22px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.login-copy h1 { max-width: 560px; margin-bottom: 22px; font-size: clamp(46px, 5vw, 76px); line-height: .98; letter-spacing: -.065em; }
.login-copy p { max-width: 470px; color: #a8bcb8; font-size: 17px; }
.login-proof { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); }
.login-proof strong, .login-proof span { display: block; }
.login-proof strong { color: var(--accent); font-size: 24px; }
.login-proof span { color: #91a8a3; font-size: 11px; }
.login-panel { display: grid; min-height: 100dvh; padding: 42px; place-items: center; }
.login-form-wrap { width: min(470px, 100%); }
.login-form-wrap h2 { margin-bottom: 6px; font-size: 32px; letter-spacing: -.04em; }
.login-form-wrap > .muted { margin-bottom: 24px; }
.login-brand-mobile { display: none; }
.stack-form { display: grid; gap: 18px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; top: 14px; left: 13px; color: var(--muted); font-size: 18px; }
.input-icon input { padding-right: 44px; padding-left: 40px; }
.input-icon button { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.form-alert { display: flex; gap: 9px; margin-bottom: 20px; padding: 12px; color: #8b3434; background: #fff0f0; border: 1px solid #efcccc; border-radius: 10px; font-size: 13px; }
.demo-access { padding: 16px; background: #eef4f1; border: 1px solid #d7e3df; border-radius: 14px; }
.demo-heading > span { display: block; margin-bottom: 3px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.demo-heading h3 { margin-bottom: 3px; font-size: 18px; letter-spacing: -.02em; }
.demo-heading p { margin-bottom: 13px; color: #607672; font-size: 12px; }
.demo-options { display: grid; gap: 8px; }
.demo-button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 66px; align-items: center; gap: 11px; padding: 11px 13px; color: var(--ink); background: var(--surface); border: 1px solid #cbd9d5; border-radius: 10px; cursor: pointer; text-align: left; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.demo-button:hover { background: #f8fbfa; border-color: #82a59e; transform: translateY(-1px); }
.demo-button.selected { background: #f6fadf; border-color: #9fbd35; box-shadow: inset 3px 0 0 #9fbd35; }
.demo-button .demo-icon { display: grid; width: 36px; height: 36px; place-items: center; color: var(--green); background: #e4eeea; border-radius: 9px; font-size: 19px; }
.demo-button.selected .demo-icon { color: var(--accent-dark); background: var(--accent); }
.demo-button .demo-arrow { color: #78908b; font-size: 17px; }
.demo-button b, .demo-button small { display: block; }
.demo-button b { font-size: 13px; }
.demo-button small { margin-top: 2px; color: #647a76; font-size: 11px; line-height: 1.35; }
.demo-feedback { min-height: 18px; margin: 10px 0 0; color: #426b30; font-size: 12px; font-weight: 700; }
.login-demo-alert { margin: 14px 0 0; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #83948f; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.login-divider::before, .login-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.case-disclaimer { margin: 22px 0 0; color: #859894; font-size: 11px; text-align: center; }

.error-page { display: flex; min-height: 65vh; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.error-code { color: #c7d7d2; font-size: 90px; font-weight: 800; line-height: 1; letter-spacing: -.08em; }
.error-page p { color: var(--muted); }

@media (max-width: 1200px) {
  .content { padding: 36px 30px 58px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric.featured, .metric.priority { grid-column: span 1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .technician-grid { grid-template-columns: repeat(2, 1fr); }
  .schedule-row { grid-template-columns: 52px 60px 1fr 1fr auto; }
  .schedule-row > .ph-caret-right { display: none; }
}

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 272px; transition: transform .22s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 19; inset: 0; display: block; visibility: hidden; background: rgba(10,32,34,.48); opacity: 0; transition: opacity .22s ease, visibility .22s ease; }
  .menu-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 15; }
  .form-section { grid-template-columns: 1fr; gap: 20px; }
  .detail-grid { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: .85fr 1fr; }
  .login-story { padding: 38px; }
  .login-proof { grid-template-columns: 1fr; gap: 10px; }
  .login-proof div { display: flex; align-items: baseline; gap: 8px; }
  .login-proof strong { font-size: 18px; }
}

@media (min-width: 721px) and (max-width: 900px) {
  .table-scroll { overflow: visible; }
  table { display: block; }
  thead { display: none; }
  tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  tr { display: grid; margin: 8px; padding: 7px 16px; border: 1px solid var(--line); border-radius: 12px; }
  td { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 0; border-top: 1px solid var(--line); text-align: right; }
  td:first-child { border-top: 0; }
  td::before { flex: none; content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .entity-link { min-width: 0; text-align: left; }
  .entity-link small { max-width: 190px; }
  .client-table td:nth-child(2) { align-items: flex-start; flex-direction: column; gap: 5px; text-align: left; }
  .row-actions { width: auto; }
  .row-actions::before { content: attr(data-label); }
}

@media (max-width: 720px) {
  .content { padding: 22px 14px 44px; }
  .app-footer { justify-content: center; padding: 20px 16px; }
  .topbar { padding: 0 14px; }
  .topbar-context { font-size: 0; }
  .topbar-context i { font-size: 18px; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 18px; margin-bottom: 23px; }
  .page-heading .button { width: 100%; }
  .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .heading-actions .button { width: auto; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric.featured, .metric.priority { grid-column: 1 / -1; grid-row: auto; }
  .metric { min-height: 110px; padding: 18px; }
  .status-chart-wrap { grid-template-columns: 150px 1fr; padding-right: 14px; padding-left: 14px; }
  .schedule-row { grid-template-columns: 48px 1fr auto; gap: 12px; padding: 11px 8px; }
  .schedule-time { grid-column: 2; }
  .schedule-tech { display: none; }
  .schedule-row .status { grid-row: 1 / span 2; grid-column: 3; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label, .search-field { width: 100%; min-width: 0; }
  .filter-bar select, .filter-bar input { width: 100%; }
  .filter-bar .button { width: 100%; }
  .table-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .table-summary > span { text-align: left; }
  .table-scroll { overflow: visible; }
  table, tbody { display: block; }
  thead { display: none; }
  tr { display: grid; margin: 10px; padding: 8px 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
  td { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; text-align: right; }
  td:first-child { border-top: 0; }
  td::before { flex: none; content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .entity-link { width: 100%; min-width: 0; text-align: left; }
  .entity-link > span:last-child { min-width: 0; }
  .entity-link small { max-width: none; overflow-wrap: anywhere; white-space: normal; }
  .client-table td:nth-child(2) { align-items: flex-start; flex-direction: column; gap: 4px; text-align: left; }
  .row-actions { width: auto; padding-bottom: 4px; border-top: 0; }
  .row-actions::before { display: none; }
  .table-action { min-height: 40px; padding: 0 12px; background: var(--surface-2); }
  .service-table td:nth-child(2) strong { max-width: 65vw; text-align: right; }
  .service-table .tech-inline { max-width: 65vw; white-space: normal; text-align: right; }
  .status-select { max-width: 58vw; }
  .form-section { padding: 24px 20px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .form-actions { padding: 17px 20px; flex-wrap: wrap; }
  .form-actions .button { flex: 1; }
  .form-actions .push-left { flex-basis: 100%; order: 3; margin: 6px 0 0; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .danger-zone .button { width: 100%; }
  .technician-grid { grid-template-columns: 1fr; }
  .report-summary, .report-breakdown { grid-template-columns: 1fr; }
  .timeline > a { grid-template-columns: auto 1fr; }
  .timeline > a > span:last-child { grid-column: 2; justify-items: start; }
  .login-layout { display: block; }
  .login-story { display: none; }
  .login-panel { min-height: 100dvh; padding: 28px 20px; }
  .login-brand-mobile { display: flex; align-items: center; gap: 8px; margin-bottom: 44px; color: var(--ink); font-weight: 800; }
  .login-brand-mobile i { color: var(--green); font-size: 24px; }
  .ghati-credit-login { display: inline-flex; margin: 24px auto 0; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric.featured, .metric.priority { grid-column: 1 / -1; }
  .metric strong { font-size: 25px; }
  .status-chart-wrap { grid-template-columns: 1fr; justify-items: center; }
  .chart-legend { width: 100%; }
  .heading-actions { grid-template-columns: 1fr; }
  .demo-options { grid-template-columns: 1fr; }
  .toast { top: 12px; right: 12px; }
  .panel-heading { padding: 20px 18px 14px; }
  .status-chart-wrap { padding-bottom: 22px; }
  .table-summary { padding: 15px 18px; }
  .table-summary > span { display: none; }
}

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