@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&family=Prompt:wght@500;600;700&display=swap");

:root {
  --font-body: "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif;
  --font-heading: "Prompt", "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif;
  --bg: #eef3f2;
  --panel: #ffffff;
  --panel-soft: #f8fbfa;
  --ink: #1e2528;
  --muted: #6b7479;
  --line: #d9e2df;
  --brand: #0f766e;
  --brand-dark: #123f3b;
  --brand-2: #d06b3d;
  --blue: #3366d6;
  --sky: #438fc7;
  --green: #23865a;
  --yellow: #c98f24;
  --red: #bd3e3b;
  --gray: #87919a;
  --violet: #6656c7;
  --shadow: 0 22px 52px rgba(20, 42, 39, 0.14);
  --shadow-soft: 0 10px 28px rgba(20, 42, 39, 0.08);
  --shadow-hover: 0 18px 34px rgba(20, 42, 39, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 92% 6%, rgba(208, 107, 61, 0.12), transparent 26%),
    radial-gradient(circle at 16% 2%, rgba(51, 102, 214, 0.1), transparent 28%),
    linear-gradient(180deg, #f7faf8 0, var(--bg) 340px),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
.brand h1,
.topbar h2,
.auth-copy h1,
.auth-form-head h2,
.dashboard-hero h2,
.modal-head h3 {
  font-family: var(--font-heading);
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px 1fr;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #173331, #102725);
  color: #fff;
  padding: 24px 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand h1 {
  font-size: 23px;
  margin: 0;
  letter-spacing: 0;
}

.brand span,
.user-box span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.nav {
  display: block;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-group {
  margin-bottom: 10px;
}

.nav-group summary {
  list-style: none;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  text-transform: uppercase;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group > div {
  display: grid;
  gap: 5px;
}

.nav button,
.ghost-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
}

.nav button.active {
  box-shadow: inset 3px 0 0 #81d6c4;
  font-weight: 700;
}

.user-box {
  margin-top: 0;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logout-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  color: #fff;
  background: #b84232;
  font-weight: 700;
}

.logout-btn:hover {
  background: #a73527;
}

.content {
  padding: 30px;
  min-width: 0;
  max-width: 1520px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.topbar h2,
.auth-panel h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar p,
.auth-panel p,
.empty,
.hint {
  color: var(--muted);
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}

.btn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn.secondary {
  color: var(--ink);
  background: #e6e1d7;
}

.btn.warn {
  background: var(--brand-2);
}

.btn.danger {
  background: var(--red);
}

.btn.compact {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat,
.panel,
.auth-panel,
.modal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.stat {
  padding: 18px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  font-size: 34px;
  margin-top: 6px;
}

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

.panel,
.metric-card,
.insight-card,
.quick-action,
.due-item,
.activity-item,
input,
select,
textarea {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.panel h3 {
  margin: 0;
  font-size: 18px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-title p {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 180px;
  flex: 1 1 180px;
}

.toolbar .btn {
  flex: 0 0 auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 40px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6eb7a8;
  box-shadow: 0 0 0 3px rgba(23, 107, 92, 0.12);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  flex: 0 0 18px;
  accent-color: var(--brand);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full {
  grid-column: 1 / -1;
}

.checklist-card label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checklist-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.checklist-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.checklist-head strong,
.settings-section-head strong,
.switch-row strong {
  color: var(--ink);
}

.checklist-head span,
.settings-section-head span,
.switch-row small {
  color: var(--muted);
  font-size: 13px;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checklist-grid label {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.checklist-grid .maintenance-check {
  grid-column: 1 / -1;
  border-color: rgba(189, 62, 59, 0.28);
  background: #fff8f7;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

tbody tr:hover {
  background: #f8faf8;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(180deg, #fbfdfc, #f2f7f5);
}

.detail-table th {
  width: 210px;
}

.equipment-cell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.image-preview {
  display: inline-grid;
  gap: 8px;
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.image-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf8;
}

.image-preview.compact {
  width: 56px;
  height: 56px;
}

.image-preview.compact img,
.image-placeholder {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.image-placeholder {
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: #f6faf8;
  font-size: 11px;
  text-align: center;
}

.detail-image-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 700;
}

.dashboard-hero {
  position: relative;
  min-height: 198px;
  color: #fff;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 216, 110, 0.58), transparent 25%),
    radial-gradient(circle at 12% 78%, rgba(67, 143, 199, 0.55), transparent 28%),
    linear-gradient(135deg, #0f766e 0%, #123f3b 48%, #3366d6 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 22px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  box-shadow:
    -58px 58px 0 -30px rgba(255, 255, 255, 0.14),
    -110px 14px 0 -42px rgba(255, 255, 255, 0.18);
}

.dashboard-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero h2 {
  margin: 6px 0;
  font-size: 36px;
  letter-spacing: 0;
}

.dashboard-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  max-width: 620px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 700;
}

.eyebrow {
  display: inline-flex;
  color: #b8efe2;
  font-size: 13px;
  font-weight: 700;
}

.hero-summary {
  min-width: 148px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hero-summary span {
  display: block;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.hero-summary strong {
  display: block;
  font-size: 42px;
  line-height: 1;
  margin-top: 8px;
}

.hero-summary small {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  margin-top: 8px;
  line-height: 1.35;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 146px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.metric-card:hover,
.insight-card:hover,
.panel:hover {
  box-shadow: var(--shadow-hover);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  opacity: 0.12;
  background: currentColor;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.metric-top span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
}

.metric-top small,
.metric-card p {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  margin: 18px 0 8px;
}

.metric-card p {
  margin: 0;
  font-size: 13px;
}

.tone-green {
  color: var(--green);
}

.tone-green .metric-top span {
  background: var(--green);
}

.tone-amber {
  color: var(--yellow);
}

.tone-amber .metric-top span {
  background: var(--yellow);
}

.tone-blue {
  color: var(--blue);
}

.tone-blue .metric-top span {
  background: var(--blue);
}

.tone-red {
  color: var(--red);
}

.tone-red .metric-top span {
  background: var(--red);
}

.dashboard-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.report-summary-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.insight-card {
  position: relative;
  padding: 18px;
  min-height: 112px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.insight-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: currentColor;
}

.insight-card span,
.insight-card small {
  display: block;
  color: var(--muted);
}

.insight-card strong {
  display: block;
  font-size: 30px;
  margin: 8px 0 4px;
}

.insight-blue {
  color: var(--blue);
}

.insight-amber {
  color: var(--yellow);
}

.insight-green {
  color: var(--green);
}

.insight-red {
  color: var(--red);
}

.calendar-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.25fr) minmax(220px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.chart-panel {
  position: relative;
  min-height: 286px;
  overflow: hidden;
}

.chart-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--brand);
}

.chart-panel::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -44px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  opacity: 0.08;
  background: currentColor;
}

.chart-panel > * {
  position: relative;
  z-index: 1;
}

.chart-accent-green {
  color: var(--green);
  background: linear-gradient(180deg, #ffffff, #f3fbf7);
}

.chart-accent-blue {
  color: var(--blue);
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
}

.chart-accent-violet {
  color: var(--violet);
  background: linear-gradient(180deg, #ffffff, #f8f6ff);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 18px;
}

.donut-chart {
  position: relative;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 34px rgba(20, 42, 39, 0.12);
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.donut-chart span {
  position: relative;
  z-index: 1;
  font-size: 32px;
  font-weight: 800;
}

.chart-legend {
  display: grid;
  gap: 10px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
}

.bar-chart {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 38px;
  align-items: center;
  gap: 12px;
}

.bar-row span {
  color: var(--muted);
}

.bar-row div {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf1ef;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  box-shadow: 0 5px 14px rgba(30, 37, 40, 0.14);
}

.bar-row strong {
  text-align: right;
}

.kpi-panel {
  display: grid;
  align-content: center;
  gap: 12px;
}

.kpi-line {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  border-left: 5px solid currentColor;
}

.kpi-line span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.kpi-line strong {
  display: block;
  font-size: 30px;
  margin-top: 5px;
}

.kpi-blue {
  color: var(--blue);
  background: #f3f7ff;
}

.kpi-amber {
  color: var(--yellow);
  background: #fff8ec;
}

.kpi-green {
  color: var(--green);
  background: #f1fbf6;
}

.recommend-list {
  display: grid;
  gap: 12px;
}

.recommend-list div {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.recommend-list strong {
  font-size: 28px;
}

.recommend-list span {
  color: var(--muted);
}

.settings-panel .form-grid {
  gap: 16px;
}

.settings-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.settings-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.settings-section-head span {
  max-width: 520px;
  text-align: right;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.switch-row span {
  display: grid;
  gap: 4px;
}

.settings-actions {
  display: flex;
}

.settings-actions .btn {
  min-width: 280px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.health-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff 0%, #f5faf8 100%);
}

.health-card span {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.health-card.ok span {
  color: #126a45;
  background: #dbf7e8;
}

.health-card.warn span {
  color: #9a5b00;
  background: #fff1ce;
}

.health-card strong {
  font-size: 20px;
}

.health-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.help-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(135deg, #f5fbff 0%, #f7fff9 55%, #fff8ee 100%);
}

.help-hero h3 {
  margin: 0 0 8px;
  font-size: 26px;
}

.help-hero p {
  margin: 0;
  color: var(--muted);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.line-link-panel {
  border-left: 4px solid #1b8a78;
  background: linear-gradient(135deg, #ffffff 0%, #f4fbf8 100%);
}

.line-link-body {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.line-link-body p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.line-link-code {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #cde6df;
  border-radius: 8px;
  background: #f7fffc;
  color: #07584e;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.line-link-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.success {
  color: #16735f;
  background: #e8f7f1;
}

.status-pill.warning {
  color: #9a5b00;
  background: #fff2d5;
}

.status-pill.muted {
  color: #53636f;
  background: #eef3f4;
}

.notice.warning {
  padding: 12px 14px;
  border: 1px solid #f0d49a;
  border-radius: 8px;
  color: #7a4d00;
  background: #fff8e8;
}

.step-list,
.guide-list {
  display: grid;
  gap: 12px;
}

.step-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.step-item span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.step-item p,
.guide-list p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.guide-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #fff;
}

.guide-list.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.report-card {
  min-height: 300px;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.rank-row span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
}

.rank-row small {
  color: var(--muted);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr) minmax(280px, 0.88fr);
  gap: 16px;
}

.status-board,
.due-panel,
.quick-panel {
  min-height: 292px;
}

.status-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.status-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
}

.status-row strong {
  color: var(--ink);
}

.progress {
  height: 9px;
  border-radius: 999px;
  background: #edf1ef;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
}

.fill-green {
  background: var(--green);
}

.fill-amber {
  background: var(--yellow);
}

.fill-blue {
  background: var(--blue);
}

.fill-gray {
  background: var(--gray);
}

.due-list {
  display: grid;
  gap: 10px;
}

.due-item {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.due-item:hover {
  background: #fff8ed;
  border-color: #efd2a7;
  transform: translateY(-1px);
}

.due-date {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 8px;
  background: #fff1d8;
  color: #8a5415;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.due-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-action {
  min-height: 110px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quick-action:hover {
  background: #edf7f3;
  border-color: #b7d9cf;
  transform: translateY(-1px);
}

.quick-action span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
}

.quick-action strong {
  font-size: 15px;
}

.quick-action small {
  color: var(--muted);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}

.activity-item:hover {
  background: #eef7f3;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.activity-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.activity-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--gray);
}

.activity-dot.Pending {
  background: var(--yellow);
}

.activity-dot.Approved {
  background: var(--sky);
}

.activity-dot.Borrowed {
  background: var(--blue);
}

.activity-dot.Overdue {
  background: var(--red);
}

.Available,
.Returned,
.Resolved {
  background: var(--green);
}

.Borrowed {
  background: var(--blue);
}

.Pending {
  background: var(--yellow);
}

.Open,
.In {
  background: var(--yellow);
}

.Reserved {
  background: #b7791f;
}

.Approved {
  background: var(--sky);
}

.Overdue {
  background: var(--red);
}

.Maintenance,
.Rejected,
.Cancelled,
.Lost,
.Retired {
  background: var(--gray);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 12%, rgba(51, 102, 214, 0.12), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(208, 107, 61, 0.12), transparent 24%),
    linear-gradient(135deg, #f7faf8 0%, #e9f1ef 100%);
}

.auth-panel {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.modern-auth {
  min-height: 620px;
  border: 1px solid rgba(217, 226, 223, 0.9);
  box-shadow: var(--shadow);
}

.auth-copy {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.96), rgba(16, 39, 37, 0.96)),
    radial-gradient(circle at 82% 16%, rgba(255, 217, 147, 0.42), transparent 30%);
  color: #fff;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
}

.auth-copy::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.auth-badge {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  color: #d8fff5;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 13px;
  font-weight: 700;
}

.auth-copy h1 {
  max-width: 430px;
  margin: 0;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-copy p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 430px;
  margin: 0;
}

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-feature-grid div,
.auth-preview-card {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-feature-grid div {
  padding: 12px;
}

.auth-feature-grid strong,
.auth-feature-grid span {
  display: block;
}

.auth-feature-grid span,
.auth-preview-card span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-top: 4px;
}

.auth-preview-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
}

.auth-preview-card div {
  padding: 16px;
}

.auth-preview-card strong {
  display: block;
  margin-top: 6px;
  font-size: 32px;
  line-height: 1;
}

.auth-form {
  padding: 42px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.auth-form-head {
  margin-bottom: 22px;
}

.auth-form-head span {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.auth-form-head h2 {
  margin: 4px 0 6px;
  font-size: 30px;
}

.auth-form-head p {
  color: var(--muted);
  margin: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs button {
  border-radius: 8px;
  padding: 10px;
  background: #eef3f1;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs button.active {
  background: var(--brand);
  color: #fff;
}

.message {
  margin-top: 12px;
  color: var(--brand-2);
}

.action-message {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.action-message.success {
  border-color: rgba(35, 134, 90, 0.25);
  background: rgba(35, 134, 90, 0.08);
  color: var(--green);
}

.action-message.error {
  border-color: rgba(189, 62, 59, 0.25);
  background: rgba(189, 62, 59, 0.08);
  color: var(--red);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-dark);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.toast.success {
  background: var(--green);
}

.toast.error {
  background: var(--red);
}

.idle-warning-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 27, 25, 0.42);
  backdrop-filter: blur(8px);
}

.idle-warning-panel {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.idle-warning-panel h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.idle-warning-panel p {
  margin: 0;
  color: var(--muted);
}

.idle-warning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.calendar-panel {
  padding: 0;
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f6faf8);
}

.calendar-toolbar h3 {
  margin: 4px 0 0;
  font-size: 28px;
}

.calendar-tools {
  width: min(260px, 100%);
}

.calendar-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfc;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  overflow-x: auto;
  background: #fff;
}

.day-name,
.day-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 122px;
  padding: 10px;
  background: #fff;
}

.day-name {
  min-height: auto;
  background: #f4f8f7;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.day-cell:nth-child(7n),
.day-name:nth-child(7n) {
  border-right: 0;
}

.date-num {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 6px;
}

.date-num span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.date-num small {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.day-cell.is-muted {
  background: #f4f5f3;
}

.day-cell.is-muted .date-num {
  opacity: 0.45;
}

.day-cell.is-today {
  background: #f2fbf8;
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.18);
}

.day-cell.is-today .date-num span {
  color: #fff;
  background: var(--brand);
}

.event-pill {
  display: block;
  width: 100%;
  border-radius: 6px;
  color: #fff;
  padding: 5px 7px;
  margin-bottom: 5px;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-pill.Pending {
  background: var(--yellow);
}

.event-pill.Borrowed,
.event-pill.Approved {
  background: var(--blue);
}

.event-pill.Returned {
  background: var(--green);
}

.event-pill.Overdue {
  background: var(--red);
}

.event-pill.Rejected,
.event-pill.Cancelled {
  background: var(--gray);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal-panel {
  width: min(720px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e6e1d7;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  flex-wrap: wrap;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
  padding: 0 6px;
}

.pagination .btn {
  min-height: 34px;
  padding: 7px 10px;
}

@media (max-width: 1200px) {
  .dashboard-metrics,
  .dashboard-insights,
  .dashboard-charts,
  .calendar-summary,
  .reports-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .report-summary-row {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 920px) {
  .app-shell,
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .stats,
  .dashboard-metrics,
  .dashboard-insights,
  .dashboard-charts,
  .calendar-summary,
  .reports-grid,
  .dashboard-layout,
  .form-grid,
  .settings-grid,
  .checklist-grid,
  .health-grid,
  .evidence-grid,
  .help-grid,
  .guide-list.three {
    grid-template-columns: 1fr;
  }

  .topbar,
  .dashboard-hero,
  .calendar-toolbar,
  .panel-title,
  .line-link-body,
  .settings-section-head,
  .switch-row,
  .checklist-head,
  .help-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-section-head span {
    max-width: none;
    text-align: left;
  }

  .report-summary-row {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .no-print,
  .modal-backdrop,
  .actions {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  table {
    font-size: 11px;
  }
}
