:root {
  --bg: #f2f5f2;
  --panel: #ffffff;
  --ink: #0f1c2e;
  --muted: #637083;
  --line: #dbe4e2;
  --navy: #071525;
  --navy-2: #102238;
  --brand: #0f766e;
  --brand-dark: #0a5f58;
  --brand-soft: #e3f5ef;
  --cream: #fff8ec;
  --cream-2: #fbf2e1;
  --danger: #ba2a1e;
  --danger-soft: #fff0ec;
  --warn: #a95f0a;
  --warn-soft: #fff7ed;
  --info: #1b6476;
  --info-soft: #eaf6f8;
  --ok: #087443;
  --ok-soft: #e7f7ef;
  --shadow: 0 22px 55px rgba(7, 21, 37, .11);
  --shadow-soft: 0 10px 28px rgba(7, 21, 37, .07);
  --shadow-card: 0 14px 34px rgba(7, 21, 37, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(15, 118, 110, .12), transparent 28%),
    radial-gradient(circle at 95% 8%, rgba(186, 42, 30, .08), transparent 24%),
    linear-gradient(180deg, #fbfaf5 0%, var(--bg) 48%, #eef4f1 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
a { color: var(--brand-dark); text-decoration: none; }
button, .button {
  border: 0;
  background: linear-gradient(135deg, #13877e, var(--brand-dark));
  color: #fff;
  border-radius: 9px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  box-shadow: 0 10px 20px rgba(15, 118, 110, .18);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(15, 118, 110, .22); }
button:disabled { cursor: wait; opacity: .75; transform: none; }
button.ghost, .ghost { background: #eef5f4; color: var(--brand-dark); box-shadow: none; }
button.secondary, .secondary { background: #edf2f3; color: var(--navy); box-shadow: none; }
button.danger, .danger button, .button.danger { background: var(--danger); }
.small { padding: 7px 10px; min-height: 32px; border-radius: 9px; font-size: 13px; }
summary.button, summary.small {
  list-style: none;
  user-select: none;
}
summary.button::-webkit-details-marker, summary.small::-webkit-details-marker { display: none; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: rgba(15, 118, 110, .65); box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); }
textarea { resize: vertical; }
select[multiple] { min-height: 98px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.check input { width: auto; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 270px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 24%),
    linear-gradient(165deg, var(--navy) 0%, #0b2033 54%, #072823 100%);
  color: #fff;
  padding: 24px 16px;
  z-index: 3;
  box-shadow: 24px 0 55px rgba(7, 21, 37, .18);
}
.brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 11px;
  align-items: center;
  margin-bottom: 26px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18), transparent 32%),
    linear-gradient(135deg, var(--brand-accent, #c92f25) 0%, var(--brand) 100%);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .22);
}
.brand-mark.large { width: 54px; height: 54px; border-radius: 16px; }
.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
}
.brand-logo.large {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border-color: var(--line);
}
.brand strong { font-size: 20px; line-height: 1; letter-spacing: .01em; }
.brand span { color: #a9bbc6; font-size: 12px; font-weight: 750; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar a {
  position: relative;
  color: #d8e5ee;
  padding: 11px 12px 11px 14px;
  border-radius: 11px;
  font-weight: 750;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.sidebar a::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 99px;
  background: #f7d7b0;
  transform: translateY(-50%);
  transition: height .15s ease;
}
.sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(1px); }
.sidebar a.active {
  background: linear-gradient(135deg, rgba(15, 118, 110, .28), rgba(255, 248, 236, .1));
  border-color: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 28px rgba(0,0,0,.12);
}
.sidebar a.active::before { height: 22px; }

.shell { margin-left: 270px; padding: 26px; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(15, 118, 110, .14), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(186, 42, 30, .1), transparent 24%),
    linear-gradient(145deg, #071525 0%, #0b2033 48%, #0d332c 100%);
}
.topbar {
  position: relative;
  z-index: 1000;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(219, 228, 226, .86);
  border-radius: 18px;
  padding: 11px 13px 11px 16px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: 0; line-height: 1.05; }
.topbar p, .muted { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.panel, .login-panel, .error-card {
  background: var(--panel);
  border: 1px solid rgba(219, 228, 226, .9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 28px;
  border-color: rgba(255,255,255,.16);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 70px rgba(0,0,0,.28);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-panel h1 { margin: 0; font-size: 29px; }
.login-panel p { color: var(--muted); margin: 4px 0 0; }
.stack { display: grid; gap: 13px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.hero-panel {
  min-height: 136px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), transparent 28%),
    linear-gradient(135deg, var(--navy) 0%, #0d3543 48%, var(--brand-dark) 100%);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
  position: relative;
}
.hero-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -100px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255,248,236,.16);
  border-radius: 50%;
  pointer-events: none;
}
.hero-panel h2 { margin: 5px 0; font-size: 29px; line-height: 1.14; }
.hero-panel p { color: #d7e5e5; margin: 0; font-weight: 650; }
.eyebrow { color: var(--brand); text-transform: uppercase; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.hero-panel .eyebrow { color: #f3cfaa; }
.hero-panel > * { position: relative; z-index: 1; }

.cards, .check-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric, .summary-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, .42), rgba(255,255,255,0) 46%),
    #fff;
  border: 1px solid rgba(219, 228, 226, .92);
  border-radius: 18px;
  padding: 13px;
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow-card);
  color: var(--ink);
  min-height: 104px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(15, 118, 110, .24); }
.metric::before, .summary-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--brand); }
.metric::after, .summary-card::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 16px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .08);
}
.metric span, .summary-card span { color: var(--muted); font-weight: 850; padding-right: 44px; }
.metric strong, .summary-card strong { font-size: 28px; line-height: 1; letter-spacing: 0; align-self: end; }
.metric em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 750; }
.metric.danger::before, .summary-card.danger::before { background: var(--danger); }
.metric.warn::before, .summary-card.warn::before { background: var(--warn); }
.metric.info::before { background: var(--info); }
.metric.approval::before { background: #7b4bb2; }
.metric.danger strong, .summary-card.danger strong { color: var(--danger); }
.metric.warn strong, .summary-card.warn strong { color: var(--warn); }
.metric.info strong { color: var(--info); }
.metric.approval strong { color: #6b3fa0; }
.metric.danger::after { background: var(--danger-soft); }
.metric.warn::after { background: var(--warn-soft); }
.metric.info::after { background: var(--info-soft); }
.metric.approval::after { background: #f3ecfb; }
.metric.action strong {
  justify-self: end;
  font-size: 28px;
  color: var(--brand-dark);
}
.metric.action::after { background: var(--cream); }

.dashboard-live-compact {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.dashboard-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.module-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(219, 228, 226, .94);
  border-top: 4px solid var(--brand);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, .36), rgba(255,255,255,.96)),
    #fff;
  box-shadow: var(--shadow-card);
}
.module-card::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .08);
}
.module-info { border-top-color: #f1a7b8; }
.module-info::after { background: #fff1f4; }
.module-checks { border-top-color: var(--info); }
.module-checks::after { background: var(--info-soft); }
.module-tracking { border-top-color: var(--danger); }
.module-tracking::after { background: var(--danger-soft); }
.module-admin { border-top-color: #7b4bb2; }
.module-admin::after { background: #f3ecfb; }
.module-title {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: calc(100% - 36px);
  margin-bottom: 9px;
  padding: 5px 14px;
  border: 1px solid rgba(219, 228, 226, .92);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  box-shadow: 0 9px 18px rgba(15, 23, 42, .08);
  font-weight: 950;
}
.module-title:hover {
  border-color: rgba(15, 118, 110, .28);
  background: var(--brand-soft);
}
.module-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.module-card .module-stats:has(.module-stat:nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.module-stats.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.module-card .module-stats:has(.module-stat:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.module-stats.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.module-card .module-stats:has(.module-stat:nth-child(1):last-child),
.module-stats.single {
  grid-template-columns: minmax(0, 1fr);
}
.module-stat {
  min-width: 0;
  min-height: 52px;
  display: grid;
  align-content: space-between;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(219, 228, 226, .95);
  border-left: 3px solid var(--brand);
  border-radius: 11px;
  background: rgba(248, 250, 252, .82);
  color: var(--ink);
  box-shadow: 0 8px 16px rgba(15, 23, 42, .05);
}
.module-stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.05;
}
.module-stat strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}
.module-stat.danger {
  border-left-color: var(--danger);
}
.module-stat.danger strong { color: var(--danger); }
.module-stat:hover {
  border-color: rgba(15, 118, 110, .26);
  background: #fff;
}
.filter-disclosure {
  margin: 0 0 12px;
}
.filter-disclosure summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  border: 1px solid rgba(219, 228, 226, .92);
  border-radius: 15px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-weight: 950;
}
.filter-disclosure summary::-webkit-details-marker { display: none; }
.filter-disclosure summary strong {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
}
.filter-disclosure .filters {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(219, 228, 226, .92);
  border-radius: 15px;
  background: #fffefa;
  box-shadow: var(--shadow-soft);
}
.dashboard-branch-disclosure .panel {
  margin-top: 8px;
}
.module-action-row,
.module-context-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 40px;
  margin: -2px 0 10px;
}
.module-action-row form {
  margin: 0;
}
.module-context-row {
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid rgba(219, 228, 226, .88);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
}
.module-context-row > div {
  min-width: 0;
}
.module-context-row strong,
.module-context-row span {
  display: block;
  overflow-wrap: anywhere;
}
.module-context-row strong {
  font-size: 14px;
  line-height: 1.25;
}
.module-context-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.form-grid, .filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.form-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.compact-panel { padding: 16px; }
.brand-settings-form { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
.brand-settings-form input[type="color"] { min-height: 42px; padding: 4px; }
.category-create-form input { min-width: min(320px, 46vw); }
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
}
.option-group legend { padding: 0 6px; color: var(--muted); font-size: 13px; font-weight: 900; }
.option-group .check { padding: 7px 9px; background: #fff; }
.month-days { max-height: 150px; overflow: auto; }
.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 10px; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0; background: #f6faf8; }
.dashboard-table-panel { padding: 20px; }
.branch-status-table th { background: #f7f8f3; }
.branch-status-table tbody tr { transition: background .15s ease; }
.branch-status-table tbody tr:hover { background: #fbf7ee; }
.branch-status-table td:not(:first-child) { font-weight: 850; color: var(--navy-2); }

.badge, .req {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  background: #eef2f6;
  color: var(--muted);
}
.badge.ok, .status-completed, .status-approved { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: #f0f1f3; color: var(--muted); }
.badge.danger, .priority-critical, .req.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn, .status-approval_pending, .priority-high, .req.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info, .status-pending, .req.info { background: var(--info-soft); color: var(--info); }
.priority-low, .priority-normal { background: #eef2f6; color: var(--muted); }

.notification-widget { position: relative; z-index: 1; }
.notification-button {
  position: relative;
  width: 42px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  flex: 0 0 auto;
}
.notification-dot-icon {
  width: 15px;
  height: 18px;
  border: 2px solid var(--brand-dark);
  border-radius: 8px 8px 6px 6px;
  position: relative;
}
.notification-dot-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -6px;
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: var(--brand-dark);
}
.profile-widget {
  position: relative;
}
.profile-widget summary {
  width: 42px;
  min-height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  list-style: none;
  border: 1px solid rgba(219, 228, 226, .86);
  border-radius: 12px;
  background: #f3f7f9;
  color: var(--brand-dark);
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .04);
}
.profile-widget summary::-webkit-details-marker { display: none; }
.profile-widget[open] summary,
.profile-widget summary:hover {
  border-color: rgba(15, 118, 110, .32);
  background: var(--brand-soft);
}
.profile-widget summary span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--brand-dark);
  border-radius: 9px;
  font-size: 9px;
  line-height: 1;
}
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2147483000;
  width: min(240px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
}
.profile-menu strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}
.profile-menu small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.3;
}
.profile-menu a,
.profile-menu button {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f3f7f9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}
.profile-menu a:hover,
.profile-menu button:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
}
.notification-dropdown {
  position: fixed;
  top: 86px;
  right: 24px;
  width: min(380px, calc(100vw - 28px));
  max-height: min(540px, calc(100vh - 120px));
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .22);
  padding: 12px;
  z-index: 2147483000;
  overflow: hidden;
  isolation: isolate;
}
.notification-dropdown::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.notification-dropdown-head, .notification-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.notification-list, .notification-page-list { display: grid; gap: 8px; }
.notification-list { margin: 10px 0; max-height: min(340px, calc(100vh - 280px)); overflow: auto; padding-right: 4px; }
.notification-item, .notification-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.notification-item.unread, .notification-row.unread { background: #f8fbff; }
.priority-notification-important { border-left-color: var(--warn); }
.priority-notification-critical { border-left-color: var(--danger); }
.notification-item p, .notification-row p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.notification-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.notification-actions .small { width: 100%; min-width: 0; white-space: normal; }
.notification-permission-state {
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.notification-permission-state.ok { color: var(--ok); }
.notification-permission-state.warn { color: var(--warn); }
.notification-permission-state.danger { color: var(--danger); }
.operation-alarm-setup {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -4px 0 20px;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, .22);
  border-left: 5px solid var(--brand);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 248, 236, .72), rgba(227, 245, 239, .72)),
    #fff;
  box-shadow: var(--shadow-soft);
}
.notification-alarm-panel {
  margin: 0 0 18px;
  align-items: stretch;
  flex-wrap: wrap;
}
.operation-alarm-setup[hidden] { display: none; }
.operation-alarm-setup.compact {
  padding: 13px 15px;
  border-left-width: 4px;
  background:
    linear-gradient(135deg, rgba(227, 245, 239, .72), rgba(255,255,255,.92)),
    #fff;
}
.operation-alarm-setup.compact h2 {
  font-size: 17px;
  margin-top: 2px;
}
.operation-alarm-setup.compact p { display: none; }
.operation-alarm-setup h2 { margin: 3px 0 2px; font-size: 19px; }
.operation-alarm-setup p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.operation-alarm-setup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.operation-alarm-setup-actions a.small {
  min-height: 32px;
  font-size: 13px;
}
.alarm-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.alarm-status-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.alarm-status-row .ok { background: var(--ok-soft); color: var(--ok); }
.alarm-status-row .warn { background: var(--warn-soft); color: var(--warn); }
.alarm-status-row .danger { background: var(--danger-soft); color: var(--danger); }
.alarm-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.alarm-status-grid article {
  border: 1px solid rgba(219, 228, 226, .95);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  padding: 11px;
}
.alarm-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.alarm-status-grid small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 750;
}
.alarm-status-grid strong {
  display: inline-flex;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
}
.alarm-status-grid strong.ok { background: var(--ok-soft); color: var(--ok); }
.alarm-status-grid strong.warn { background: var(--warn-soft); color: var(--warn); }
.alarm-status-grid strong.danger { background: var(--danger-soft); color: var(--danger); }
.desktop-test-feedback {
  flex: 1 0 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.desktop-test-feedback.ok { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.desktop-test-feedback.warn { background: var(--warn-soft); color: var(--warn); border-color: #fed7aa; }
.desktop-test-feedback.danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.operation-alarm-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 28px));
  z-index: 2147483100;
  pointer-events: none;
}
.operation-alarm-card {
  pointer-events: auto;
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(219, 228, 226, .95);
  border-left: 6px solid var(--warn);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, .78), rgba(255,255,255,.98)),
    #fff;
  box-shadow: 0 28px 72px rgba(7, 21, 37, .22);
}
.operation-alarm-card strong { font-size: 16px; line-height: 1.25; }
.operation-alarm-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.38; }
.operation-alarm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.operation-alarm-critical {
  border-left-color: var(--danger);
  background:
    linear-gradient(180deg, rgba(255, 240, 236, .94), rgba(255,255,255,.98)),
    #fff;
  animation: alarmPulse 1.4s ease-in-out infinite;
}
.operation-alarm-important { border-left-color: var(--warn); }
.operation-alarm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.operation-alarm-actions .small {
  width: 100%;
  padding-left: 8px;
  padding-right: 8px;
}
.operation-alarm-more {
  pointer-events: auto;
  justify-self: end;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(7, 21, 37, .9);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}
