:root {
  --navy: #1B2A4A;
  --navy-2: #26385f;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --line: #e6ebf2;
  --text: #172033;
  --muted: #64748b;
  --soft: 0 18px 50px rgba(27, 42, 74, 0.08);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { font-family: "Sarabun", system-ui, sans-serif; background: var(--bg); color: var(--text); }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.login-body { background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .14), transparent 30%), var(--navy); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 520px; }
.login-brand { color: white; padding: 72px; display: flex; flex-direction: column; justify-content: space-between; gap: 44px; }
.login-brand h1 { font-size: clamp(40px, 6vw, 76px); line-height: 1; margin: 12px 0 18px; letter-spacing: 0; }
.login-copy { max-width: 620px; color: rgba(255, 255, 255, .78); font-size: 20px; }
.login-panel { background: #f8fafc; display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 420px; background: white; border-radius: var(--radius); padding: 38px; box-shadow: var(--soft); }
.login-card h2 { font-size: 30px; margin: 8px 0 24px; }
.register-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.register-cta span { font-weight: 700; }
.register-form { padding-top: 2px; }
.register-note { display: block; line-height: 1.5; }
.modal-layer { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 24px; }
.modal-layer:target, .modal-layer.is-open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); backdrop-filter: blur(8px); }
.modal-card { position: relative; width: min(100%, 460px); max-height: calc(100vh - 48px); overflow: auto; background: white; border: 1px solid rgba(226, 232, 240, .9); border-radius: 28px; padding: 28px; box-shadow: 0 34px 90px rgba(15, 23, 42, .28); animation: modalIn .18s ease-out; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.modal-head h2 { margin: 6px 0 0; font-size: 26px; color: var(--navy); }
.modal-close { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 14px; background: #eef2f7; color: var(--navy); font-size: 24px; line-height: 1; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.department-stack { display: grid; gap: 14px; max-width: 560px; }
.department-tile { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 20px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); }
.department-tile strong, .department-tile small { display: block; }
.department-tile small { color: rgba(255, 255, 255, .7); }
.dept-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--dept); background: color-mix(in srgb, var(--dept), white 88%); flex: 0 0 auto; }
.demo-note, .demo-pill { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; padding: 10px 14px; border-radius: 999px; width: fit-content; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 282px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: white; padding: 28px 22px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: white; color: var(--navy); font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { color: rgba(255, 255, 255, .62); }
.nav-list { display: grid; gap: 8px; }
.nav-list a { min-height: 50px; padding: 12px 14px; border-radius: 16px; color: rgba(255, 255, 255, .76); display: flex; align-items: center; gap: 12px; transition: background .2s, color .2s, transform .2s; }
.nav-list a:hover, .nav-list a.active { background: rgba(255, 255, 255, .12); color: white; transform: translateX(2px); }
.nav-icon { width: 32px; height: 32px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .78); flex: 0 0 auto; transition: background .2s, color .2s; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-list a:hover .nav-icon, .nav-list a.active .nav-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; }
.user-chip { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, .08); }
.user-chip > span { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.user-chip strong { display: block; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.logout { color: rgba(255, 255, 255, .72); padding: 10px 12px; }
.mobile-app-bar, .mobile-sidebar-backdrop, .mobile-sidebar-close { display: none; }
.mobile-brand { display: flex; align-items: center; gap: 10px; color: var(--navy); }
.mobile-brand .brand-mark { width: 42px; height: 42px; border: 1px solid var(--line); box-shadow: 0 10px 26px rgba(27, 42, 74, .08); }
.mobile-menu-btn { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 15px; padding: 9px 13px; background: var(--navy); color: #fff; font-weight: 800; box-shadow: 0 14px 32px rgba(27, 42, 74, .18); cursor: pointer; }
.mobile-menu-btn svg { width: 18px; height: 18px; }
body.mobile-menu-open { overflow: hidden; }

.main-content { padding: 34px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 26px; }
.dashboard-topbar { align-items: center; margin-bottom: 22px; }
.topbar h1 { font-size: 34px; margin: 4px 0 0; letter-spacing: 0; }
.dashboard-topbar h1 { margin: 0; color: #111827; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.eyebrow { margin: 0; color: #64748b; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--soft); min-width: 0; }
.live-update-toast { position: fixed; right: 24px; bottom: 24px; z-index: 70; width: min(520px, calc(100vw - 32px)); display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid #bfdbfe; border-radius: 20px; background: rgba(255,255,255,.96); box-shadow: 0 24px 60px rgba(27, 42, 74, .18); backdrop-filter: blur(10px); }
.live-update-toast[hidden] { display: none; }
.live-update-toast strong, .live-update-toast span { display: block; }
.live-update-toast strong { color: var(--navy); font-size: 16px; }
.live-update-toast span { color: var(--muted); font-size: 13px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-update-close { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 12px; background: #eef2f7; color: var(--navy); cursor: pointer; font-size: 22px; line-height: 1; }
[data-live-ticket-table] { transition: opacity .18s ease; }
[data-live-ticket-table].is-refreshing { opacity: .62; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr); gap: 20px; margin-bottom: 20px; }
.wide { min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 20px; }
.section-head span, small { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-grid article { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--soft); }
.stats-grid span { display: block; color: var(--muted); margin-bottom: 8px; }
.stats-grid strong { font-size: 34px; color: var(--navy); }
.compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }

.dashboard-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: -8px 0 18px; }
.toolbar-spacer { flex: 1; }
.dash-filter { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: white; color: #172033; border-radius: 18px; padding: 10px 14px; box-shadow: 0 10px 28px rgba(15, 23, 42, .05); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.dash-filter:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(15, 23, 42, .08); }
.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.kpi-card { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 20px; min-height: 128px; box-shadow: 0 14px 34px rgba(15, 23, 42, .06); transition: transform .2s, box-shadow .2s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 20px 42px rgba(15, 23, 42, .09); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.kpi-top span { color: #111827; font-weight: 700; }
.kpi-top b { width: 28px; height: 28px; display: grid; place-items: center; color: #2563eb; background: #eff6ff; border-radius: 10px; }
.kpi-card strong { display: block; font-size: 32px; line-height: 1; letter-spacing: 0; color: #0f172a; }
.kpi-card p, .chart-value p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.kpi-card em, .chart-value em { font-style: normal; font-weight: 800; border-radius: 999px; padding: 3px 8px; margin-right: 5px; }
.kpi-card em.up, .chart-value em.up { background: #dcfce7; color: #059669; }
.kpi-card em.down { background: #ffe4e6; color: #e11d48; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.dashboard-main, .dashboard-side { display: grid; gap: 18px; }
.chart-panel { min-height: 320px; }
.repair-chart { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: end; }
.chart-value { padding-bottom: 22px; }
.chart-value > span { color: var(--muted); font-weight: 700; }
.chart-value strong { display: block; font-size: 42px; line-height: 1; margin: 54px 0 0; color: #0f172a; }
.line-chart { position: relative; min-height: 190px; overflow: hidden; }
.line-chart svg { width: 100%; height: 190px; display: block; overflow: visible; }
.line-chart .grid-line { position: absolute; left: 0; right: 0; height: 1px; border-top: 1px dashed #d9e1ec; }
.line-chart .grid-line.one { top: 18px; }
.line-chart .grid-line.two { top: 82px; }
.line-chart .grid-line.three { top: 146px; }
.area-path { fill: rgba(37, 99, 235, .12); stroke: none; }
.main-path { fill: none; stroke: #2563eb; stroke-width: 4; }
.ghost-path { fill: none; stroke: #cbd5e1; stroke-width: 3; stroke-dasharray: 8 8; }
.chart-tooltip { position: absolute; top: 54px; left: 48%; min-width: 154px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 18px 40px rgba(15, 23, 42, .12); font-size: 12px; }
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip span { color: #475569; margin-top: 4px; }
.status-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 16px; border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: linear-gradient(180deg, #fff, #f8fafc); }
.status-strip div { position: relative; display: grid; gap: 2px; padding: 10px 12px 10px 16px; overflow: hidden; }
.status-strip div:has(.strip-blue) { --strip: #2563eb; }
.status-strip div:has(.strip-green) { --strip: #059669; }
.status-strip div:has(.strip-orange) { --strip: #D97706; }
.status-strip div::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; border-radius: 999px; background: var(--strip); }
.status-strip span { position: absolute; left: 0; top: 10px; width: 3px; height: 42px; border-radius: 999px; background: var(--strip); }
.status-strip strong { font-size: 20px; color: #0f172a; }
.status-strip small { font-size: 12px; }
.strip-blue { --strip: #2563eb; }
.strip-green { --strip: #059669; }
.strip-orange { --strip: #D97706; }
.dashboard-table table { min-width: 0; }
.dashboard-table th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-table td { padding: 15px 12px; }
.dashboard-table td a { font-weight: 700; color: #172033; }
.dashboard-table td small { margin-top: 4px; }
.active-days-card { min-height: 212px; }
.day-bars { display: flex; align-items: end; justify-content: space-between; gap: 14px; min-height: 132px; padding-top: 14px; }
.day-bars div { flex: 1; display: grid; justify-items: center; gap: 7px; }
.day-bars b { color: #0f172a; font-size: 13px; }
.day-bars span { width: 100%; max-width: 42px; height: var(--h); border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--dept), white 12%), color-mix(in srgb, var(--dept), white 38%)); box-shadow: inset 0 -18px 30px rgba(255,255,255,.26); }
.day-bars small { font-size: 12px; max-width: 68px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge-card { min-height: 200px; }
.gauge { position: relative; width: 212px; height: 134px; margin: 14px auto 0; display: grid; place-items: center; }
.gauge-ring { position: absolute; inset: 0; border-radius: 212px 212px 0 0; background: conic-gradient(from 270deg at 50% 100%, #059669 var(--score), #edf2f7 0 50%, transparent 0); -webkit-mask: radial-gradient(circle at 50% 100%, transparent 0 58px, #000 59px); mask: radial-gradient(circle at 50% 100%, transparent 0 58px, #000 59px); }
.gauge strong { position: relative; font-size: 40px; line-height: 1; margin-top: 26px; color: #0f172a; }
.gauge > span { position: absolute; bottom: 22px; color: var(--muted); font-size: 12px; }
.assistant-card { min-height: 198px; overflow: hidden; }
.assistant-card p { color: #475569; line-height: 1.65; margin: 12px 0 0; }
.assistant-orb { width: 82px; height: 82px; margin: 8px auto; border-radius: 50%; }
.assistant-orb.ok { background: radial-gradient(circle at 35% 30%, #7dd3fc, #2563eb 62%, #1B2A4A); box-shadow: 0 22px 40px rgba(37, 99, 235, .28); }
.assistant-orb.warn { background: radial-gradient(circle at 35% 30%, #fed7aa, #D97706 62%, #7c2d12); box-shadow: 0 22px 40px rgba(217, 119, 6, .25); }

.command-dashboard { display: grid; gap: 18px; }
.command-hero { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; align-items: center; gap: 22px; padding: 26px; border-radius: 28px; background: linear-gradient(135deg, #1B2A4A 0%, #243a65 62%, #2563eb 140%); color: white; box-shadow: 0 22px 54px rgba(27, 42, 74, .18); }
.hero-kicker { display: inline-flex; width: fit-content; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.82); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-copy h2 { margin: 12px 0 8px; font-size: clamp(28px, 3vw, 44px); line-height: 1.06; letter-spacing: 0; }
.hero-copy p { max-width: 720px; margin: 0; color: rgba(255,255,255,.76); font-size: 16px; }
.hero-live { display: grid; gap: 3px; padding: 18px; border-radius: 22px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.hero-live span, .hero-live small { color: rgba(255,255,255,.72); }
.hero-live strong { font-size: 38px; line-height: 1; }
.hero-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.hero-actions .btn.ghost { background: rgba(255,255,255,.12); color: white; border: 1px solid rgba(255,255,255,.16); }
.ops-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ops-metric { min-height: 122px; display: grid; align-content: center; gap: 8px; padding: 20px; border-radius: 24px; background: white; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(15, 23, 42, .055); transition: transform .2s, box-shadow .2s; }
.ops-metric:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(15, 23, 42, .08); }
.ops-metric span { color: var(--muted); font-weight: 700; }
.ops-metric strong { color: #0f172a; font-size: 34px; line-height: 1; }
.ops-metric small { min-height: 20px; }
.ops-metric.urgent strong { color: #e11d48; }
.ops-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.ops-left, .ops-right { display: grid; gap: 18px; min-width: 0; }
.flow-board { display: grid; gap: 10px; }
.flow-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 46px; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; color: #172033; background: #f8fafc; transition: transform .2s, background .2s; }
.flow-row:hover { transform: translateX(2px); background: #eef4ff; }
.flow-row > span { font-weight: 700; }
.flow-row div { height: 10px; border-radius: 999px; background: #e8eef6; overflow: hidden; }
.flow-row b { display: block; height: 100%; border-radius: inherit; background: var(--flow, #2563eb); }
.flow-row strong { text-align: right; font-size: 18px; }
.flow-row.status-pending { --flow: #94a3b8; }
.flow-row.status-assigned { --flow: #2563eb; }
.flow-row.status-in_progress { --flow: #D97706; }
.flow-row.status-waiting_parts { --flow: #7c3aed; }
.flow-row.status-waiting_rating { --flow: #eab308; }
.flow-row.status-completed { --flow: #059669; }
.flow-row.status-cancelled { --flow: #dc2626; }
.dept-load-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dept-load-card { position: relative; min-height: 178px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(180deg, #fff, #f8fafc); overflow: hidden; transition: transform .2s, border .2s, box-shadow .2s; }
.dept-load-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--dept), white 40%); box-shadow: 0 18px 42px color-mix(in srgb, var(--dept), transparent 84%); }
.dept-load-card .dept-icon { color: var(--dept); background: color-mix(in srgb, var(--dept), white 88%); }
.dept-load-card strong, .dept-load-card small { display: block; }
.dept-load-card b { font-size: 32px; line-height: 1; color: var(--dept); }
.dept-load-card em { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: linear-gradient(90deg, var(--dept) var(--load), #edf2f7 0); }
.rating-dept-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rating-dept-panel { display: grid; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--dept), white 96%)); min-width: 0; }
.rating-dept-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rating-dept-head .dept-icon { width: 38px; height: 38px; border-radius: 13px; color: var(--dept); background: color-mix(in srgb, var(--dept), white 88%); }
.rating-dept-head strong, .rating-dept-head small { display: block; }
.rating-dept-head div { min-width: 0; }
.rating-dept-head small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rating-total { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.rating-total strong { font-size: 34px; line-height: 1; color: var(--dept); }
.rating-total span { color: var(--muted); font-size: 13px; }
.rating-meter, .tech-rating-row em { display: block; height: 9px; overflow: hidden; border-radius: 999px; background: #edf2f7; }
.rating-meter b, .tech-rating-row em b { display: block; width: var(--score); height: 100%; border-radius: inherit; background: var(--dept); }
.tech-rating-list { display: grid; gap: 10px; margin-top: 2px; }
.tech-rating-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 11px; border-radius: 14px; background: rgba(255,255,255,.78); border: 1px solid color-mix(in srgb, var(--dept), white 82%); }
.tech-rating-row span { font-weight: 800; color: #172033; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tech-rating-row strong { color: var(--dept); }
.tech-rating-row small { grid-column: 1; font-size: 12px; }
.tech-rating-row em { grid-column: 1 / -1; height: 7px; }
.empty-rating { display: grid; place-items: center; min-height: 76px; border: 1px dashed #d7e1ee; border-radius: 16px; color: var(--muted); text-align: center; background: rgba(255,255,255,.66); }
.team-dashboard .dept-load-grid { grid-template-columns: minmax(0, 1fr); }
.team-dashboard .dept-load-card { min-height: 132px; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: none; align-items: center; gap: 18px; padding: 22px 24px; }
.team-dashboard .dept-load-card b { font-size: 44px; text-align: right; }
.team-dashboard .rating-dept-grid { grid-template-columns: minmax(0, 1fr); }
.team-dashboard .rating-dept-panel { grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr); align-items: start; column-gap: 20px; padding: 22px; }
.team-dashboard .rating-dept-head,
.team-dashboard .rating-total,
.team-dashboard .rating-meter,
.team-dashboard .rating-dept-panel > small { grid-column: 1; }
.team-dashboard .tech-rating-list,
.team-dashboard .empty-rating { grid-column: 2; grid-row: 1 / span 4; align-self: stretch; margin-top: 0; }
.team-dashboard .tech-rating-list { align-content: start; }
.team-dashboard .empty-rating { min-height: 100%; }
.worklist { display: grid; }
.work-item { display: grid; grid-template-columns: 118px minmax(220px, 1fr) 130px 110px; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); transition: background .2s; }
.work-item:last-child { border-bottom: 0; }
.work-item:hover { background: #f8fafc; }
.work-item.is-urgent { box-shadow: inset 4px 0 #e11d48; padding-left: 12px; }
.work-ticket { color: var(--muted); font-weight: 800; }
.work-title { font-weight: 800; color: #172033; }
.work-title small { display: block; margin-top: 3px; font-weight: 400; }
.decision-list { display: grid; gap: 10px; }
.decision-list a { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 4px 10px; padding: 13px; border-radius: 16px; background: #fff7ed; border: 1px solid #fed7aa; transition: transform .2s; }
.decision-list a:hover { transform: translateY(-1px); }
.decision-list strong { color: #9a3412; }
.decision-list span { font-weight: 800; color: #172033; }
.decision-list small { grid-column: 2; color: #c2410c; }
.quality-score { position: relative; width: 188px; height: 188px; display: grid; place-items: center; margin: 6px auto 18px; border-radius: 50%; }
.quality-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(#059669 var(--score), #e8eef6 0); -webkit-mask: radial-gradient(circle, transparent 0 58px, #000 60px); mask: radial-gradient(circle, transparent 0 58px, #000 60px); }
.quality-score strong { position: relative; font-size: 42px; color: #0f172a; }
.quality-score > span { position: absolute; bottom: 48px; color: var(--muted); font-size: 12px; }
.quality-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quality-pair div { padding: 14px; border-radius: 16px; background: #f8fafc; }
.quality-pair strong, .quality-pair small { display: block; }
.quality-pair strong { font-size: 22px; color: #0f172a; }
.priority-stack { display: grid; gap: 12px; }
.priority-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 34px; gap: 10px; align-items: center; }
.priority-row span { color: #334155; font-weight: 700; }
.priority-row div { height: 10px; border-radius: 999px; background: #edf2f7; overflow: hidden; }
.priority-row b { display: block; height: 100%; border-radius: inherit; background: var(--priority, #94a3b8); }
.priority-row strong { text-align: right; }
.priority-row.low { --priority: #94a3b8; }
.priority-row.medium { --priority: #2563eb; }
.priority-row.high { --priority: #D97706; }
.priority-row.urgent { --priority: #e11d48; }
.priority-row.medical_high { --priority: #dc2626; }
.priority-row.medical_medium { --priority: #d97706; }
.priority-row.medical_low { --priority: #16a34a; }
.priority-row.medical_wait { --priority: #0284c7; }
.priority-row.medical_advance { --priority: #4f46e5; }
.priority-row.maintenance_urgent { --priority: #e11d48; }
.priority-row.maintenance_medium { --priority: #d97706; }
.priority-row.maintenance_wait { --priority: #0284c7; }

.kpi-it-shell { display: grid; gap: 18px; }
.kpi-hero-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px; background: linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef5ff 100%); }
.kpi-hero-card h2 { margin: 6px 0 8px; font-size: 32px; color: #0f172a; }
.kpi-hero-card p:not(.eyebrow) { margin: 0; color: var(--muted); }
.kpi-period-form { display: flex; align-items: end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.kpi-period-form label { width: 144px; min-width: 0; display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
.kpi-period-form input, .kpi-period-form select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; background: white; color: #172033; }
.kpi-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-summary-card { min-height: 126px; display: grid; align-content: center; gap: 8px; padding: 20px; border-radius: 24px; background: white; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(15, 23, 42, .055); }
.kpi-summary-card span { color: var(--muted); font-weight: 800; }
.kpi-summary-card strong { font-size: 36px; line-height: 1; color: #0f172a; }
.kpi-summary-card.pass strong { color: #059669; }
.kpi-summary-card.risk strong { color: #e11d48; }
.kpi-summary-card.waiting strong { color: #D97706; }
.kpi-auto-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpi-auto-card { display: grid; gap: 10px; min-height: 218px; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: #fff; box-shadow: 0 14px 34px rgba(15, 23, 42, .05); }
.kpi-auto-card.pass { --kpi: #059669; background: linear-gradient(180deg, #fff, #f0fdf4); }
.kpi-auto-card.risk { --kpi: #e11d48; background: linear-gradient(180deg, #fff, #fff1f2); }
.kpi-auto-card.waiting { --kpi: #D97706; background: linear-gradient(180deg, #fff, #fffbeb); }
.kpi-auto-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--kpi); }
.kpi-auto-head span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--kpi), white 86%); }
.kpi-auto-card h3 { margin: 0; min-height: 52px; font-size: 18px; color: #172033; }
.kpi-auto-card strong { font-size: 34px; color: var(--kpi); line-height: 1; }
.kpi-auto-card small, .kpi-auto-card em { color: var(--muted); font-style: normal; }
.kpi-table { min-width: 1080px; }
.kpi-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-table td { vertical-align: top; }
.kpi-table td strong, .kpi-table td small { display: block; }
.source-chip, .kpi-status { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 10px; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.source-chip.auto { background: #dbeafe; color: #1d4ed8; }
.source-chip.manual { background: #fff7ed; color: #c2410c; }
.kpi-status svg { width: 16px; height: 16px; }
.kpi-status.pass { background: #dcfce7; color: #047857; }
.kpi-status.risk { background: #ffe4e6; color: #be123c; }
.kpi-status.waiting { background: #f1f5f9; color: #475569; }
.kpi-value-input, .kpi-note-input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; color: #172033; background: #fff; }
.kpi-value-input { max-width: 150px; }
.kpi-value-input:disabled, .kpi-note-input:disabled { background: #f8fafc; color: #94a3b8; }
.kpi-view-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 22px; background: #eef3f9; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.kpi-view-tabs a { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 14px; border-radius: 17px; color: #475569; font-weight: 900; transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
.kpi-view-tabs a:hover { color: var(--navy); transform: translateY(-1px); }
.kpi-view-tabs a.active { background: #fff; color: var(--navy); box-shadow: 0 12px 28px rgba(15, 23, 42, .08); }
.kpi-view-tabs svg { width: 18px; height: 18px; }
.report-view-tabs { margin-top: 4px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.report-view-tabs a { justify-content: flex-start; align-items: flex-start; min-height: 82px; padding: 14px 18px; text-decoration: none; }
.report-view-tabs a > span { display: grid; gap: 2px; min-width: 0; }
.report-view-tabs strong, .report-view-tabs small { display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.report-view-tabs small { color: #64748b; font-size: 12px; font-weight: 700; line-height: 1.35; }
.report-view-tabs a.active small { color: #64748b; }
.kpi-report-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.kpi-year-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-year-summary div { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; }
.kpi-year-summary span, .kpi-year-summary strong { display: block; }
.kpi-year-summary span { color: var(--muted); font-weight: 800; }
.kpi-year-summary strong { margin-top: 6px; font-size: 28px; color: var(--navy); }
.kpi-year-table { min-width: 1320px; }
.kpi-year-table th { font-size: 12px; }
.kpi-year-table td { padding: 10px 8px; vertical-align: middle; }
.kpi-year-table td:first-child { min-width: 260px; }
.year-kpi-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; min-height: 30px; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.year-kpi-cell.pass { background: #dcfce7; color: #047857; }
.year-kpi-cell.risk { background: #ffe4e6; color: #be123c; }
.year-kpi-cell.waiting { background: #f1f5f9; color: #64748b; }
.kpi-metric-create { display: grid; grid-template-columns: minmax(260px, 1.4fr) repeat(5, minmax(130px, .75fr)) auto; gap: 12px; align-items: end; }
.kpi-metric-create .wide { min-width: 0; }
.kpi-metric-create label span { color: var(--muted); font-weight: 800; }
.kpi-metric-create .btn { min-height: 48px; }
.kpi-manage-table { min-width: 1280px; }
.kpi-manage-table th { color: #64748b; font-size: 13px; }
.kpi-manage-table td { vertical-align: top; }
.kpi-inline-edit { margin: 0; }
.kpi-inline-edit input { font-weight: 800; }
.kpi-manage-targets { display: grid; grid-template-columns: minmax(120px, 1fr) 92px 82px; gap: 8px; }
.kpi-manage-table .sort-input { width: 88px; }
.kpi-manage-table small { display: block; margin-top: 6px; color: #64748b; }

.settings-shell { display: grid; gap: 20px; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-form .full { grid-column: 1 / -1; }
.setting-toggle { min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
.inline-settings-action { margin-top: 14px; display: flex; justify-content: flex-end; }
.line-department-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 16px; }
.line-department-card { display: grid; gap: 14px; padding: 18px; border: 1px solid color-mix(in srgb, var(--dept), white 74%); border-radius: 22px; background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--dept), white 96%)); box-shadow: 0 14px 34px rgba(15, 23, 42, .055); }
.line-department-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid color-mix(in srgb, var(--dept), white 80%); }
.line-department-head h3 { margin: 0; color: #0f172a; font-size: 20px; line-height: 1.2; }
.line-department-head span { display: block; margin-top: 4px; color: #64748b; line-height: 1.45; }
.compact-check { width: auto; flex: 0 0 auto; min-height: 38px; padding: 8px 10px; border-radius: 14px; background: #fff; border: 1px solid color-mix(in srgb, var(--dept), white 72%); white-space: nowrap; }
.line-department-options { display: grid; gap: 10px; }
.backup-actions { display: grid; grid-template-columns: minmax(260px, .6fr) minmax(420px, 1fr); gap: 16px; align-items: start; }
.backup-download-form { padding-top: 25px; }
.restore-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: end; }
.go-live-panel { border-color: #fecdd3; background: linear-gradient(180deg, #fff, #fff7f7); }
.go-live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.go-live-warning, .go-live-keep { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fff; }
.go-live-warning { border-color: #fecdd3; background: #fff1f2; }
.go-live-keep { border-color: #bfdbfe; background: #eff6ff; }
.go-live-warning strong, .go-live-keep strong { display: block; color: var(--navy); margin-bottom: 8px; }
.go-live-warning ul, .go-live-keep ul { margin: 0; padding-left: 20px; color: #475569; line-height: 1.7; }
.go-live-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 14px; align-items: end; margin-top: 14px; }
.go-live-form .check { align-self: center; }
.go-live-form label:not(.check) { min-width: 220px; }
.backup-list { margin-top: 20px; max-height: 260px; overflow-y: auto; display: grid; gap: 10px; padding-right: 8px; scrollbar-gutter: stable; }
.backup-list h3 { position: sticky; top: 0; z-index: 2; margin: 0 0 4px; padding: 0 0 8px; background: #fff; }
.backup-list div:not(.empty-state) { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
.backup-list span { color: var(--muted); font-weight: 700; }
.settings-shell .table-wrap.small-table { max-height: 390px; overflow: auto; padding-right: 4px; scrollbar-gutter: stable; }
.settings-log-table { min-width: 920px; }
.settings-log-table th { position: sticky; top: 0; z-index: 2; color: #64748b; background: #fff; font-size: 13px; box-shadow: 0 1px 0 var(--line); }
.settings-log-table small { color: #475569; }
.backup-list::-webkit-scrollbar, .settings-shell .table-wrap.small-table::-webkit-scrollbar { width: 10px; height: 10px; }
.backup-list::-webkit-scrollbar-thumb, .settings-shell .table-wrap.small-table::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 2px solid #fff; }
.backup-list::-webkit-scrollbar-track, .settings-shell .table-wrap.small-table::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 999px; }
.log-status { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; color: #475569; background: #f1f5f9; font-weight: 900; }
.log-status.sent { color: #047857; background: #dcfce7; }
.log-status.failed { color: #be123c; background: #ffe4e6; }
.log-status.skipped { color: #a16207; background: #fef3c7; }

.print-report-body { background: #e5e7eb; color: #111827; }
.print-page { max-width: 980px; margin: 24px auto; padding: 0 16px; }
.print-page.landscape { max-width: 1360px; }
.print-report { background: white; min-height: 1120px; padding: 34px; border-radius: 4px; box-shadow: 0 20px 60px rgba(15, 23, 42, .14); }
.print-report-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 3px solid var(--navy); }
.print-logo { width: 58px; height: 58px; display: grid; place-items: center; border: 2px solid var(--navy); border-radius: 16px; color: var(--navy); font-weight: 900; }
.print-report-head strong { color: var(--navy); font-size: 18px; }
.print-report-head h1 { margin: 3px 0; font-size: 26px; color: #111827; }
.print-report-head p { margin: 0; color: #64748b; }
.print-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.print-summary div { padding: 12px; border: 1px solid #dbe3ee; border-radius: 12px; background: #f8fafc; }
.print-summary span, .print-summary strong { display: block; }
.print-summary span { color: #64748b; font-weight: 700; }
.print-summary strong { margin-top: 4px; font-size: 24px; color: var(--navy); }
.print-kpi-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.print-kpi-table.yearly { font-size: 11px; }
.print-kpi-table th, .print-kpi-table td { border: 1px solid #cbd5e1; padding: 7px 8px; vertical-align: top; }
.print-kpi-table th { background: var(--navy); color: white; text-align: left; }
.print-kpi-table.yearly th, .print-kpi-table.yearly td { padding: 5px; }
.print-status.pass { background: #dcfce7; color: #047857; font-weight: 800; }
.print-status.risk { background: #ffe4e6; color: #be123c; font-weight: 800; }
.print-status.waiting { background: #f1f5f9; color: #475569; font-weight: 800; }
.print-status span, .print-status small { display: block; }
.print-status small { margin-top: 2px; font-size: 10px; }
.print-note { margin: 14px 0 26px; color: #475569; font-size: 12px; }
.print-signatures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 38px; }
.print-signatures div { display: grid; gap: 12px; text-align: center; color: #475569; }
.print-signatures b { height: 42px; border-bottom: 1px solid #334155; }
.print-signatures span { font-weight: 800; color: #111827; }
.repair-print-page { max-width: 1120px; }
.repair-print-report { display: grid; gap: 18px; padding: 32px; }
.repair-print-head { border-bottom-width: 4px; }
.repair-print-hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: stretch; padding: 20px; border: 1px solid #dbe3ee; border-radius: 18px; background: linear-gradient(135deg, #f8fafc, #eef5ff); }
.repair-print-hero span, .repair-print-period span { display: block; color: #64748b; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.repair-print-hero h2 { margin: 4px 0; font-size: 30px; color: var(--navy); }
.repair-print-hero p { margin: 0; color: #475569; line-height: 1.55; }
.repair-print-period { display: grid; align-content: center; gap: 4px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid #dbe3ee; }
.repair-print-period strong { color: #111827; font-size: 18px; }
.repair-print-period small { color: #64748b; font-weight: 800; }
.repair-print-summary { margin: 0; }
.repair-print-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.repair-print-card { padding: 18px; border: 1px solid #dbe3ee; border-radius: 18px; background: #fff; break-inside: avoid; }
.repair-print-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.repair-print-section-head h3 { margin: 0; color: #111827; font-size: 20px; line-height: 1.25; }
.repair-print-section-head span { color: #64748b; font-weight: 800; white-space: nowrap; }
.repair-print-bars { display: grid; gap: 12px; }
.repair-print-bars div { display: grid; grid-template-columns: minmax(150px, .42fr) minmax(120px, 1fr) 46px; align-items: center; gap: 12px; }
.repair-print-bars span { display: inline-flex; align-items: center; gap: 8px; color: #334155; font-weight: 900; }
.repair-print-bars svg { width: 18px; height: 18px; color: var(--dept); }
.repair-print-bars b { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--dept) var(--w), #e8eef5 var(--w)); }
.repair-print-bars strong { text-align: right; font-size: 18px; }
.repair-print-status-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.repair-print-status-list div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #f8fafc; }
.repair-print-status-list span { color: #334155; font-weight: 800; }
.repair-print-status-list strong { color: var(--navy); font-size: 18px; }
.repair-print-category-grid { display: grid; gap: 10px; }
.repair-print-category-grid div { display: grid; grid-template-columns: 34px minmax(130px, .45fr) minmax(120px, 1fr) 52px; align-items: center; gap: 10px; }
.repair-print-category-grid em { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 11px; background: #e8eef8; color: var(--navy); font-style: normal; font-weight: 900; }
.repair-print-category-grid span { color: #111827; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repair-print-category-grid b { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #2563eb var(--w), #e8eef5 var(--w)); }
.repair-print-category-grid strong { text-align: right; color: var(--navy); }
.repair-print-empty { margin: 0; padding: 18px; border-radius: 14px; background: #f8fafc; color: #64748b; text-align: center; font-weight: 800; }
.repair-print-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 13px; }
.repair-print-table th, .repair-print-table td { padding: 8px 9px; border: 1px solid #dbe3ee; vertical-align: top; }
.repair-print-table th { background: var(--navy); color: #fff; font-weight: 800; }
.repair-print-table td { color: #111827; }
.repair-print-table td strong { display: block; }
.repair-print-table.compact { font-size: 12px; }
.repair-print-workload { display: grid; gap: 10px; }
.repair-print-workload div { display: grid; grid-template-columns: minmax(100px, .45fr) minmax(120px, 1fr); gap: 8px 10px; align-items: center; }
.repair-print-workload span { color: #111827; font-weight: 900; }
.repair-print-workload b { height: 10px; border-radius: 999px; background: linear-gradient(90deg, #059669 var(--w), #e8eef5 var(--w)); }
.repair-print-workload small { grid-column: 2; color: #64748b; font-weight: 800; }
.repair-print-signatures { margin-top: 18px; }
.requester-print-page { max-width: 1360px; }
.requester-print-report { gap: 14px; padding: 26px; }
.requester-print-hero { grid-template-columns: minmax(0, 1fr) 300px; padding: 16px 18px; }
.requester-print-hero h2 { font-size: 28px; }
.requester-print-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.requester-print-summary div { min-height: 72px; padding: 10px 12px; }
.requester-print-summary span { font-size: 12px; }
.requester-print-summary strong { font-size: 20px; line-height: 1.2; }
.requester-print-card { padding: 14px; border-radius: 14px; }
.requester-print-table, .requester-print-detail-table { font-size: 11px; table-layout: fixed; }
.requester-print-table th, .requester-print-table td,
.requester-print-detail-table th, .requester-print-detail-table td { padding: 6px 7px; }
.requester-print-table th:nth-child(1) { width: 44px; text-align: center; }
.requester-print-table th:nth-child(2) { width: 20%; }
.requester-print-table th:nth-child(3),
.requester-print-table th:nth-child(4),
.requester-print-table th:nth-child(5),
.requester-print-table th:nth-child(6) { width: 74px; text-align: center; }
.requester-print-table th:nth-child(7),
.requester-print-table th:nth-child(8) { width: 114px; }
.requester-print-table td:nth-child(1),
.requester-print-table td:nth-child(3),
.requester-print-table td:nth-child(4),
.requester-print-table td:nth-child(5),
.requester-print-table td:nth-child(6) { text-align: center; }
.requester-print-rank { color: var(--navy); font-weight: 900; }
.requester-print-money { white-space: nowrap; text-align: right; font-weight: 900; color: #0f766e; }
.requester-print-latest strong { color: #1d4ed8; }
.requester-print-latest small { display: block; color: #64748b; font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
.requester-print-detail-table th:nth-child(1) { width: 92px; }
.requester-print-detail-table th:nth-child(2) { width: 86px; }
.requester-print-detail-table th:nth-child(3) { width: 15%; }
.requester-print-detail-table th:nth-child(4) { width: 112px; }
.requester-print-detail-table th:nth-child(5) { width: 100px; }
.requester-print-detail-table th:nth-child(7),
.requester-print-detail-table th:nth-child(8) { width: 82px; }
.requester-print-table td, .requester-print-detail-table td { overflow-wrap: anywhere; }

.department-metrics, .mini-list, .part-list { display: grid; gap: 12px; }
.metric-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; border: 1px solid var(--line); }
.metric-row b { font-size: 28px; color: var(--dept); }
.mini-list a, .part-list div { display: grid; gap: 4px; padding: 14px; border-radius: 16px; background: #f8fafc; transition: background .2s, transform .2s; }
.mini-list a:hover { background: #eef4ff; transform: translateY(-1px); }

.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.form-field.is-hidden { display: none; }
.combo-field.is-hidden { display: none; }
.field-help { display: block; margin-top: 8px; color: #64748b; line-height: 1.55; }
input, select, textarea { width: 100%; border: 1px solid #d9e1ec; border-radius: 16px; padding: 12px 14px; background: #fff; color: var(--text); outline: none; transition: border .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.file-upload-field { display: grid; gap: 8px; min-width: 0; }
.file-upload-label span { margin-bottom: 0; }
.file-upload-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.file-upload-clear { min-height: 48px; border: 0; border-radius: 15px; padding: 10px 14px; background: #fee2e2; color: #b91c1c; font-weight: 800; cursor: pointer; transition: background .2s, transform .2s; white-space: nowrap; }
.file-upload-clear:hover { background: #fecaca; transform: translateY(-1px); }
.combo-field { position: relative; display: block; }
.combo-control { position: relative; }
.combo-control input { padding-right: 44px; }
.combo-field.is-open .combo-control input { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.combo-arrow { position: absolute; right: 16px; top: 50%; width: 10px; height: 10px; border-right: 2px solid #0f172a; border-bottom: 2px solid #0f172a; transform: translateY(-65%) rotate(45deg); pointer-events: none; transition: transform .18s ease; }
.combo-field.is-open .combo-arrow { transform: translateY(-35%) rotate(225deg); }
.combo-options { position: absolute; z-index: 45; left: 0; right: 0; top: calc(100% + 8px); display: none; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid #d9e1ec; border-radius: 16px; background: #fff; box-shadow: 0 18px 42px rgba(15, 23, 42, .16); }
.combo-field.is-open .combo-options { display: grid; gap: 2px; }
.combo-option { width: 100%; border: 0; border-radius: 12px; padding: 10px 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background .16s, color .16s; }
.combo-option:hover, .combo-option.is-active { background: #eff6ff; color: #1d4ed8; }
.combo-empty { padding: 12px; color: var(--muted); text-align: center; }
.select-field { position: relative; width: 100%; }
.native-select-hidden { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.select-control { position: relative; width: 100%; min-height: 50px; border: 1px solid #d9e1ec; border-radius: 16px; padding: 12px 44px 12px 14px; background: #fff; color: var(--text); text-align: left; cursor: pointer; outline: none; transition: border .2s, box-shadow .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-control::after { content: ""; position: absolute; right: 16px; top: 50%; width: 10px; height: 10px; border-right: 2px solid #0f172a; border-bottom: 2px solid #0f172a; transform: translateY(-65%) rotate(45deg); transition: transform .18s ease; }
.select-field.is-open .select-control, .select-control:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.select-field.is-open .select-control::after { transform: translateY(-35%) rotate(225deg); }
.select-options { position: absolute; z-index: 44; left: 0; right: 0; top: calc(100% + 8px); display: none; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid #d9e1ec; border-radius: 16px; background: #fff; box-shadow: 0 18px 42px rgba(15, 23, 42, .16); }
.select-field.is-open .select-options { display: grid; gap: 2px; }
.select-option { width: 100%; border: 0; border-radius: 12px; padding: 10px 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background .16s, color .16s; }
.select-option:hover, .select-option.is-active { background: #eff6ff; color: #1d4ed8; }
.select-option.is-selected { font-weight: 800; color: #1d4ed8; }
.select-option:disabled { color: #94a3b8; cursor: not-allowed; }
.btn { border: 0; border-radius: 16px; padding: 13px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--navy); color: white; box-shadow: 0 12px 30px rgba(27, 42, 74, .18); }
.btn.ghost { background: #eef2f7; color: var(--navy); }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.compact { padding: 10px 14px; border-radius: 14px; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.5); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 18px; }

.department-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.department-choice { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 20px; display: grid; gap: 10px; cursor: pointer; transition: border .2s, transform .2s, box-shadow .2s; }
.department-choice:hover, .department-choice.selected { border-color: var(--dept); box-shadow: 0 14px 32px color-mix(in srgb, var(--dept), transparent 84%); transform: translateY(-2px); }

.filters { display: grid; grid-template-columns: minmax(260px, 1fr) repeat(3, 180px) auto; gap: 12px; margin-bottom: 18px; align-items: end; }
.ticket-filters { grid-template-columns: minmax(280px, 1.2fr) repeat(4, minmax(150px, .55fr)) auto; }
.ticket-custom-range { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(180px, 260px)); gap: 12px; align-items: end; width: fit-content; max-width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; }
.ticket-custom-range.is-hidden { display: none; }
.ticket-custom-range label { min-width: 0; }
.ticket-custom-range input { min-height: 50px; background: #fff; }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 48px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th { color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td small, td strong { display: block; }
tr:hover td { background: #fafcff; }
.urgent-row td { background: #fff1f2; }
.table-link { font-weight: 700; color: var(--navy); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.priority-low { background: #eef2f7; color: #475569; }
.priority-medium { background: #e0f2fe; color: #0369a1; }
.priority-high { background: #fff7ed; color: #c2410c; }
.priority-urgent { background: #ffe4e6; color: #be123c; }
.priority-medical_high { background: #fee2e2; color: #b91c1c; }
.priority-medical_medium { background: #fef3c7; color: #92400e; }
.priority-medical_low { background: #dcfce7; color: #166534; }
.priority-medical_wait { background: #e0f2fe; color: #0369a1; }
.priority-medical_advance { background: #eef2ff; color: #4338ca; }
.priority-maintenance_urgent { background: #ffe4e6; color: #be123c; }
.priority-maintenance_medium { background: #fef3c7; color: #92400e; }
.priority-maintenance_wait { background: #e0f2fe; color: #0369a1; }
.status-pending { background: #f1f5f9; color: #475569; }
.status-assigned { background: #dbeafe; color: #1d4ed8; }
.status-in_progress { background: #fef3c7; color: #b45309; }
.status-waiting_parts { background: #ede9fe; color: #6d28d9; }
.status-waiting_external_repair { background: #ffedd5; color: #c2410c; }
.status-waiting_rating { background: #fef9c3; color: #854d0e; }
.status-waiting_disposal { background: #fce7f3; color: #be185d; }
.status-waiting_approval { background: #e0f2fe; color: #0369a1; }
.status-disposed { background: #ffe4e6; color: #be123c; }
.status-completed { background: #d1fae5; color: #047857; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 14px; display: grid; place-items: center; background: #eef2f7; color: var(--navy); cursor: pointer; }
.icon-btn.danger { background: #fee2e2; color: #b91c1c; }
.icon-btn.danger:hover { background: #fecaca; }
.action-icon { width: 38px; height: 38px; border: 0; border-radius: 14px; display: inline-grid; place-items: center; background: #eef2f7; color: var(--navy); cursor: pointer; transition: transform .2s, background .2s, box-shadow .2s; }
.action-icon:hover { transform: translateY(-1px); background: #e0e8f3; box-shadow: 0 10px 22px rgba(15, 23, 42, .08); }
.action-icon.danger { background: #fee2e2; color: #b91c1c; }
.action-icon.danger:hover { background: #fecaca; }
.action-icon.muted { background: #f1f5f9; color: #475569; }
.action-icon svg { width: 18px; height: 18px; }
.pagination { display: flex; justify-content: flex-end; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 16px; color: var(--muted); }
.pagination button { border: 1px solid var(--line); background: white; border-radius: 12px; padding: 8px 12px; color: var(--muted); }
.pagination a { text-decoration: none; }
.pagination .btn { min-width: 92px; }

.alert { margin-bottom: 18px; border-radius: 18px; padding: 14px 16px; border: 1px solid; }
.alert.error { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.alert.success { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.alert.info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.user-update-toast { position: fixed; top: 24px; right: 24px; z-index: 80; width: min(430px, calc(100vw - 32px)); display: grid; grid-template-columns: 42px minmax(0, 1fr) 36px; align-items: center; gap: 12px; padding: 14px; border: 1px solid #a7f3d0; border-radius: 18px; background: rgba(236, 253, 245, .98); color: #065f46; box-shadow: 0 22px 56px rgba(6, 95, 70, .18); transition: opacity .2s ease, transform .2s ease; }
.user-update-toast.is-hiding { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.user-update-toast-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: #10b981; color: #fff; }
.user-update-toast-icon svg { width: 21px; height: 21px; stroke-width: 2.5; }
.user-update-toast-copy { min-width: 0; }
.user-update-toast-copy strong, .user-update-toast-copy span { display: block; }
.user-update-toast-copy strong { margin-bottom: 2px; color: #065f46; font-size: 16px; }
.user-update-toast-copy span { overflow: hidden; color: #047857; font-size: 14px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.user-update-toast-close { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(16, 185, 129, .12); color: #047857; cursor: pointer; font-size: 22px; line-height: 1; }
.user-update-toast-close:hover { background: rgba(16, 185, 129, .2); }
.user-modal-feedback { grid-column: 1 / -1; margin: 0; }
.rating-required-alert { display: grid; gap: 10px; }
.rating-required-alert strong { color: var(--navy); }
.rating-required-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rating-required-list a { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 11px; background: #fff; color: var(--navy); font-weight: 800; border: 1px solid #bfdbfe; }
.empty-state { min-height: 180px; display: grid; place-content: center; text-align: center; gap: 6px; background: #f8fafc; border: 1px dashed #d5deea; border-radius: 20px; color: var(--muted); }
.empty-state strong { color: var(--navy); }
.empty-state.small { min-height: 128px; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; }
.ticket-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.ticket-heading h2 { margin: 6px 0 0; font-size: 30px; }
.badge-group { display: flex; gap: 8px; align-items: flex-start; }
.detail-text { color: #334155; line-height: 1.75; padding: 18px; background: #f8fafc; border-radius: 18px; overflow-wrap: anywhere; word-break: break-word; }
.ticket-attachment { margin: 18px 0; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #f8fafc; }
.ticket-attachment figcaption { color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.ticket-attachment a { display: block; width: 100%; }
.ticket-attachment img { display: block; width: 100%; max-height: 420px; object-fit: contain; border: 1px solid #e6ebf2; border-radius: 14px; background: #fff; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.detail-grid div { min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.detail-grid dt { color: var(--muted); font-size: 13px; }
.detail-grid dd { margin: 6px 0 0; font-weight: 700; overflow-wrap: anywhere; word-break: break-word; }
.ticket-team-card { margin: 18px 0; border: 1px solid var(--line); border-radius: 24px; padding: 18px; background: #fff; box-shadow: 0 14px 34px rgba(27, 42, 74, .05); }
.team-list { display: grid; gap: 10px; }
.team-member { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px 14px; border: 1px solid #e6edf7; border-radius: 16px; background: #f8fafc; }
.team-member.primary { background: #eff6ff; border-color: #bfdbfe; }
.team-member div { min-width: 0; }
.team-member strong, .team-member span, .team-member small { overflow-wrap: anywhere; word-break: break-word; }
.team-member strong { display: block; color: var(--navy); }
.team-member span, .team-member small { color: var(--muted); font-weight: 700; }
.team-member-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.team-member-actions form { flex: 0 0 auto; }
.team-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 12px; align-items: center; }
.asset-section { margin-top: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(180deg, #f8fbff, #fff); }
.asset-section-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.asset-section-head h3 { margin: 4px 0 0; font-size: 22px; }
.asset-section-head > span { color: var(--muted); max-width: 380px; line-height: 1.55; text-align: right; }
.asset-form-grid { align-items: start; }
.asset-field.is-hidden { display: none; }
.repeat-card { margin: 18px 0; border: 1px solid var(--line); border-radius: 24px; padding: 18px; background: linear-gradient(180deg, #fff, #f8fafc); box-shadow: 0 16px 36px rgba(27, 42, 74, .06); }
.repeat-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.repeat-card-head h3 { margin: 4px 0 0; font-size: 22px; }
.repeat-status { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 900; white-space: nowrap; }
.repeat-status.normal { background: #e0f2fe; color: #0369a1; }
.repeat-status.watch { background: #fef3c7; color: #a16207; }
.repeat-status.repeat { background: #ffedd5; color: #c2410c; }
.repeat-status.replace { background: #ffe4e6; color: #be123c; }
.asset-info-grid, .repeat-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.asset-info-grid div, .asset-info-grid label, .repeat-metrics div { border: 1px solid #e6edf7; border-radius: 16px; padding: 12px; background: #fff; min-width: 0; }
.asset-info-grid span, .repeat-metrics span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.asset-info-grid strong, .repeat-metrics strong { display: block; color: var(--navy); font-size: 16px; overflow-wrap: anywhere; }
.asset-info-grid label { display: grid; gap: 8px; }
.asset-info-grid input,
.asset-info-grid select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}
.asset-info-grid input:focus,
.asset-info-grid select:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.repeat-form-actions { margin-top: 12px; }
.repeat-metrics { margin-top: 10px; }
.repeat-advice { margin-top: 12px; padding: 14px; border-radius: 18px; background: #f1f5f9; display: grid; gap: 4px; }
.repeat-advice strong { color: var(--navy); }
.repeat-advice span { color: var(--muted); }
.repeat-history-list { margin-top: 14px; display: grid; gap: 10px; }
.repeat-history-list > span { color: var(--muted); font-weight: 800; }
.repeat-history-list a { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid #e6edf7; color: var(--navy); transition: border .2s, transform .2s; }
.repeat-history-list a:hover { border-color: #bfdbfe; transform: translateY(-1px); }
.repeat-history-list small { color: var(--muted); }
.inline-actions { display: flex; gap: 12px; margin: 18px 0; }
.inline-actions select { max-width: 240px; }
.ticket-update-form { display: grid; gap: 14px; margin: 18px 0; }
.ticket-update-form .inline-actions { margin: 0; flex-wrap: wrap; align-items: center; }
.medical-detail-panel, .medical-detail-readonly { border: 1px solid #bbf7d0; border-radius: 24px; padding: 18px; background: linear-gradient(180deg, #f0fdf4, #fff); box-shadow: 0 16px 36px rgba(5, 150, 105, .08); }
.it-detail-panel, .it-detail-readonly { border: 1px solid #bfdbfe; border-radius: 24px; padding: 18px; background: linear-gradient(180deg, #eff6ff, #fff); box-shadow: 0 16px 36px rgba(37, 99, 235, .08); }
.maintenance-detail-panel, .maintenance-detail-readonly { border: 1px solid #fed7aa; border-radius: 24px; padding: 18px; background: linear-gradient(180deg, #fff7ed, #fff); box-shadow: 0 16px 36px rgba(217, 119, 6, .08); }
.medical-detail-panel .section-head, .medical-detail-readonly .section-head { margin-bottom: 14px; }
.it-detail-panel .section-head, .it-detail-readonly .section-head { margin-bottom: 14px; }
.maintenance-detail-panel .section-head, .maintenance-detail-readonly .section-head { margin-bottom: 14px; }
.medical-detail-panel .section-head > span { color: var(--muted); font-weight: 700; max-width: 360px; text-align: right; line-height: 1.5; }
.it-detail-panel .section-head > span { color: var(--muted); font-weight: 700; max-width: 360px; text-align: right; line-height: 1.5; }
.maintenance-detail-panel .section-head > span { color: var(--muted); font-weight: 700; max-width: 360px; text-align: right; line-height: 1.5; }
.medical-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.medical-detail-grid .full { grid-column: 1 / -1; }
.medical-detail-grid textarea { min-height: 112px; resize: vertical; }
.medical-detail-grid.readonly > div { min-width: 0; border: 1px solid #d1fae5; border-radius: 16px; padding: 14px; background: #fff; }
.maintenance-detail-readonly .medical-detail-grid.readonly > div { border-color: #fed7aa; }
.medical-detail-grid.readonly span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.medical-detail-grid.readonly strong { display: block; color: var(--navy); overflow-wrap: anywhere; word-break: break-word; }
.medical-company-field[hidden] { display: none; }
.it-company-field[hidden] { display: none; }
.medical-close-uploader { display: grid; gap: 12px; border: 1px solid #d1fae5; border-radius: 18px; padding: 14px; background: rgba(255, 255, 255, .72); }
.medical-close-upload-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--navy); font-weight: 900; }
.medical-close-upload-head small { color: var(--muted); font-weight: 800; }
.medical-close-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.medical-add-image { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; min-height: 46px; border: 0; border-radius: 14px; padding: 10px 14px; background: var(--navy); color: #fff; font-weight: 900; line-height: 1.2; cursor: pointer; box-shadow: 0 12px 30px rgba(27, 42, 74, .18); transition: transform .2s, box-shadow .2s, opacity .2s; }
.medical-add-image:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(27, 42, 74, .2); }
.medical-add-image:focus-within { outline: 3px solid rgba(37, 99, 235, .2); outline-offset: 2px; }
.medical-add-image.is-disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.medical-add-image input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.medical-add-image.is-disabled input { cursor: not-allowed; }
.medical-add-image > span { display: inline; margin: 0; color: #fff; font-size: inherit; line-height: inherit; }
.medical-add-image svg { width: 18px; height: 18px; stroke: currentColor; color: #fff; flex: 0 0 auto; }
.medical-close-images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.medical-close-slot { position: relative; display: grid; place-items: center; min-height: 132px; border: 1px dashed #a7f3d0; border-radius: 16px; overflow: hidden; background: #f8fffb; color: #047857; font-weight: 900; }
.medical-close-slot.has-image { border-style: solid; border-color: #d1fae5; background: #fff; }
.medical-close-images a { display: block; width: 100%; height: 100%; color: inherit; }
.medical-close-images img { display: block; width: 100%; aspect-ratio: 4 / 3; height: 100%; object-fit: cover; }
.medical-remove-image { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(254, 226, 226, .94); color: #b91c1c; cursor: pointer; box-shadow: 0 10px 24px rgba(185, 28, 28, .16); }
.medical-remove-image svg { width: 18px; height: 18px; stroke: currentColor; }
.medical-pending-badge { position: absolute; left: 8px; bottom: 8px; border-radius: 999px; padding: 5px 9px; background: rgba(27, 42, 74, .9); color: #fff; font-size: 12px; font-weight: 900; }
.medical-slot-empty { color: #059669; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.arrival-actions { align-items: center; flex-wrap: wrap; padding: 14px; border: 1px solid #bae6fd; border-radius: 18px; background: #f0f9ff; }
.arrival-actions span { color: #0369a1; font-weight: 800; }
.subsection { margin-top: 26px; }
.chat-list { display: grid; gap: 12px; margin: 12px 0; }
.chat-list article { min-width: 0; background: #f8fafc; border-radius: 18px; padding: 14px; overflow-wrap: anywhere; word-break: break-word; }
.chat-list article.internal { background: #fff7ed; border: 1px solid #fed7aa; }
.comment-form textarea { margin-bottom: 10px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.check input { width: auto; }
.side-stack { display: grid; gap: 20px; align-content: start; }
.mini-form { display: grid; gap: 10px; margin-top: 14px; }
.user-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; margin-bottom: 20px; }
.users-table { min-width: 1080px; }
.users-table th:nth-child(5), .users-table td:nth-child(5) { width: 120px; white-space: nowrap; }
.users-table th:nth-child(6), .users-table td:nth-child(6) { width: 160px; white-space: nowrap; }
.user-name-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-avatar { width: 36px; height: 36px; border-radius: 13px; display: grid; place-items: center; background: #eef4ff; color: #1d4ed8; font-weight: 900; flex: 0 0 auto; }
.role-chip { display: inline-flex; align-items: center; max-width: 180px; white-space: nowrap; color: var(--navy); font-weight: 700; }
.user-status-badge { min-width: 76px; justify-content: center; }
.table-action { display: inline-flex; margin: 0; }
.user-actions { min-width: 150px; }
.user-action-bar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.user-modal { width: min(100%, 620px); }
.user-modal-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-modal-form .modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.report-list { margin-bottom: 20px; }
.report-shell { display: grid; gap: 24px; }
.report-main-head h2 { margin: 2px 0 0; font-size: 30px; }
.report-filter-form { display: grid; grid-template-columns: minmax(360px, 1.2fr) minmax(180px, .7fr) auto auto; gap: 12px; align-items: end; }
.report-filter-form .period-tabs { width: 100%; }
.report-filter-form label span { color: var(--muted); font-weight: 700; }
.report-period-field { display: grid; gap: 6px; min-width: 0; }
.report-period-field.is-hidden, .report-custom-range.is-hidden { display: none; }
.report-custom-range { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 12px; min-width: 0; }
.report-custom-range label { display: grid; gap: 6px; min-width: 0; }
.report-print-link { align-self: end; }
.report-summary-layout { display: grid; grid-template-columns: minmax(420px, .92fr) minmax(480px, 1.08fr); align-items: start; gap: 20px; }
.report-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.report-stat-grid article { min-height: 146px; display: grid; align-content: center; }
.report-section-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); align-items: start; gap: 20px; }
.report-panel { border: 1px solid var(--line); border-radius: 24px; padding: 22px; background: #fff; box-shadow: 0 18px 44px rgba(27, 42, 74, .06); }
.repeat-report-panel { background: linear-gradient(180deg, #fff, #f8fafc); }
.repeat-report-list { display: grid; gap: 12px; }
.repeat-report-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto 42px; gap: 14px; align-items: center; padding: 14px; border: 1px solid #e6edf7; border-radius: 18px; background: #fff; }
.repeat-report-main { min-width: 0; }
.repeat-report-main h4 { margin: 8px 0 2px; color: var(--navy); font-size: 18px; overflow-wrap: anywhere; }
.repeat-report-main p { margin: 0; color: var(--muted); }
.repeat-report-metrics { display: grid; grid-template-columns: repeat(3, max-content); gap: 8px; align-items: center; }
.repeat-report-metrics span { display: inline-flex; flex-direction: column; gap: 2px; min-width: 86px; padding: 9px 10px; border-radius: 14px; background: #f1f5f9; color: #64748b; font-size: 12px; font-weight: 700; }
.repeat-report-metrics b { color: var(--navy); font-size: 15px; }
.multi-tech-list { display: grid; gap: 12px; }
.multi-tech-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid #e6edf7; border-radius: 18px; background: #f8fafc; color: var(--ink); text-decoration: none; transition: transform .2s, background .2s, border-color .2s; }
.multi-tech-list a:hover { transform: translateY(-1px); background: #eef4fb; border-color: #cfdbeb; }
.multi-tech-list strong { display: block; min-width: 0; overflow-wrap: anywhere; }
.multi-tech-list span { display: block; margin-top: 4px; color: var(--muted); font-weight: 700; overflow-wrap: anywhere; }
.multi-tech-list em { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; padding: 8px 10px; border-radius: 999px; background: #e8eef8; color: var(--navy); font-style: normal; font-weight: 900; white-space: nowrap; }
.report-dept-panel { min-height: 312px; padding: 20px 22px; display: grid; align-content: center; }
.section-head.compact { margin-bottom: 16px; }
.section-head.compact h3 { margin: 0; font-size: 22px; }
.section-head.compact span { color: var(--muted); font-weight: 700; }
.report-bar-list { display: grid; gap: 14px; }
.report-dept-panel .section-head.compact { margin-bottom: 16px; }
.report-dept-panel .report-bar-list { gap: 12px; }
.report-bar-row { display: grid; grid-template-columns: minmax(170px, .42fr) minmax(160px, 1fr) 56px; align-items: center; gap: 14px; }
.report-bar-row span { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: #334155; font-weight: 800; }
.report-bar-row svg { width: 20px; height: 20px; color: var(--dept); }
.report-bar-row div { height: 12px; border-radius: 999px; background: #edf2f7; overflow: hidden; }
.report-bar-row div b { display: block; width: var(--w); height: 100%; border-radius: inherit; background: var(--dept); }
.report-bar-row strong { text-align: right; font-size: 20px; line-height: 1; }
.report-category-list { display: grid; gap: 12px; }
.report-category-list a { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; color: var(--ink); background: #f8fafc; text-decoration: none; transition: transform .2s, background .2s; }
.report-category-list a:hover { transform: translateY(-1px); background: #eef4fb; }
.report-category-list em { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 12px; color: var(--navy); background: #e8eef8; font-style: normal; font-weight: 900; }
.report-category-list strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-category-list span { color: var(--muted); font-weight: 800; }
.report-table table { min-width: 820px; }
.report-table th { color: #64748b; font-size: 14px; }
.report-table td { vertical-align: middle; }
.report-table td small { display: block; margin-top: 2px; color: var(--muted); }
.requester-report-panel { display: grid; gap: 18px; background: linear-gradient(180deg, #fff, #f8fbff); }
.requester-report-head { align-items: flex-end; gap: 16px; }
.requester-report-head > div { min-width: 0; }
.requester-report-head h3, .requester-report-head span { overflow-wrap: anywhere; }
.requester-report-actions { min-width: min(100%, 660px); display: grid; grid-template-columns: minmax(320px, 1fr) auto; gap: 10px; align-items: end; }
.requester-location-filter { min-width: min(100%, 520px); display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid #e6edf7; border-radius: 18px; background: #f8fafc; }
.requester-location-filter label { margin: 0; }
.requester-location-filter label span { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 800; }
.requester-report-print-link { min-height: 58px; white-space: nowrap; }
.requester-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.requester-summary-grid article { min-height: 122px; }
.requester-summary-grid small { display: block; margin-top: 8px; color: var(--muted); font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.requester-location-table table { min-width: 1120px; }
.requester-location-name { display: block; color: var(--navy); overflow-wrap: anywhere; }
.cost-pill { color: #0f766e; background: #ccfbf1; }
.danger-pill { color: #be123c; background: #ffe4e6; }
.metric-pill, .duration-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px; border-radius: 999px; color: #1d4ed8; background: #dbeafe; font-weight: 900; }
.metric-pill.cost-pill { color: #0f766e; background: #ccfbf1; }
.metric-pill.danger-pill { color: #be123c; background: #ffe4e6; }
.duration-chip { color: #0f766e; background: #ccfbf1; }
.compact-empty { min-height: 118px; padding: 18px; border-radius: 18px; }
.workload-list { display: grid; gap: 14px; }
.workload-row { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #fbfdff; }
.workload-row div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.workload-row strong { font-size: 17px; }
.workload-row span { color: var(--muted); font-weight: 700; }
.workload-row > b { display: block; height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--blue) var(--w), #e8eef5 var(--w)); }
.technician-personal-panel { display: grid; gap: 18px; background: linear-gradient(180deg, #fff, #f8fbff); }
.technician-personal-filter { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid #e6edf7; border-radius: 20px; background: #f8fafc; }
.technician-personal-filter label { margin: 0; }
.technician-personal-filter label span { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 800; }
.technician-profile-strip { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid #dbeafe; border-radius: 22px; background: linear-gradient(135deg, #eff6ff, #ffffff); }
.technician-profile-strip .avatar { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 18px; background: var(--navy); color: #fff; font-size: 22px; font-weight: 900; }
.technician-profile-strip strong, .technician-profile-strip span { display: block; min-width: 0; overflow-wrap: anywhere; }
.technician-profile-strip strong { color: var(--navy); font-size: 22px; }
.technician-profile-strip span { margin-top: 2px; color: var(--muted); font-weight: 800; }
.technician-personal-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; }
.technician-personal-stats article { min-height: 132px; }
.technician-personal-stats small { display: block; margin-top: 8px; color: var(--muted); font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.technician-personal-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 18px; }
.technician-mini-panel { padding: 16px; border: 1px solid #e6edf7; border-radius: 20px; background: #fff; }
.technician-day-list { display: grid; gap: 10px; }
.technician-day-list > div:not(.empty-state) { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 16px; background: #f8fafc; }
.technician-day-list strong { color: var(--navy); }
.technician-day-list span { color: var(--muted); font-weight: 800; text-align: right; }
.technician-status-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.technician-status-split div { min-height: 92px; display: grid; align-content: center; gap: 5px; padding: 14px; border-radius: 18px; background: #f8fafc; }
.technician-status-split span { color: var(--muted); font-weight: 800; }
.technician-status-split strong { color: var(--navy); font-size: 30px; line-height: 1; }
.role-pill { color: #7c3aed; background: #ede9fe; }
.technician-ticket-table { margin-top: 2px; }
.technician-ticket-table table { min-width: 1180px; }
.technician-print-page { max-width: 860px; }
.technician-print-report { gap: 14px; padding: 28px; }
.technician-print-report .repair-print-head { padding-bottom: 14px; }
.technician-print-report .repair-print-head h1 { font-size: 24px; }
.technician-print-hero { grid-template-columns: 1fr; padding: 16px; background: linear-gradient(135deg, #eef4ff, #ffffff); }
.technician-print-hero h2 { font-size: 28px; }
.technician-print-report .repair-print-period { grid-template-columns: 1fr; padding: 12px 14px; }
.technician-print-report .repair-print-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.technician-print-report .repair-print-summary div { min-height: 76px; padding: 12px 14px; }
.technician-print-report .repair-print-summary div:first-child { background: var(--navy); border-color: var(--navy); }
.technician-print-report .repair-print-summary div:first-child span, .technician-print-report .repair-print-summary div:first-child strong { color: #fff; }
.technician-print-report .repair-print-grid { grid-template-columns: 1fr; gap: 12px; }
.technician-print-report .repair-print-card { padding: 14px; border-radius: 14px; }
.technician-print-report .repair-print-section-head { margin-bottom: 10px; }
.technician-print-report .repair-print-section-head h3 { font-size: 18px; }
.technician-print-report .repair-print-status-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.technician-print-report .repair-print-workload div { grid-template-columns: 120px minmax(0, 1fr); }
.technician-print-ticket-list { display: grid; gap: 10px; }
.technician-print-ticket-list article { padding: 12px; border: 1px solid #dbe3ee; border-radius: 14px; background: #fbfdff; break-inside: avoid; }
.technician-print-ticket-list header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #e8eef5; }
.technician-print-ticket-list header strong { color: #1d4ed8; font-size: 13px; letter-spacing: .02em; }
.technician-print-ticket-list h4 { margin: 2px 0 0; color: #111827; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.technician-print-ticket-list header span { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #e8eef8; color: var(--navy); font-size: 12px; font-weight: 900; white-space: nowrap; }
.technician-print-ticket-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; padding-top: 10px; }
.technician-print-ticket-meta div { display: grid; gap: 2px; min-width: 0; }
.technician-print-ticket-meta span { color: #64748b; font-size: 11px; font-weight: 800; }
.technician-print-ticket-meta b { color: #111827; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.technician-print-rank-list { display: grid; gap: 8px; }
.technician-print-rank-list div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 12px; background: #f8fafc; }
.technician-print-rank-list span { min-width: 0; color: #111827; font-weight: 900; overflow-wrap: anywhere; }
.technician-print-rank-list b { color: var(--navy); white-space: nowrap; }
.technician-print-note { margin: -4px 0 10px; color: #64748b; font-size: 13px; font-weight: 700; line-height: 1.55; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline li { --event: var(--navy); --event-bg: #f8fafc; position: relative; display: grid; gap: 4px; padding: 12px 12px 12px 42px; border: 1px solid color-mix(in srgb, var(--event), white 78%); border-radius: 16px; background: linear-gradient(180deg, #fff, var(--event-bg)); }
.timeline li::before { content: ""; position: absolute; left: 16px; top: 17px; width: 12px; height: 12px; border-radius: 999px; background: var(--event); box-shadow: 0 0 0 5px color-mix(in srgb, var(--event), transparent 84%); }
.timeline strong { color: var(--event); font-size: 16px; }
.timeline span { color: #243044; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.timeline em { width: fit-content; max-width: 100%; color: #1B2A4A; background: rgba(255,255,255,.72); border: 1px solid color-mix(in srgb, var(--event), white 78%); border-radius: 999px; padding: 4px 9px; font-style: normal; font-weight: 800; font-size: 13px; overflow-wrap: anywhere; word-break: break-word; }
.timeline small { color: #64748b; font-weight: 700; }
.timeline .event-create { --event: #2563eb; --event-bg: #eff6ff; }
.timeline .event-assign { --event: #7c3aed; --event-bg: #f5f3ff; }
.timeline .event-accept { --event: #D97706; --event-bg: #fff7ed; }
.timeline .event-arrive { --event: #0891b2; --event-bg: #ecfeff; }
.timeline .event-status { --event: #059669; --event-bg: #ecfdf5; }
.timeline .event-rating { --event: #0ea5e9; --event-bg: #f0f9ff; }
.timeline .event-note { --event: #475569; --event-bg: #f8fafc; }
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 6px; margin-bottom: 14px; }
.stars input { display: none; }
.stars span { font-size: 30px; color: #cbd5e1; cursor: pointer; }
.stars label:has(input:checked) span, .stars label:has(input:checked) ~ label span, .stars span:hover, .stars label:hover ~ label span { color: #f59e0b; }
.technician-rating-list { display: grid; gap: 12px; margin-bottom: 16px; }
.technician-rating-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; }
.technician-rating-item strong, .technician-rating-item span { display: block; min-width: 0; overflow-wrap: anywhere; }
.technician-rating-item span { margin-top: 3px; color: var(--muted); font-weight: 700; }
.technician-stars { margin: 0; white-space: nowrap; }
.technician-stars span { font-size: 28px; }

.work-filter-panel { margin-bottom: 18px; }
.work-filter-head { display: none; }
.work-filter-form { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, auto) auto; align-items: end; gap: 12px; }
.work-filter-form p { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.work-custom-range { display: grid; grid-template-columns: repeat(2, minmax(160px, 180px)); gap: 12px; align-items: end; }
.work-custom-range.is-hidden { display: none; }
.period-tabs { min-height: 50px; display: inline-grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; }
.period-tabs label { cursor: pointer; }
.period-tabs input { display: none; }
.period-tabs span { height: 38px; display: grid; place-items: center; margin: 0; border-radius: 13px; color: #475569; font-weight: 800; transition: background .2s, color .2s, box-shadow .2s; }
.period-tabs input:checked + span { background: var(--navy); color: #fff; box-shadow: 0 10px 22px rgba(27, 42, 74, .16); }
.work-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.work-more-list { margin-top: 6px; }
.work-more-list summary { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; border-radius: 16px; background: #eef2f7; color: var(--navy); font-weight: 900; cursor: pointer; list-style: none; }
.work-more-list summary::-webkit-details-marker { display: none; }
.work-more-list summary::after { content: "↓"; font-size: 14px; line-height: 1; transition: transform .2s ease; }
.work-more-list[open] summary::after { transform: rotate(180deg); }
.work-more-items { margin-top: 10px; max-height: 360px; overflow: auto; padding-right: 6px; }
.work-more-items::-webkit-scrollbar { width: 8px; }
.work-more-items::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr); gap: 24px; margin-top: 22px; }
.bar-chart { display: grid; gap: 14px; }
.bar-chart div { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: center; }
.bar-chart div::before { content: ""; height: 14px; width: var(--w); max-width: 100%; border-radius: 999px; background: var(--dept); grid-column: 2; grid-row: 1; }
.bar-chart span { grid-column: 1; color: var(--muted); }
.bar-chart b { grid-column: 3; }
.small-table table { min-width: 420px; }
.quick-login { margin-top: 18px; display: grid; gap: 6px; color: var(--muted); }
.quick-login code { color: var(--navy); background: #f1f5f9; padding: 8px 10px; border-radius: 12px; }

@media (max-width: 1100px) {
  .app-shell, .login-shell { grid-template-columns: 1fr; }
  .mobile-app-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: rgba(245, 247, 251, .92); border-bottom: 1px solid rgba(226, 232, 240, .9); backdrop-filter: blur(14px); }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; width: min(320px, 86vw); height: 100dvh; max-height: none; padding-top: 24px; transform: translateX(-105%); transition: transform .24s ease, box-shadow .24s ease; box-shadow: 26px 0 60px rgba(15, 23, 42, 0); overflow-y: auto; }
  body.mobile-menu-open .sidebar { transform: translateX(0); box-shadow: 26px 0 60px rgba(15, 23, 42, .26); }
  .mobile-sidebar-backdrop { position: fixed; inset: 0; z-index: 75; border: 0; background: rgba(15, 23, 42, .44); backdrop-filter: blur(4px); cursor: pointer; }
  body.mobile-menu-open .mobile-sidebar-backdrop { display: block; }
  .mobile-sidebar-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
  body.mobile-menu-open .mobile-sidebar-close { display: grid; }
  .sidebar .brand { padding-right: 46px; }
  .main-content { padding-top: 22px; }
  .section-grid, .detail-layout, .report-grid, .report-section-grid, .report-summary-layout, .dashboard-grid, .ops-layout, .command-hero, .kpi-hero-card { grid-template-columns: 1fr; }
  .report-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-view-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-dept-panel { min-height: 0; }
  .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-summary-grid, .kpi-auto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-metric-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-metric-create .wide { grid-column: 1 / -1; }
  .kpi-metric-create .btn { grid-column: 1 / -1; }
  .backup-actions, .restore-form, .go-live-grid, .go-live-form { grid-template-columns: 1fr; }
  .backup-download-form { padding-top: 0; }
  .line-department-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .ops-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions { justify-content: flex-start; }
  .filters, .work-filter-form, .report-filter-form { grid-template-columns: 1fr 1fr; }
  .ticket-custom-range { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-filter-form .period-tabs, .work-filter-form .work-custom-range, .work-filter-form p { grid-column: 1 / -1; }
  .work-custom-range { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filter-form .period-tabs { grid-column: 1 / -1; }
  .report-custom-range { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repeat-report-list article { grid-template-columns: minmax(0, 1fr); }
  .repeat-report-list .icon-btn { width: 100%; }
  .multi-tech-list a { grid-template-columns: minmax(0, 1fr); }
  .multi-tech-list em { width: fit-content; }
}

@media (max-width: 720px) {
  .main-content, .login-brand, .login-panel { padding: 22px; }
  .topbar, .ticket-heading { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: stretch; }
  .dashboard-toolbar { justify-content: stretch; flex-wrap: wrap; }
  .toolbar-spacer { display: none; }
  .dash-filter { width: 100%; justify-content: center; }
  .stats-grid, .dashboard-kpi-grid, .department-picker, .form-grid.two, .detail-grid, .asset-info-grid, .repeat-metrics, .medical-detail-grid, .medical-close-images, .work-columns, .compact-grid, .kpi-summary-grid, .kpi-auto-grid { grid-template-columns: 1fr; }
  .asset-section-head, .repeat-card-head { align-items: flex-start; flex-direction: column; }
  .asset-section-head > span { max-width: none; text-align: left; }
  .it-detail-panel .section-head, .it-detail-readonly .section-head { align-items: flex-start; flex-direction: column; }
  .it-detail-panel .section-head > span { max-width: none; text-align: left; }
  .maintenance-detail-panel .section-head, .maintenance-detail-readonly .section-head { align-items: flex-start; flex-direction: column; }
  .maintenance-detail-panel .section-head > span { max-width: none; text-align: left; }
  .technician-rating-item { grid-template-columns: 1fr; align-items: start; }
  .technician-stars { justify-content: flex-end; width: 100%; }
  .team-member, .team-member-actions { align-items: flex-start; flex-direction: column; }
  .team-member-actions { width: 100%; }
  .team-member-actions form, .team-member-actions .icon-btn { width: 100%; }
  .team-add-form { grid-template-columns: 1fr; }
  .team-add-form .btn { width: 100%; }
  .repeat-report-metrics { grid-template-columns: 1fr; }
  .report-stat-grid { grid-template-columns: 1fr; }
  .kpi-view-tabs { grid-template-columns: 1fr; }
  .report-view-tabs { grid-template-columns: 1fr; }
  .report-view-tabs a { min-height: auto; padding: 14px; }
  .report-view-tabs small { white-space: normal; }
  .kpi-metric-create { grid-template-columns: 1fr; }
  .kpi-metric-create .wide, .kpi-metric-create .btn { grid-column: auto; }
  .settings-form, .line-department-grid { grid-template-columns: 1fr; }
  .settings-form .full { grid-column: auto; }
  .inline-settings-action { justify-content: stretch; }
  .go-live-form label:not(.check) { min-width: 0; }
  .go-live-form .btn { width: 100%; }
  .backup-list div:not(.empty-state) { align-items: flex-start; flex-direction: column; }
  .kpi-period-form { justify-content: stretch; }
  .kpi-period-form label, .kpi-period-form .btn, .kpi-report-actions .btn { width: 100%; }
  .kpi-year-summary { grid-template-columns: 1fr; }
  .command-hero { padding: 22px; border-radius: 24px; }
  .ops-metrics, .dept-load-grid, .rating-dept-grid, .quality-pair, .team-dashboard .rating-dept-panel { grid-template-columns: 1fr; }
  .team-dashboard .tech-rating-list, .team-dashboard .empty-rating { grid-column: 1; grid-row: auto; }
  .flow-row { grid-template-columns: 1fr 56px; gap: 8px; }
  .flow-row div { grid-column: 1 / -1; grid-row: 2; }
  .worklist { overflow-x: auto; }
  .work-item { min-width: 680px; }
  .repair-chart { grid-template-columns: 1fr; }
  .chart-value strong { margin-top: 14px; }
  .status-strip { grid-template-columns: 1fr; }
  .user-form, .user-modal-form { grid-template-columns: 1fr; }
  .user-modal-form .modal-actions { grid-column: 1; }
  .filters, .work-filter-form, .report-filter-form { grid-template-columns: 1fr; }
  .ticket-custom-range { grid-template-columns: 1fr; }
  .period-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-filter-panel { padding: 18px; border-radius: 28px; margin-bottom: 18px; background: #fff; box-shadow: 0 20px 48px rgba(27, 42, 74, .08); }
  .work-filter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .work-filter-head strong { display: block; color: var(--navy); font-size: 20px; line-height: 1.2; }
  .work-filter-head span { display: block; margin-top: 4px; color: var(--muted); font-weight: 700; line-height: 1.45; }
  .work-filter-form { grid-template-columns: 1fr; gap: 12px; }
  .work-filter-form .period-tabs { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; min-height: auto; padding: 5px; border-radius: 18px; background: #f4f7fb; border-color: #dbe4f0; }
  .work-filter-form .period-tabs label { min-width: 0; }
  .work-filter-form .period-tabs span { min-height: 44px; height: auto; padding: 8px 4px; border-radius: 14px; font-size: 14px; line-height: 1.2; font-weight: 900; text-align: center; white-space: normal; }
  .work-filter-form .period-tabs input:checked + span { background: var(--navy); color: #fff; box-shadow: 0 12px 24px rgba(27, 42, 74, .18); }
  .work-filter-form label { display: grid; align-content: start; min-width: 0; margin: 0; }
  .work-filter-form .work-custom-range { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 12px; }
  .work-filter-form .work-custom-range label { display: grid; gap: 8px; padding: 12px; border: 1px solid #e6edf7; border-radius: 20px; background: #fbfdff; }
  .work-filter-form label > span { display: block; color: #64748b; font-weight: 900; line-height: 1.25; padding-inline: 2px; }
  .work-filter-form input[type="date"] { width: 100%; max-width: 100%; min-width: 0; min-height: 54px; box-sizing: border-box; border-radius: 16px; background: #fff; }
  .work-filter-form .btn { grid-column: 1 / -1; width: 100%; min-height: 54px; border-radius: 18px; justify-content: center; font-size: 17px; }
  .work-filter-form p { grid-column: 1 / -1; margin: 0; padding: 12px 14px; border-radius: 18px; background: #f1f5f9; color: #475569; font-size: 15px; line-height: 1.45; font-weight: 800; overflow-wrap: anywhere; }
  .work-columns > .panel { padding: 18px; border-radius: 24px; }
  input, select, textarea, .select-control { min-height: 52px; font-size: 16px; }
  .file-upload-control { grid-template-columns: 1fr; }
  .file-upload-clear { width: 100%; }
  .combo-options, .select-options { max-height: 260px; }
  .ticket-form .form-grid { gap: 14px; }
  .department-picker { gap: 10px; }
  .department-choice { min-height: 116px; padding: 18px; border-radius: 22px; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .work-filter-form .period-tabs, .work-filter-form .work-custom-range, .work-filter-form p { grid-column: 1 / -1; }
  .report-filter-form .period-tabs { grid-column: auto; }
  .report-filter-form .period-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .report-filter-form .period-tabs label { min-width: 0; }
  .report-filter-form .period-tabs span { min-height: 44px; height: auto; padding: 8px 4px; font-size: 14px; line-height: 1.2; text-align: center; white-space: normal; }
  .report-custom-range { grid-template-columns: 1fr; }
  .report-bar-row { grid-template-columns: 1fr 48px; }
  .report-bar-row div { grid-column: 1 / -1; grid-row: 2; }
  .report-category-list a { grid-template-columns: 34px minmax(0, 1fr); }
  .report-category-list span { grid-column: 2; }
  .mobile-card-table { overflow: visible; }
  .mobile-card-table table,
  .mobile-card-table thead,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table th,
  .mobile-card-table td { display: block; width: 100%; min-width: 0; }
  .mobile-card-table table { min-width: 0; }
  .mobile-card-table thead { display: none; }
  .mobile-card-table tr { display: grid; gap: 10px; margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 14px 32px rgba(15, 23, 42, .06); }
  .mobile-card-table td { display: grid; grid-template-columns: 126px minmax(0, 1fr); align-items: start; gap: 10px; padding: 0; border: 0; overflow-wrap: anywhere; }
  .mobile-card-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.5; }
  .mobile-card-table td[colspan] { grid-template-columns: 1fr; }
  .mobile-card-table td[colspan]::before { display: none; }
  .mobile-card-table td:last-child .action-icon,
  .mobile-card-table td:last-child .icon-btn { justify-self: stretch; width: 100%; height: 44px; border-radius: 14px; }
  .workload-row div { align-items: flex-start; flex-direction: column; }
  .technician-personal-filter { grid-template-columns: 1fr; }
  .technician-profile-strip { align-items: flex-start; }
  .technician-personal-stats { grid-template-columns: 1fr; }
  .technician-personal-grid { grid-template-columns: 1fr; }
  .technician-day-list > div:not(.empty-state) { align-items: flex-start; flex-direction: column; }
  .technician-day-list span { text-align: left; }
  .technician-status-split { grid-template-columns: 1fr; }
  .requester-report-head { align-items: flex-start; }
  .requester-report-actions { grid-template-columns: 1fr; min-width: 0; width: 100%; }
  .requester-location-filter { grid-template-columns: 1fr; min-width: 0; width: 100%; }
  .requester-location-filter .btn { width: 100%; }
  .requester-report-print-link { width: 100%; justify-content: center; }
  .requester-summary-grid { grid-template-columns: 1fr; }
  [data-live-ticket-table] .table-wrap { overflow: visible; }
  [data-live-ticket-table] table, [data-live-ticket-table] thead, [data-live-ticket-table] tbody, [data-live-ticket-table] tr, [data-live-ticket-table] th, [data-live-ticket-table] td { display: block; width: 100%; min-width: 0; }
  [data-live-ticket-table] thead { display: none; }
  [data-live-ticket-table] tr { display: grid; gap: 10px; margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 14px 32px rgba(15, 23, 42, .06); }
  [data-live-ticket-table] tr.urgent-row { background: #fff1f2; border-color: #fecdd3; }
  [data-live-ticket-table] tr:hover td, [data-live-ticket-table] .urgent-row td { background: transparent; }
  [data-live-ticket-table] td { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 10px; padding: 0; border: 0; }
  [data-live-ticket-table] td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.5; }
  [data-live-ticket-table] td:first-child, [data-live-ticket-table] td:last-child { grid-template-columns: 1fr; }
  [data-live-ticket-table] td:first-child::before, [data-live-ticket-table] td:last-child::before { display: none; }
  [data-live-ticket-table] td:last-child .icon-btn { width: 100%; height: 44px; border-radius: 14px; }
  [data-live-ticket-table] .pagination { justify-content: stretch; }
  [data-live-ticket-table] .pagination span { flex: 1 1 100%; text-align: center; }
  [data-live-ticket-table] .pagination button, [data-live-ticket-table] .pagination .btn { flex: 1 1 0; width: auto; }
  .live-update-toast { left: 16px; right: 16px; bottom: 16px; width: auto; grid-template-columns: 1fr auto; }
  .live-update-toast .btn { grid-column: 1 / -1; }
  .btn { width: 100%; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  .print-page.landscape { page: landscape-report; }
  @page landscape-report { size: A4 landscape; margin: 8mm; }
  html, body, .print-report-body { background: white !important; }
  .print-page, .print-page.landscape { max-width: none; margin: 0; padding: 0; }
  .print-report { min-height: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .print-hide { display: none !important; }
  .print-report-head { grid-template-columns: 52px minmax(0, 1fr); }
  .repair-print-report { gap: 12px; }
  .repair-print-hero { padding: 12px; grid-template-columns: minmax(0, 1fr) 220px; }
  .repair-print-hero h2 { font-size: 24px; }
  .repair-print-card { padding: 12px; }
  .repair-print-section-head h3 { font-size: 16px; }
  .repair-print-summary div { padding: 9px 10px; }
  .repair-print-summary strong { font-size: 20px; }
  .repair-print-table { font-size: 11px; }
  .repair-print-table th, .repair-print-table td { padding: 5px 6px; }
  .technician-print-report { gap: 10px; padding: 0; }
  .technician-print-report .repair-print-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .technician-print-report .repair-print-summary div { min-height: 0; padding: 8px 10px; }
  .technician-print-report .repair-print-grid { grid-template-columns: 1fr; }
  .technician-print-ticket-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .technician-print-ticket-list article { padding: 9px; }
  .requester-print-report { gap: 8px; padding: 0; }
  .requester-print-hero { grid-template-columns: minmax(0, 1fr) 245px; padding: 8px 10px; }
  .requester-print-hero h2 { font-size: 22px; }
  .requester-print-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .requester-print-summary div { min-height: 0; padding: 6px 7px; }
  .requester-print-summary span { font-size: 9.5px; }
  .requester-print-summary strong { font-size: 15px; }
  .requester-print-card { padding: 8px; }
  .requester-print-table, .requester-print-detail-table { font-size: 8.8px; }
  .requester-print-table th, .requester-print-table td,
  .requester-print-detail-table th, .requester-print-detail-table td { padding: 3.5px 4px; }
  .requester-print-latest small { font-size: 8px; }
  .requester-print-table thead, .requester-print-detail-table thead { display: table-header-group; }
  .requester-print-table tr, .requester-print-detail-table tr { break-inside: avoid; page-break-inside: avoid; }
  .print-summary { break-inside: avoid; }
  .print-kpi-table { page-break-inside: auto; }
  .print-kpi-table tr { break-inside: avoid; page-break-inside: avoid; }
  .repair-print-card, .repair-print-grid, .repair-print-status-list, .repair-print-bars div, .repair-print-category-grid div, .repair-print-workload div { break-inside: avoid; }
  .print-signatures { break-inside: avoid; }
}
