:root {
  color-scheme: light;
  --ink: #132c34;
  --ink-strong: #08232d;
  --muted: #687e84;
  --quiet: #8fa1a5;
  --page: #f3f7f6;
  --surface: #ffffff;
  --surface-soft: #eef5f3;
  --line: #dce8e5;
  --brand: #0b6473;
  --brand-dark: #084b58;
  --brand-soft: #dff2f1;
  --aqua: #5dc7bd;
  --blue: #3176c8;
  --blue-soft: #e6f0fc;
  --amber: #b76b09;
  --amber-soft: #fff2d8;
  --green: #237a52;
  --green-soft: #e1f3e9;
  --violet: #6b56b8;
  --violet-soft: #eeeafd;
  --red: #ad3e49;
  --red-soft: #fbe7e9;
  --slate-soft: #eaf0ef;
  --shadow: 0 24px 70px rgba(21, 67, 75, .12);
  --shadow-soft: 0 10px 30px rgba(21, 67, 75, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(49,118,200,.28); outline-offset: 2px; }
.is-hidden { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; overflow: hidden; background: #eaf3f1; }
.login-atmosphere { position: absolute; inset: 0; background: radial-gradient(circle at 16% 20%, rgba(83,195,184,.27), transparent 32%), radial-gradient(circle at 84% 78%, rgba(49,118,200,.16), transparent 35%), linear-gradient(135deg, #f7fbfa 0%, #e9f3f1 52%, #edf5f7 100%); }
.login-atmosphere::before, .login-atmosphere::after { content: ""; position: absolute; border: 1px solid rgba(11,100,115,.1); border-radius: 50%; }
.login-atmosphere::before { width: 520px; height: 520px; left: -230px; bottom: -230px; }
.login-atmosphere::after { width: 360px; height: 360px; right: -140px; top: -150px; }
.login-card { width: min(460px, 100%); position: relative; background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; box-shadow: var(--shadow); padding: 38px; backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--brand), #209b9d); font-size: 13px; font-weight: 850; letter-spacing: .04em; box-shadow: 0 9px 24px rgba(11,100,115,.24); }
.brand strong, .brand span { display: block; }
.brand strong { color: var(--ink-strong); font-size: 15px; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-size: 12px; margin-top: 1px; }
.brand-login { margin-bottom: 28px; }
.environment-pill { width: fit-content; display: flex; align-items: center; gap: 8px; color: var(--green); background: var(--green-soft); border: 1px solid #c4e6d3; border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.environment-pill span { width: 7px; height: 7px; border-radius: 50%; background: #35a36c; box-shadow: 0 0 0 4px rgba(53,163,108,.12); }
.login-card h1 { color: var(--ink-strong); font-size: clamp(30px, 6vw, 42px); line-height: 1.03; letter-spacing: -.045em; margin: 22px 0 14px; }
.login-card > p { color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.login-card form { display: grid; gap: 8px; }
.login-card label { color: var(--ink-strong); font-weight: 700; font-size: 12px; margin-top: 8px; }
.login-card input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; color: var(--ink); padding: 0 14px; transition: border-color .16s, box-shadow .16s; }
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11,100,115,.1); outline: none; }
.password-field { position: relative; }
.password-field input { padding-right: 76px; }
.text-button { position: absolute; right: 7px; top: 7px; height: 34px; padding: 0 8px; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 750; }
.primary-button, .secondary-button { min-height: 42px; border-radius: 11px; padding: 0 16px; font-weight: 780; border: 1px solid transparent; transition: transform .14s, background .14s, border-color .14s; }
.primary-button { background: var(--brand); color: white; box-shadow: 0 8px 20px rgba(11,100,115,.17); }
.primary-button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.secondary-button { background: var(--surface); color: var(--brand); border-color: var(--line); }
.secondary-button:hover { border-color: #a7c4c1; background: var(--surface-soft); }
.login-button { width: 100%; min-height: 50px; margin-top: 14px; }
.form-message { min-height: 20px; color: var(--red); font-size: 12px; margin: 3px 0 0; }
.login-card > small { display: block; color: var(--quiet); margin-top: 16px; text-align: center; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0,1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; background: #092f39; color: white; padding: 24px 18px; display: flex; flex-direction: column; }
.sidebar .brand strong { color: white; }
.sidebar .brand span { color: #9fc0c4; }
.sidebar-environment { color: #bdeee0; background: rgba(50,168,137,.14); border-color: rgba(135,224,199,.23); margin: 24px 4px 22px; }
.side-nav { display: grid; gap: 5px; }
.nav-button { border: 0; background: transparent; color: #c7dadd; border-radius: 12px; min-height: 46px; padding: 0 13px; display: flex; align-items: center; gap: 12px; text-align: left; font-weight: 650; }
.nav-button span { color: #6f9aa0; font-size: 10px; letter-spacing: .08em; }
.nav-button:hover { background: rgba(255,255,255,.07); color: white; }
.nav-button.active { background: #fff; color: var(--brand-dark); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.nav-button.active span { color: var(--aqua); }
.sidebar-status { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 18px 6px 3px; display: flex; gap: 11px; align-items: center; }
.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { color: #ecf9f6; font-size: 12px; }
.sidebar-status small { color: #8fb2b7; font-size: 10px; margin-top: 2px; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: #e9a945; box-shadow: 0 0 0 5px rgba(233,169,69,.12); flex: 0 0 auto; }
.health-dot.ok { background: #5bd09a; box-shadow: 0 0 0 5px rgba(91,208,154,.13); }
.health-dot.bad { background: #e36972; box-shadow: 0 0 0 5px rgba(227,105,114,.13); }

.workspace { min-width: 0; }
.topbar { height: 86px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; background: rgba(243,247,246,.91); border-bottom: 1px solid rgba(220,232,229,.8); backdrop-filter: blur(14px); }
.page-heading p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.page-heading h1 { margin: 3px 0 0; color: var(--ink-strong); font-size: 22px; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--brand); font-size: 21px; line-height: 1; }
.icon-button:hover { background: var(--brand-soft); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 11px 5px 5px; }
.user-chip > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-weight: 850; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { color: var(--ink-strong); font-size: 12px; }
.user-chip small { color: var(--muted); font-size: 10px; text-transform: capitalize; }
.mobile-brand { display: none; }

.content { max-width: 1500px; margin: 0 auto; padding: 28px 30px 60px; }
.welcome-row, .view-toolbar, .view-intro, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.welcome-row { margin: 2px 0 24px; }
.welcome-row h2, .view-intro h2 { margin: 0; color: var(--ink-strong); font-size: clamp(25px,3vw,34px); letter-spacing: -.04em; }
.welcome-row p, .view-intro p { margin: 6px 0 0; color: var(--muted); }
.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.metric-card { min-height: 142px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 82px; height: 82px; border-radius: 50%; right: -25px; top: -28px; background: var(--metric-soft,var(--brand-soft)); opacity: .7; }
.metric-blue { --metric-soft: var(--blue-soft); }
.metric-amber { --metric-soft: var(--amber-soft); }
.metric-violet { --metric-soft: var(--violet-soft); }
.metric-green { --metric-soft: var(--green-soft); }
.metric-red { --metric-soft: var(--red-soft); }
.metric-card .metric-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
.metric-card strong { display: block; color: var(--ink-strong); font-size: 33px; line-height: 1; margin: 19px 0 9px; font-variant-numeric: tabular-nums; }
.metric-card small { color: var(--muted); }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.overview-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.priority-panel, .health-panel, .recent-panel, .tickets-surface, #view-pqrs > .surface { padding: 20px; }
.section-heading { margin-bottom: 15px; }
.section-heading h3 { margin: 3px 0 0; color: var(--ink-strong); font-size: 17px; letter-spacing: -.02em; }
.kicker { color: var(--brand); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.quiet { color: var(--quiet); font-size: 11px; }
.priority-list, .ticket-list, .pqr-list { display: grid; gap: 8px; }
.priority-item, .ticket-list-item, .pqr-item { width: 100%; border: 1px solid var(--line); background: #fcfefe; border-radius: 13px; padding: 13px 14px; display: grid; align-items: center; gap: 12px; text-align: left; color: var(--ink); }
.priority-item { grid-template-columns: 9px minmax(0,1fr) auto; }
.priority-item:hover, .ticket-list-item:hover, .pqr-item:hover { border-color: #a8c6c2; background: var(--surface-soft); }
.priority-mark { width: 8px; height: 36px; border-radius: 9px; background: var(--amber); }
.priority-item strong, .ticket-list-item strong, .pqr-item strong { color: var(--ink-strong); }
.priority-item small, .ticket-list-item small, .pqr-item small { display: block; color: var(--muted); margin-top: 3px; }
.priority-item time { color: var(--muted); font-size: 11px; }
.empty-state { border: 1px dashed #c9dbd8; border-radius: 13px; padding: 26px 18px; text-align: center; color: var(--muted); background: #fbfdfd; }
.health-stack { display: grid; gap: 7px; }
.health-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); padding: 9px; text-align: left; cursor: pointer; }
.health-row:hover, .health-row[aria-expanded="true"] { background: var(--surface-soft); }
.health-row:focus-visible { outline: 3px solid #76d2c7; outline-offset: 2px; }
.health-row div { display: flex; gap: 10px; align-items: center; }
.health-row strong { color: var(--ink-strong); font-size: 12px; }
.health-row small { color: var(--muted); font-size: 11px; }
.health-row-end { display: flex; align-items: center; gap: 8px; }
.health-row-end b { color: var(--brand); font-size: 22px; line-height: 1; transition: transform .16s ease; }
.health-row[aria-expanded="true"] .health-row-end b { transform: rotate(90deg); }
.health-detail { margin-top: 3px; padding: 13px; border: 1px solid #cfe3df; border-radius: 12px; background: #f4faf8; }
.health-detail strong { color: var(--ink-strong); font-size: 12px; }
.health-detail p { margin: 5px 0; color: var(--ink); font-size: 12px; line-height: 1.45; }
.health-detail > small, .incident-item small { color: var(--muted); font-size: 10px; }
.incident-list { display: grid; gap: 8px; margin-top: 9px; }
.incident-item { padding: 10px; border-radius: 10px; background: white; border: 1px solid var(--line); }
.incident-item span { color: var(--ink-strong); font-size: 12px; font-weight: 800; }
.incident-item p { margin: 3px 0 5px; }
.status-orb { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.status-orb.warn { background: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.recent-panel { margin-top: 14px; }
.ticket-list-item { grid-template-columns: minmax(145px,.45fr) minmax(0,1fr) minmax(130px,.5fr) auto; cursor: pointer; }
.link-button { border: 0; background: transparent; color: var(--brand); font-weight: 750; padding: 6px; }

.view-toolbar { margin-bottom: 14px; }
.search-field { min-width: 260px; max-width: 640px; flex: 1; height: 46px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; }
.search-field.compact-search { max-width: 390px; }
.search-field span { color: var(--brand); font-size: 22px; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.date-filter { display: flex; align-items: flex-end; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.date-filter label { display: grid; gap: 2px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.date-filter input { width: 132px; height: 30px; border: 0; border-radius: 7px; background: var(--surface-soft); color: var(--ink-strong); padding: 0 8px; font-size: 11px; }
.text-filter-button { min-height: 30px; border: 0; background: transparent; color: var(--brand); padding: 0 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.text-filter-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.date-presets { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
.date-presets button { min-height: 32px; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); padding: 0 9px; font-size: 10px; font-weight: 750; }
.date-presets button:hover { border-color: #a8c6c2; color: var(--brand); }
.date-presets button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.ticket-date-summary { display: block; min-height: 16px; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 500; }
.install-app-button { white-space: nowrap; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: thin; }
.filter-chip { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 9px 13px; font-size: 12px; font-weight: 700; }
.filter-chip.active { background: var(--brand); border-color: var(--brand); color: white; }
.ticket-table-wrap { overflow: auto; }
.ticket-table { width: 100%; min-width: 980px; border-collapse: collapse; }
.ticket-table th { color: var(--quiet); text-align: left; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ticket-table td { padding: 14px 12px; border-bottom: 1px solid #e8f0ee; vertical-align: middle; }
.ticket-table tbody tr { cursor: pointer; }
.ticket-table tbody tr:hover td { background: #f5faf8; }
.ticket-table .ticket-code { color: var(--ink-strong); font-weight: 850; letter-spacing: .01em; }
.cell-main { color: var(--ink-strong); font-weight: 650; }
.cell-sub { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 780; background: var(--slate-soft); color: #526a6f; }
.status-badge.open { background: var(--blue-soft); color: var(--blue); }
.status-badge.awaiting_central { background: var(--amber-soft); color: var(--amber); }
.status-badge.in_progress { background: var(--violet-soft); color: var(--violet); }
.status-badge.closed { background: var(--green-soft); color: var(--green); }
.status-badge.cancelled, .status-badge.expired { background: var(--red-soft); color: var(--red); }
.progress-line { display: block; width: 94px; height: 4px; appearance: none; border: 0; border-radius: 99px; margin-top: 7px; overflow: hidden; background: #dfe9e7; }
.progress-line::-webkit-progress-bar { background: #dfe9e7; }
.progress-line::-webkit-progress-value { background: var(--blue); border-radius: 99px; }
.progress-line::-moz-progress-bar { background: var(--blue); border-radius: 99px; }
.ticket-cards { display: none; }

.view-intro { margin-bottom: 22px; }
.technician-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.technician-live-note { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 7px 11px; font-size: 10px; font-weight: 850; }
.technician-live-note i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(35,122,82,.12); }
.technician-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.technician-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.technician-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--amber); border-radius: var(--radius); padding: 17px 20px 20px; box-shadow: var(--shadow-soft); }
.technician-card.reported { border-top-color: var(--green); }
.tech-head { display: flex; align-items: center; gap: 12px; }
.tech-avatar { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-weight: 850; }
.tech-head > div:nth-child(2) { min-width: 0; flex: 1; }
.tech-head strong, .tech-head small { display: block; }
.tech-head strong { color: var(--ink-strong); }
.tech-head small { color: var(--muted); margin-top: 2px; }
.availability-badge { flex: 0 0 auto; border-radius: 999px; padding: 6px 9px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.availability-badge.reported { color: var(--green); background: var(--green-soft); }
.availability-badge.pending { color: var(--amber); background: var(--amber-soft); }
.window-panel { display: grid; gap: 3px; margin-top: 16px; padding: 13px; border-radius: 13px; background: var(--surface-soft); }
.window-panel span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.window-panel strong { color: var(--ink-strong); font-size: 18px; font-variant-numeric: tabular-nums; }
.window-panel small { color: var(--muted); font-size: 10px; }
.window-panel.open { background: var(--green-soft); }
.window-panel.open strong { color: var(--green); }
.window-panel.expired { background: var(--red-soft); }
.window-panel.expired strong { color: var(--red); }
.tech-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.tech-stat { background: var(--surface-soft); border-radius: 12px; padding: 12px; }
.tech-stat strong { display: block; color: var(--ink-strong); font-size: 16px; }
.tech-stat small { color: var(--muted); }
.technician-window-note { margin: 14px 2px 0; color: var(--quiet); font-size: 10px; }
.section-description { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.pqr-record { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fcfefe; box-shadow: var(--shadow-soft); }
.pqr-record + .pqr-record { margin-top: 12px; }
.pqr-record header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.pqr-record h4 { margin: 5px 0 3px; color: var(--ink-strong); font-size: 17px; }
.pqr-record header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.pqr-answer-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.pqr-answer { min-width: 0; padding: 12px; border-radius: 12px; background: var(--surface-soft); border: 1px solid #e2ecea; }
.pqr-answer span { display: block; margin-bottom: 5px; color: var(--quiet); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.pqr-answer strong { display: block; color: var(--ink-strong); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.pqr-date { color: var(--muted); font-size: 10px; }
.system-note { margin-top: 14px; padding: 20px; }
.system-note h3 { margin: 0 0 8px; color: var(--ink-strong); }
.system-note p { margin: 0; color: var(--muted); max-width: 760px; }
.admin-access-badge { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); font-size: 10px; font-weight: 850; }
.database-access-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.database-access-card { display: flex; min-width: 0; min-height: 190px; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfd; }
.database-access-card-operational { border-color: #a8d6cf; background: linear-gradient(145deg,#f7fcfb,#eef9f6); }
.database-access-card h4 { margin: 5px 0 7px; color: var(--ink-strong); font-size: 17px; }
.database-access-card p { font-size: 12px; line-height: 1.55; }
.database-access-card .primary-button, .database-access-card .secondary-button { width: 100%; justify-content: center; text-align: center; text-decoration: none; }
.database-access-label { color: var(--brand); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.database-access-note { margin-top: 13px !important; font-size: 11px; }
.masterdata-runtime { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.masterdata-runtime .latency-steps { margin-top: 12px; }
.masterdata-runtime > p { margin-top: 12px; }
.latency-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 13px 0; }
.latency-steps div { padding: 13px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); }
.latency-steps strong, .latency-steps span { display: block; }
.latency-steps strong { color: var(--ink-strong); font-size: 12px; margin-bottom: 4px; }
.latency-steps span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.admin-tools-intro { margin-bottom: 16px !important; }
.admin-tools-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 12px; }
.admin-tool-card { position: relative; display: grid; align-content: start; gap: 10px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfd; }
.admin-tool-card h4 { margin: 0; color: var(--ink-strong); font-size: 15px; }
.admin-tool-card p { margin: 0; font-size: 12px; line-height: 1.55; }
.admin-tool-card small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.admin-tool-card label { color: var(--ink-strong); font-size: 11px; font-weight: 800; }
.admin-tool-card input { width: 100%; min-height: 44px; border: 1px solid #b7d3cf; border-radius: 10px; background: white; color: var(--ink); padding: 0 12px; }
.admin-tool-number { width: fit-content; padding: 5px 8px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); font-size: 10px; font-weight: 850; }
.admin-tool-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-button { min-height: 42px; border: 1px solid #e6b9bd; border-radius: 11px; padding: 0 16px; color: var(--red); background: var(--red-soft); font-weight: 800; }
.danger-button:hover { color: white; background: var(--red); border-color: var(--red); }
.admin-tool-result { margin-top: 12px; padding: 12px 14px; border: 1px solid #b9ddd3; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 700; }
.uncertain-deliveries #unknownDeliveries { display:grid; gap:14px; }
.uncertain-delivery-card { border:1px solid var(--line); border-radius:18px; padding:18px; background:var(--surface-soft); display:grid; gap:12px; }
.uncertain-delivery-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.uncertain-delivery-head h4 { margin:6px 0 0; }
.uncertain-delivery-card p { margin:0; color:var(--ink-soft); }
.uncertain-delivery-meta { display:flex; flex-wrap:wrap; gap:8px 18px; color:var(--ink-soft); font-size:.86rem; }
.uncertain-delivery-card label { font-weight:700; font-size:.88rem; }
.uncertain-delivery-card input { width:100%; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(5,31,38,.42); backdrop-filter: blur(3px); }
.ticket-drawer { position: fixed; z-index: 61; top: 0; right: 0; width: min(720px, 96vw); height: 100vh; background: var(--page); box-shadow: -24px 0 70px rgba(8,38,46,.23); overflow: auto; }
.drawer-header { position: sticky; top: 0; z-index: 2; min-height: 86px; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.drawer-header h2 { margin: 3px 0 0; color: var(--ink-strong); font-size: 22px; }
.drawer-content { padding: 20px; display: grid; gap: 13px; }
.drawer-hero { padding: 19px; border-radius: var(--radius); background: linear-gradient(135deg,#0a5361,#0d7d80); color: white; }
.drawer-hero .status-badge { background: rgba(255,255,255,.16); color: white; }
.drawer-hero h3 { margin: 12px 0 4px; font-size: 24px; letter-spacing: -.035em; }
.drawer-hero p { margin: 0; color: #c9e5e3; }
.detail-section { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.detail-section h3 { color: var(--ink-strong); font-size: 15px; margin: 0 0 14px; }
.section-helper { margin: -7px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.detail-field span { display: block; color: var(--quiet); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.detail-field strong { color: var(--ink-strong); font-size: 13px; word-break: break-word; }
.triage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.triage-item { border-radius: 11px; background: var(--surface-soft); padding: 11px; }
.triage-item span { display: block; color: var(--muted); font-size: 10px; }
.triage-item strong { color: var(--ink-strong); display: block; margin-top: 3px; font-size: 12px; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 18px 23px; border-left: 1px solid #cbdcd8; margin-left: 5px; }
.timeline-item::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); position: absolute; left: -5px; top: 3px; box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item strong { color: var(--ink-strong); display: block; font-size: 12px; }
.timeline-item p { color: var(--ink); font-size: 12px; line-height: 1.45; margin: 4px 0 3px; }
.timeline-item small { color: var(--muted); }
.action-grid { display: grid; gap: 8px; }
.action-button { min-height: 52px; border: 1px solid #b7d3cf; border-radius: 12px; background: #f4faf8; color: var(--brand-dark); text-align: left; padding: 10px 13px; font-weight: 800; }
.action-button small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }
.recommended-action { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.manual-assignment { display: grid; gap: 8px; margin-top: 5px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfd; }
.manual-assignment label { color: var(--ink-strong); font-size: 12px; font-weight: 800; }
.manual-assignment select { width: 100%; min-height: 44px; border: 1px solid #b7d3cf; border-radius: 10px; background: white; color: var(--ink); padding: 0 11px; }
.escalation-assignment { border-color: #c7b7e9; background: #faf8ff; }
.administrative-danger { border-color: #e8c6c9; background: #fffafa; }
.administrative-danger p { margin: -5px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.evidence-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.evidence-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfd; box-shadow: 0 8px 24px rgba(7,39,46,.08); }
.evidence-media { position: relative; aspect-ratio: 4 / 3; min-height: 150px; overflow: hidden; display: grid; place-items: center; background: #102c33; }
.evidence-open { position: absolute; inset: 0; isolation: isolate; display: block; min-width: 0; min-height: 0; overflow: hidden; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.evidence-open:focus-visible { outline: 3px solid #76d2c7; outline-offset: -3px; }
.evidence-preview { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; background: #102c33; }
video.evidence-preview { object-fit: contain; }
.evidence-document { color: var(--brand-dark); font-size: 12px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.evidence-unavailable { color: var(--muted); font-size: 11px; text-align: center; padding: 20px; }
.evidence-caption { display: grid; gap: 2px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fbfdfd; }
.evidence-caption-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.evidence-caption strong { color: var(--ink-strong); font-size: 12px; }
.evidence-caption small { color: var(--muted); font-size: 10px; }
.evidence-expand { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 6px 9px; background: var(--brand-soft); color: var(--brand-dark); font-size: 10px; font-weight: 850; cursor: zoom-in; }
.evidence-expand span { font-size: 14px; line-height: 1; }
.evidence-expand:hover, .evidence-expand:focus-visible { color: white; background: var(--brand); outline: 3px solid #8de4d8; outline-offset: 2px; }

.evidence-viewer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(2,17,21,.84); backdrop-filter: blur(5px); }
.evidence-viewer { position: fixed; z-index: 81; inset: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; background: #071d23; border: 1px solid rgba(255,255,255,.16); border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.48); color: white; }
.evidence-viewer header, .evidence-viewer footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; background: rgba(7,29,35,.96); }
.evidence-viewer header { border-bottom: 1px solid rgba(255,255,255,.12); }
.evidence-viewer footer { border-top: 1px solid rgba(255,255,255,.12); }
.evidence-viewer h2 { margin: 3px 0 0; color: white; font-size: 19px; }
.evidence-viewer .kicker, .evidence-viewer footer p { color: #b7d8d4; }
.evidence-viewer footer p { margin: 0; font-size: 12px; }
.evidence-viewer .icon-button { color: white; border-color: rgba(255,255,255,.22); }
.evidence-viewer #closeEvidenceViewer { width: 46px; height: 46px; flex: 0 0 46px; color: white; background: #0b5c6b; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 3px rgba(11,92,107,.55), 0 8px 24px rgba(0,0,0,.35); font-size: 30px; line-height: 1; }
.evidence-viewer #closeEvidenceViewer:hover, .evidence-viewer #closeEvidenceViewer:focus-visible { color: #07333b; background: white; border-color: #8de4d8; outline: 3px solid #8de4d8; outline-offset: 3px; }
.evidence-viewer .secondary-button { flex: 0 0 auto; color: white; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); text-decoration: none; }
.evidence-viewer-stage { min-height: 0; display: grid; place-items: center; overflow: auto; padding: 18px; }
.evidence-viewer-stage img, .evidence-viewer-stage video { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.correction-form { display: grid; gap: 9px; }
.correction-form label { color: var(--muted); font-size: 11px; font-weight: 700; }
.correction-form input, .correction-form select, .correction-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfd; color: var(--ink); padding: 10px 11px; }
.correction-form textarea { min-height: 72px; resize: vertical; }
.operational-correction-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.operational-correction-card { display: grid; align-content: start; gap: 9px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f8fcfb; }
.operational-correction-card h4 { margin: 0; color: var(--ink-strong); font-size: 14px; }
.operational-correction-card p { margin: 0 0 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.operational-correction-card label { color: var(--ink-strong); font-size: 11px; font-weight: 800; }
.operational-correction-card select, .operational-correction-card textarea { width: 100%; border: 1px solid #b7d3cf; border-radius: 10px; background: white; color: var(--ink); padding: 10px 11px; }
.operational-correction-card select { min-height: 44px; }
.operational-correction-card textarea { min-height: 78px; resize: vertical; }
.operational-correction-card button:disabled, .operational-correction-card select:disabled { cursor: not-allowed; opacity: .55; }
.confirm-modal { position: fixed; z-index: 70; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(430px, calc(100vw - 32px)); padding: 24px; background: white; border-radius: 20px; box-shadow: var(--shadow); }
.confirm-modal h2 { color: var(--ink-strong); margin: 6px 0 8px; }
.confirm-modal p { color: var(--muted); white-space: pre-line; }
.install-guide ol { margin: 14px 0 0; padding-left: 22px; color: var(--ink); }
.install-guide li + li { margin-top: 9px; }
.install-guide strong { color: var(--brand-dark); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toast { position: fixed; z-index: 90; right: 22px; bottom: 22px; max-width: min(430px,calc(100vw - 32px)); color: white; background: #103942; border-radius: 13px; padding: 12px 15px; box-shadow: var(--shadow); }
.mobile-nav { display: none; }
.mobile-logout { display: none; }

@media (max-width: 1120px) {
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .technician-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .technician-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .ticket-toolbar { flex-wrap: wrap; }
  .ticket-toolbar .search-field { max-width: none; flex-basis: 55%; }
}

@media (max-width: 820px) {
  .app-shell { display: block; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .topbar { height: 68px; padding: 0 16px; }
  .page-heading, .logout-desktop { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 11px; }
  .mobile-brand strong { color: var(--ink-strong); }
  .mobile-brand span { color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 4px 7px; font-size: 9px; font-weight: 850; }
  .user-chip div { display: none; }
  .mobile-logout { display: grid; }
  .content { padding: 20px 16px 32px; }
  .welcome-row { align-items: flex-start; }
  .welcome-row .primary-button { display: none; }
  .ticket-table-wrap { display: none; }
  .ticket-cards { display: grid; gap: 9px; }
  .ticket-card { border: 1px solid var(--line); background: #fcfefe; border-radius: 14px; padding: 14px; text-align: left; color: var(--ink); }
  .ticket-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .ticket-card .ticket-code { color: var(--ink-strong); font-weight: 850; }
  .ticket-card h3 { color: var(--ink-strong); margin: 12px 0 2px; font-size: 15px; }
  .ticket-card p { color: var(--muted); margin: 0 0 12px; font-size: 12px; }
  .ticket-card-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; border-top: 1px solid #e7efed; padding-top: 10px; }
  .ticket-list-item { grid-template-columns: 1fr auto; }
  .ticket-list-item > :nth-child(2), .ticket-list-item > :nth-child(3) { display: none; }
  .pqr-answer-grid { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; min-height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); display: flex; justify-content: space-around; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(15px); }
  .mobile-nav-button { min-width: 60px; border: 0; background: transparent; color: var(--quiet); font-size: 9px; font-weight: 750; display: grid; place-items: center; gap: 1px; }
  .mobile-nav-button span { font-size: 19px; line-height: 1; }
  .mobile-nav-button.active { color: var(--brand); }
  .latency-steps { grid-template-columns: 1fr; }
  .database-access-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .login-shell { padding: 0; align-items: stretch; }
  .login-card { min-height: 100vh; width: 100%; border-radius: 0; padding: 32px 22px; display: flex; flex-direction: column; justify-content: center; }
  .metrics-grid, .technician-summary { grid-template-columns: 1fr 1fr; gap: 9px; }
  .technician-grid { grid-template-columns: 1fr; gap: 10px; }
  .technician-intro { align-items: flex-start; flex-direction: column; }
  .metric-card { min-height: 122px; padding: 15px; }
  .metric-card strong { font-size: 28px; margin-top: 15px; }
  .welcome-row h2, .view-intro h2 { font-size: 25px; }
  .priority-panel, .health-panel, .recent-panel, .tickets-surface, #view-pqrs > .surface { padding: 15px; }
  .view-toolbar { align-items: stretch; }
  .view-toolbar .secondary-button { display: none; }
  .search-field { min-width: 0; max-width: none; }
  .detail-grid, .triage-grid { grid-template-columns: 1fr; }
  .operational-correction-grid { grid-template-columns: 1fr; }
  .pqr-record header { align-items: stretch; flex-direction: column; }
  .pqr-record header .secondary-button { width: 100%; }
  .admin-tools-grid { grid-template-columns: 1fr; }
  .evidence-grid { grid-template-columns: 1fr; }
  .ticket-drawer { width: 100%; }
  .drawer-content { padding: 14px; }
  .drawer-header { min-height: 70px; padding: 13px 15px; }
  .evidence-viewer { inset: 0; border: 0; border-radius: 0; }
  .evidence-viewer footer { align-items: stretch; flex-direction: column; }
  .evidence-viewer .secondary-button { text-align: center; }
  .user-chip { display: none; }
  .top-actions { gap: 6px; }
  .install-app-button { min-height: 38px; padding: 0 10px; font-size: 11px; }
  .ticket-toolbar, .pqr-toolbar { display: grid; grid-template-columns: 1fr; }
  .search-field.compact-search { max-width: none; }
  .date-filter { width: 100%; display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .date-filter input { width: 100%; }
  .date-presets { width: 100%; padding-bottom: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
:root .sla-grid {display:grid;grid-template-columns:minmax(0,1fr);gap:0;margin:22px 0;}
#slaSettings {scroll-margin-top:90px;}
#slaForm input, #slaForm select {min-height:44px;padding:10px 12px;border:1px solid #cbdcdf;border-radius:10px;background:#fff;color:#163c45;font:inherit;}
#slaForm input:focus, #slaForm select:focus {outline:2px solid #087f8c;outline-offset:2px;}
.sla-field {display:grid;grid-template-columns:minmax(0,1fr) 130px minmax(200px,280px);align-items:center;gap:20px;padding:20px 0;border-bottom:1px solid #dbe7e5;}
.sla-field label {display:block;margin-bottom:8px;font-weight:600;}
.sla-field > div {display:flex;gap:8px;}
.sla-field input {width:55%;min-width:0;}
.sla-field select {flex:1;min-width:0;}
.sla-support-rule {padding:16px;border:1px solid #a8c7bc;background:#f0f8f4;border-radius:12px;}
.sla-support-rule p {margin:8px 0 0;line-height:1.6;}
.sla-actions {display:flex;flex-wrap:wrap;gap:12px;margin-top:16px;}
#slaReason {display:block;width:100%;margin:8px 0 12px;}
#slaForm .sla-switch {display:flex;align-items:center;gap:10px;margin:0 0 12px;font-weight:500;}
#slaForm .sla-switch input {width:20px;height:20px;min-height:20px;padding:0;accent-color:#087f8c;flex:none;}
.sla-field > label, #slaForm .sla-field > .sla-switch {margin-bottom:0;}
@media (max-width:1000px) {
  .sla-field {display:flex;flex-direction:column;align-items:stretch;gap:12px;}
}