@keyframes alarmPulse {
  0%, 100% { box-shadow: 0 28px 72px rgba(7, 21, 37, .22); }
  50% { box-shadow: 0 28px 72px rgba(186, 42, 30, .32); }
}
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  z-index: 2147482990;
}
.toast {
  border: 1px solid var(--line);
  border-left: 5px solid var(--info);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 12px 42px 12px 13px;
  position: relative;
}
.toast.important { border-left-color: var(--warn); }
.toast.critical { border-left-color: var(--danger); }
.toast strong { display: block; margin-bottom: 3px; }
.toast p { margin: 0; color: var(--muted); font-size: 13px; }
.toast button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--ink);
  box-shadow: none;
}

.collapsible-definition summary { width: max-content; margin-bottom: 0; }
.collapsible-definition[open] summary { margin-bottom: 14px; }
.definition-panel { position: relative; }
.definitions-table-wrap { border: 1px solid var(--line); }
.definitions-table { min-width: 0; table-layout: fixed; font-size: 12px; }
.compact-definitions-table th:nth-child(1), .compact-definitions-table td:nth-child(1) { width: 24%; }
.compact-definitions-table th:nth-child(2), .compact-definitions-table td:nth-child(2) { width: 10%; }
.compact-definitions-table th:nth-child(3), .compact-definitions-table td:nth-child(3) { width: 8%; }
.compact-definitions-table th:nth-child(4), .compact-definitions-table td:nth-child(4) { width: 11%; }
.compact-definitions-table th:nth-child(5), .compact-definitions-table td:nth-child(5) { width: 14%; }
.compact-definitions-table th:nth-child(6), .compact-definitions-table td:nth-child(6) { width: 10%; }
.compact-definitions-table th:nth-child(7), .compact-definitions-table td:nth-child(7) { width: 8%; }
.compact-definitions-table th:nth-child(8), .compact-definitions-table td:nth-child(8) { width: 7%; }
.compact-definitions-table th:nth-child(9), .compact-definitions-table td:nth-child(9) { width: 8%; }
.definitions-table th, .definitions-table td { padding: 6px 7px; }
.definitions-table tbody tr { transition: background .15s ease; }
.definitions-table tbody tr:hover { filter: saturate(1.03); }
.definitions-table .table-filter-row th {
  background: #fff;
  padding: 5px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table-filter-row input, .table-filter-row select {
  min-width: 0;
  border-radius: 8px;
  padding: 6px 7px;
  font-size: 11px;
}
.priority-row-critical { background: #fff0f3; }
.priority-row-high { background: #fff8db; }
.priority-row-normal { background: #eefaf6; }
.priority-row-low { background: #f3f7fb; }
.definition-actions {
  min-width: 108px;
}
.definition-actions form, .definition-actions a {
  display: inline-flex;
  vertical-align: top;
  margin: 2px;
}
.definition-actions .small { padding: 5px 7px; min-height: 28px; font-size: 11px; }
.definition-title-cell strong { display: block; line-height: 1.25; }
.definition-title-cell span, .compact-muted { display: block; font-size: 11px; line-height: 1.25; margin-top: 2px; }
.edit-definition-panel { border-color: rgba(15, 118, 110, .28); }
.definition-form textarea { min-height: 86px; }

.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--info-soft); border: 1px solid #bfdbfe; color: #1d4ed8; }
.flash.error { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }
.flash.success { background: var(--ok-soft); border-color: #bbf7d0; color: var(--ok); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px; }
.kv dt { color: var(--muted); font-weight: 800; }
.kv dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fbfcfd; font-size: 13px; }

.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-title h2 { margin: 3px 0 0; }
.live-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -8px 0 14px;
  padding: 7px 10px;
  border: 1px solid rgba(219, 228, 226, .82);
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  box-shadow: 0 8px 20px rgba(7, 21, 37, .05);
  color: var(--muted);
  font-size: 12px;
}
.live-toolbar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.live-toolbar strong { color: var(--ok); font-size: 12px; }
.live-separator { color: #b8c2cf; font-weight: 900; }
.live-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); flex: 0 0 auto; }
.live-actions { display: flex; gap: 8px; }
.live-notice {
  flex: 1 0 auto;
  justify-content: flex-start;
  min-height: 30px;
  padding: 6px 10px;
  background: var(--warn-soft);
  color: var(--warn);
  box-shadow: none;
  border: 1px solid #fed7aa;
  font-size: 12px;
}
.live-flash {
  animation: liveFlash 1.4s ease;
}
@keyframes liveFlash {
  0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, .28); border-color: rgba(15, 118, 110, .45); }
  100% { box-shadow: inherit; }
}
.tabs { display: inline-flex; gap: 6px; background: #f1f5f9; padding: 5px; border-radius: 999px; }
.tabs a { padding: 7px 11px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 900; }
.tabs a:hover { background: #fff; color: var(--brand-dark); }
.task-list { display: grid; gap: 12px; }
.task-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.task-grid .empty-state { grid-column: 1 / -1; }
.empty-state { margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); background: #fbfcfd; }
.task {
  border: 1px solid rgba(219, 227, 234, .95);
  border-radius: 14px;
  padding: 15px;
  background: #fff;
  display: grid;
  gap: 11px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  min-width: 0;
}
.check-card { border-left-width: 5px; padding: 15px; overflow: hidden; }
.priority-card-critical { border-color: #fecdd3; border-left-color: #e11d48; background: linear-gradient(180deg, #fff7f9 0%, #fff 100%); }
.priority-card-high { border-color: #fde68a; border-left-color: #d97706; background: linear-gradient(180deg, #fffbeb 0%, #fff 100%); }
.priority-card-normal { border-color: #bbf7d0; border-left-color: #0f766e; background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%); }
.priority-card-low { border-color: #bfdbfe; border-left-color: #2563eb; background: linear-gradient(180deg, #eff6ff 0%, #fff 100%); }
.completed-card { opacity: .92; }
.completed-grid .check-card { padding: 12px; }
.info-hero { background: linear-gradient(135deg, #f8fafc, #e6f6f3); }
.info-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.info-post-card {
  border: 1px solid rgba(219, 227, 234, .95);
  border-left: 5px solid var(--brand);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.info-post-card.unread { box-shadow: var(--shadow); }
.info-post-card h2 { margin: 0; font-size: 19px; line-height: 1.25; }
.info-post-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.priority-info-critical { border-left-color: #e11d48; background: linear-gradient(180deg, #fff7f9 0%, #fff 100%); }
.priority-info-important { border-left-color: #d97706; background: linear-gradient(180deg, #fffbeb 0%, #fff 100%); }
.priority-info-normal { border-left-color: var(--brand); background: linear-gradient(180deg, #f7fffd 0%, #fff 100%); }
.info-card-top { display: flex; justify-content: space-between; gap: 8px; }
.reader-panel {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
  border-left: 6px solid var(--brand);
}
.reader-head, .reader-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.reader-head h2 { margin: 4px 0 0; font-size: 34px; line-height: 1.15; }
.reader-summary {
  margin: 18px 0;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}
.reader-body {
  font-size: 17px;
  line-height: 1.75;
  color: #1f2937;
}
.reader-body p { margin: 0 0 18px; }
.reader-body ul { margin: 0 0 18px; padding-left: 22px; }
.reader-body strong { color: var(--ink); }
.reader-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.info-admin-table strong { display: block; }
.info-form textarea[name="body"] { min-height: 260px; line-height: 1.55; }
.task.late { border-color: #fed7aa; background: linear-gradient(180deg, #fff 0%, #fffaf5 100%); }
.task-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; min-width: 0; }
.task-head > div:first-child { min-width: 0; max-width: 100%; }
.task strong { font-size: 16px; line-height: 1.28; overflow-wrap: anywhere; }
.task-description { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; font-weight: 600; }
.meta-row, .requirement-row, .badge-stack { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.meta-row span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.meta-row span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 7px; border-radius: 99px; background: #cbd5e1; vertical-align: middle; }
.task-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(170px, .75fr) auto minmax(210px, auto);
  gap: 12px;
  align-items: end;
}
.compact-task-form {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.compact-task-form > * { min-width: 0; }
.compact-task-form .note-field,
.compact-task-form .upload-zone { grid-column: span 2; }
.compact-task-form textarea { min-height: 64px; max-height: 132px; }
.compact-task-form .form-actions { justify-content: stretch; align-self: stretch; }
.compact-task-form .form-actions button { flex: 1 1 120px; min-width: 0; padding: 10px 12px; white-space: normal; }
.note-field { min-width: 0; }
.hint { color: var(--muted); font-weight: 700; }
.issue-check { align-self: stretch; background: rgba(248, 250, 252, .82); border: 1px solid var(--line); padding: 9px 10px; border-radius: 10px; white-space: normal; min-height: 42px; min-width: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; min-width: 0; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.approval-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.approval-details div { min-width: 0; }
.approval-details dt { color: var(--muted); font-size: 12px; font-weight: 900; }
.approval-details dd { margin: 2px 0 0; overflow-wrap: anywhere; font-weight: 800; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 2px; }
.complete-note { margin: 0; color: var(--ok); font-weight: 850; }

.upload-zone {
  min-height: 92px;
  border: 1px dashed #9fb3c8;
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
  cursor: pointer;
  align-content: center;
  justify-items: start;
  min-width: 0;
  width: 100%;
}
.upload-zone:hover, .upload-zone.has-file { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.compact-upload { min-height: 76px; padding: 10px; }
.upload-title { color: var(--ink); font-weight: 900; }
.upload-state { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.upload-zone img { width: 84px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; }

.work-compact-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}
.work-stat {
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(219, 228, 226, .92);
  border-left: 4px solid var(--brand);
  border-radius: 15px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
}
.work-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.work-stat strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}
.work-stat.danger {
  border-left-color: var(--danger);
}
.work-stat.danger strong { color: var(--danger); }
.work-list-head {
  margin-bottom: 10px;
  padding: 16px;
}
.work-list-panel {
  padding-top: 18px;
}
.work-filter-disclosure {
  margin: 0 0 12px;
}
.work-filter-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 11px 14px;
  border: 1px solid rgba(219, 228, 226, .92);
  border-radius: 15px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-weight: 900;
}
.work-filter-disclosure summary::-webkit-details-marker { display: none; }
.work-filter-disclosure summary strong {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
}
.work-filters {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(219, 228, 226, .92);
  border-radius: 15px;
  background: #fffefa;
  box-shadow: var(--shadow-soft);
  grid-template-columns: minmax(180px, 1.35fr) repeat(5, minmax(124px, 1fr)) auto auto;
  gap: 8px;
}
.work-filters input,
.work-filters select {
  min-height: 38px;
  padding: 8px 10px;
}
.work-filters .small {
  min-height: 38px;
}

.work-detail {
  display: grid;
  gap: 14px;
}
.work-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.work-meta-grid div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafc;
}
.work-meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.work-meta-grid strong {
  display: inline-flex;
  margin-top: 6px;
  overflow-wrap: anywhere;
}
.work-description {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.timeline {
  display: grid;
  gap: 12px;
}
.timeline-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}
.timeline-item {
  border-left: 4px solid var(--brand);
}
.work-progress-panel {
  overflow: hidden;
}
.work-timeline {
  position: relative;
  padding-left: 20px;
}
.work-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--brand), rgba(15, 118, 110, .08));
}
.work-step {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}
.work-step-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}
.work-step-marker span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 13px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(15, 118, 110, .2);
}
.work-step-body {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, .46), rgba(255,255,255,.98)),
    #fff;
}
.work-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.work-step-head > div {
  min-width: 0;
}
.timeline-item strong,
.work-step-file strong {
  display: block;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.timeline-item span,
.work-step-file small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.work-step-status {
  display: inline-flex;
  margin: 10px 0 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.timeline-item p,
.work-step-message {
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.work-step-files {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, .58);
}
.work-step-files > span {
  display: block;
  margin: 0 0 7px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 950;
}
.work-step-files > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.work-step-file {
  display: block;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(219, 228, 226, .95);
  border-radius: 11px;
  background: rgba(248, 250, 252, .9);
  color: inherit;
}
.work-step-file:hover {
  border-color: rgba(15, 118, 110, .26);
  background: var(--brand-soft);
}

.error-card { max-width: 560px; }
.status { display: inline-flex; margin: 0 0 8px; color: var(--danger); font-size: 42px; font-weight: 950; }
.error-context { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.error-context span { background: #f1f5f9; color: var(--muted); border-radius: 999px; padding: 7px 10px; font-size: 13px; font-weight: 800; }

.mobile-menu {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 13px;
  background: rgba(7, 21, 37, .94);
  color: #fff;
  box-shadow: 0 14px 30px rgba(7, 21, 37, .22);
}
.drawer-backdrop { display: none; }

@media (max-width: 1120px) {
  .cards, .check-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-module-grid { grid-template-columns: 1fr; }
  .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-form { grid-template-columns: 1fr 1fr; }
  .form-actions { justify-content: flex-start; }
}

@media (max-width: 920px) {
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; z-index: 1000; }
  .sidebar.open { transform: translateX(0); }
  .drawer-backdrop.open { display: block; position: fixed; inset: 0; z-index: 900; background: rgba(7, 21, 37, .48); backdrop-filter: blur(2px); }
  .mobile-menu { display: inline-flex; }
  .shell { margin-left: 0; padding: 66px 12px 12px; }
  .hero-panel, .section-title { align-items: flex-start; flex-direction: column; }
  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 16px;
  }
  .live-toolbar { align-items: center; flex-direction: row; flex-wrap: wrap; border-radius: 14px; }
  .live-toolbar .small { width: auto; }
  .topbar h1 { font-size: 23px; }
  .operation-alarm-setup {
    align-items: stretch;
    flex-direction: column;
    margin-top: -2px;
  }
  .operation-alarm-setup-actions { justify-content: stretch; }
  .operation-alarm-setup-actions button { flex: 1; }
  .topbar-actions {
    width: auto;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 0;
    border-top: 0;
  }
  .notification-dropdown {
    position: fixed;
    top: 112px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 128px);
  }
  .notification-actions { grid-template-columns: 1fr; }
  .hero-panel .button { width: 100%; }
  .grid.two, .form-grid, .form-grid.compact, .brand-settings-form, .filters, .task-form { grid-template-columns: 1fr; }
  .filter-disclosure .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-action-row,
  .module-context-row {
    align-items: stretch;
    flex-direction: column;
  }
  .module-action-row .button,
  .module-action-row button,
  .module-context-row .button {
    width: 100%;
  }
  .task-grid { grid-template-columns: 1fr; }
  .compact-task-form .note-field, .compact-task-form .upload-zone { grid-column: span 1; }
  .span-2 { grid-column: span 1; }
  .alarm-status-grid { grid-template-columns: 1fr; }
  .work-compact-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .work-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions, .approval-actions, .inline { width: 100%; }
  .approval-details { grid-template-columns: 1fr; }
  .form-actions button, .inline button { flex: 1; }
  .inline { flex-wrap: wrap; }
  .task-head { flex-direction: column; }
  .reader-head, .reader-footer { flex-direction: column; }
  .reader-head h2 { font-size: 28px; }
  table.responsive-table, .responsive-table thead, .responsive-table tbody, .responsive-table th, .responsive-table td, .responsive-table tr { display: block; }
  .responsive-table thead { display: none; }
  .responsive-table tr { border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-bottom: 10px; background: #fff; }
  .responsive-table td { border: 0; display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 7px; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-weight: 900; }
  .kv { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .auth-shell { place-items: stretch; align-items: center; }
  .login-panel { padding: 20px; }
  .cards, .check-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .metric strong, .summary-card strong { font-size: 22px; }
  .metric, .summary-card { min-height: 78px; padding: 10px; border-radius: 13px; }
  .metric::after, .summary-card::after { width: 24px; height: 24px; right: 10px; top: 10px; border-radius: 9px; }
  .metric span, .summary-card span { padding-right: 30px; font-size: 11px; }
  .metric em { font-size: 10px; }
  .dashboard-module-grid { gap: 9px; margin-bottom: 9px; }
  .module-card { padding: 9px; border-radius: 15px; }
  .module-card::after { width: 24px; height: 24px; top: 10px; right: 10px; border-radius: 9px; }
  .module-title { min-height: 28px; margin-bottom: 8px; padding: 4px 11px; font-size: 14px; }
  .module-stats { gap: 6px; }
  .module-stat { min-height: 44px; padding: 7px; border-radius: 9px; }
  .module-stat span { font-size: 9px; }
  .module-stat strong { font-size: 18px; }
  .filter-disclosure { margin-bottom: 9px; }
  .filter-disclosure summary { min-height: 40px; padding: 8px 11px; border-radius: 13px; }
  .filter-disclosure .filters { grid-template-columns: 1fr; padding: 9px; gap: 7px; }
  .profile-menu {
    position: fixed;
    top: 92px;
    right: 12px;
    left: 12px;
    width: auto;
  }
  .live-toolbar { margin-top: -2px; gap: 6px; }
  .live-toolbar > div { width: 100%; }
  .live-toolbar .small { min-height: 30px; padding: 6px 9px; }
  .live-notice { width: 100%; }
  .work-compact-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 9px;
  }
  .work-stat {
    min-height: 46px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 8px 9px;
    border-left-width: 3px;
    border-radius: 12px;
  }
  .work-stat span { font-size: 10px; line-height: 1.05; }
  .work-stat strong { font-size: 20px; }
  .work-list-head {
    padding: 14px;
    margin-bottom: 8px;
  }
  .work-list-head .section-title {
    gap: 10px;
  }
  .work-list-head h2 {
    font-size: 24px;
  }
  .work-filter-disclosure {
    margin-bottom: 9px;
  }
  .work-filter-disclosure summary {
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 13px;
  }
  .work-filters {
    grid-template-columns: 1fr;
    padding: 9px;
    gap: 7px;
  }
  .work-list-panel {
    padding-top: 14px;
  }
  .work-list-panel h2 {
    font-size: 23px;
  }
  .work-step {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
  }
  .work-timeline {
    padding-left: 8px;
  }
  .work-timeline::before {
    left: 0;
  }
  .work-step-marker span {
    width: 22px;
    height: 22px;
    margin-top: 14px;
  }
  .work-step-body {
    padding: 11px;
    border-radius: 13px;
  }
  .work-step-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .work-step-files > div {
    grid-template-columns: 1fr;
  }
  .hero-panel { padding: 20px; border-radius: 18px; }
  .hero-panel h2 { font-size: 25px; }
  .operation-alarm-stack {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }
  .operation-alarm-card { border-radius: 16px; padding: 13px; }
  .operation-alarm-actions { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .task { padding: 12px; }
  .task-grid { grid-template-columns: 1fr; }
  .work-meta-grid { grid-template-columns: 1fr; }
  .tabs { width: 100%; justify-content: space-between; }
  .tabs a { flex: 1; text-align: center; }
}
/* Mobile sidebar layer fix */
@media (max-width: 900px) {
  .sidebar {
    z-index: 3000;
  }

  .topbar {
    z-index: 1000;
  }

  .notification-dropdown,
  .notification-panel {
    z-index: 4000;
  }
}
