:root {
  --bg-1: #e8f4ef;
  --bg-2: #cce5f5;
  --bg-3: #f6fbff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #0f2d3e;
  --muted: #4f6673;
  --accent: #0f8b8d;
  --accent-2: #17324e;
  --ok: #2a9d8f;
  --warn: #e76f51;
  --ring: rgba(15, 139, 141, 0.28);
  --line: #cddde7;
  --shadow: 0 18px 42px rgba(15, 46, 66, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --menu-visible-items: 5;
  --menu-item-height: 58px;
  --motion-fast: 180ms;
  --motion-medium: 340ms;
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", "Gill Sans", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 5%, #ffffff 0%, transparent 33%),
    radial-gradient(circle at 92% 8%, #b9dcf0 0%, transparent 30%),
    linear-gradient(128deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.18;
  background-image: radial-gradient(circle at 1px 1px, rgba(19, 62, 85, 0.16) 1px, transparent 0);
  background-size: 20px 20px;
}

/* Profile dialog */
.profile-dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 26px 60px rgba(12, 39, 55, 0.32);
  overflow: visible;
}

.profile-dialog::backdrop {
  background: radial-gradient(circle at 50% 20%, rgba(8, 47, 73, 0.22), rgba(8, 47, 73, 0.38));
  backdrop-filter: blur(2px);
}

.profile-dialog-form {
  width: min(92vw, 470px);
  padding: 20px;
  border-radius: 18px;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, #ffffff 0%, #f8fcff 45%, #edf6fb 100%);
}

.profile-head {
  margin-bottom: 12px;
}

.profile-head h3 {
  margin: 0;
  font-size: 21px;
  color: var(--accent-2);
  letter-spacing: 0.2px;
}

.profile-head-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #d3e3eb;
  border-radius: 14px;
  background: linear-gradient(120deg, #ffffff, #f2f9fd);
}

.profile-identity-main {
  flex: 1;
  min-width: 0;
}

.profile-dialog .avatar {
  width: 72px;
  height: 72px;
  font-size: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #cfe1eb;
  background: linear-gradient(130deg, #1d3557, #2a9d8f);
  color: #ffffff;
}

.profile-dialog .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.profile-section {
  border: 1px solid #d7e7ef;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  animation: profileFade 160ms ease;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 14px;
}

.profile-row:last-child {
  margin-bottom: 0;
}

.profile-row strong {
  width: 96px;
  color: var(--muted);
  font-weight: 700;
}

.profile-dialog input[type="text"],
.profile-dialog input[type="email"] {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfeff;
}

.profile-dialog input[type="text"]:focus,
.profile-dialog input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.profile-feedback {
  min-height: 18px;
  margin-top: 10px;
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.profile-feedback.success {
  color: #157766;
}

.profile-feedback.error {
  color: #a93525;
}

.profile-feedback.loading {
  color: #2d6280;
}

.profile-dialog .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
}

/* Icon-only buttons */
.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.icon-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.icon-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}

.icon-btn:disabled,
.icon-btn.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.2);
}

.icon-btn.btn-gray {
  background: #eef4f7;
  color: #244556;
}

.icon-btn.btn-blue {
  background: linear-gradient(115deg, #1d3557, #277da1);
  color: #fff;
}

.icon-btn.btn-green {
  background: linear-gradient(120deg, #2a9d8f, #0f8b8d);
  color: #fff;
}

.icon-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-size: 11px;
  color: #ffffff;
  background: rgba(21, 52, 70, 0.95);
  padding: 5px 7px;
  border-radius: 6px;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.icon-btn:hover::after,
.icon-btn:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.icon-btn.is-busy svg {
  animation: iconSpin 0.8s linear infinite;
}

@keyframes iconSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes profileFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .profile-dialog-form {
    width: 94vw;
    padding: 16px;
  }

  .profile-identity {
    align-items: flex-start;
    gap: 10px;
  }

  .profile-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .profile-row strong {
    width: auto;
  }

  .profile-dialog .actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .icon-btn {
    width: 100%;
  }
}

header {
  padding: 28px 20px;
  color: #ffffff;
  background: linear-gradient(112deg, #0f8b8d, #17324e 62%, #215772);
  box-shadow: 0 10px 28px rgba(13, 36, 53, 0.26);
  position: relative;
}

/* User nav in header (top-right) */
.user-nav {
  position: absolute;
  right: 20px;
  top: 20px;
  display: flex;
  align-items: center;
  z-index: 40;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.user-menu summary::-webkit-details-marker { display: none; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(120deg, #ffffff22, #ffffff10);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.12);
}

.username {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
}

.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.user-meta {
  font-size: 12px;
  opacity: 0.9;
  color: rgba(255,255,255,0.9);
  margin-top: 2px;
}

.user-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  background: #ffffff;
  color: #133041;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(13,36,53,0.18);
  border: 1px solid #d8e7ef;
  padding: 8px 0;
  list-style: none;
  transform-origin: top right;
  z-index: 60;
}

.user-menu[open] .user-menu-list { display: block; }
.user-menu-list { display: none; }

.user-menu-list li { padding: 6px 12px; }
.user-menu-list li a,
.user-menu-list li button { color: inherit; text-decoration: none; display: block; width: 100%; text-align: left; background: transparent; border: none; font-size: 14px; padding: 6px 0; cursor: pointer; }
.user-menu-list li a:hover,
.user-menu-list li button:hover { background: #f3fbff; }

@media (max-width: 720px) {
  .user-nav { right: 12px; top: 12px; }
  .username { display: none; }
}

.header-title {
  max-width: 1080px;
  margin: 0 auto;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-subtitle {
  max-width: 1080px;
  margin: 6px auto 0;
  opacity: 0.9;
  font-size: 14px;
}

.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 26px 16px 38px;
  animation: fade-up 0.55s ease;
}

.layout-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 210px;
  gap: 16px;
  align-items: start;
}

.layout-shell > .left-sidebar,
.layout-shell > .panel,
.layout-shell > .right-sidebar {
  animation: shellCardIn var(--motion-medium) var(--ease-standard) both;
  transition: transform var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}

.layout-shell > .left-sidebar {
  animation-delay: 60ms;
}

.layout-shell > .panel {
  animation-delay: 120ms;
}

.layout-shell > .right-sidebar {
  animation-delay: 180ms;
}

@media (hover: hover) and (pointer: fine) {
  .layout-shell > .left-sidebar:hover,
  .layout-shell > .panel:hover,
  .layout-shell > .right-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(15, 46, 66, 0.18);
  }
}

.layout-shell > .left-sidebar:focus-within,
.layout-shell > .panel:focus-within,
.layout-shell > .right-sidebar:focus-within {
  border-color: #9ac6d4;
}

.left-sidebar {
  background: var(--surface);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
}

.left-sidebar-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}

.left-sidebar-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.gangguan-menu {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  min-height: 0;
  padding-right: 4px;
  max-height: calc((var(--menu-item-height) * var(--menu-visible-items)) + (8px * (var(--menu-visible-items) - 1)));
}

.gangguan-menu::-webkit-scrollbar {
  width: 8px;
}

.gangguan-menu::-webkit-scrollbar-track {
  background: #eaf4f8;
  border-radius: 999px;
}

.gangguan-menu::-webkit-scrollbar-thumb {
  background: #9ecad7;
  border-radius: 999px;
}

.gangguan-item {
  width: 100%;
  text-align: left;
  border: 1px solid #d2e4ec;
  border-radius: 14px;
  padding: 11px;
  min-height: var(--menu-item-height);
  background: #f5fbfe;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gangguan-item:hover {
  transform: translateY(-1px);
  border-color: #9ecad7;
  box-shadow: 0 6px 14px rgba(18, 67, 91, 0.1);
}

.gangguan-item.active {
  border-color: #5aa8b8;
  background: linear-gradient(130deg, #ffffff, #e8f7fc);
  box-shadow: 0 8px 18px rgba(18, 67, 91, 0.13);
}

.gangguan-item-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.gangguan-item-progress {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #d7ecf4;
  color: #1e4f66;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.right-sidebar {
  background: var(--surface);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: sticky;
  top: 14px;
}

.right-sidebar-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}

.right-sidebar-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.action-menu {
  display: grid;
  gap: 8px;
}

.action-btn {
  width: 100%;
}

.signature-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
}

.signature-title {
  font-size: 13px;
  font-weight: 700;
}

.signature-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  margin-bottom: 8px;
}

.signature-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 8px;
}

.signature-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.signature-status {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}

.signature-identity {
  margin-top: 0;
  margin-bottom: 8px;
}

.signature-qr {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  min-height: 136px;
  border: 1px dashed #bfd6e0;
  border-radius: 10px;
  padding: 8px;
  background: #f7fcfe;
}

.signature-qr img,
.signature-qr canvas {
  width: 120px !important;
  height: 120px !important;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sidebar-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.sidebar-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.mode-switch {
  background: #e9f2f6;
  border: 1px solid #d2e4ec;
  border-radius: 14px;
  padding: 6px;
}

.sidebar-item {
  width: 100%;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.sidebar-item:hover {
  border-color: #c6dbe5;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 12px rgba(19, 48, 65, 0.08);
  transform: translateY(-1px);
}

.sidebar-item.active {
  border-color: #8bc7cc;
  box-shadow: 0 6px 14px rgba(17, 97, 112, 0.16);
  background: linear-gradient(120deg, #ffffff, #f1fbfc);
}

.sidebar-item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.sidebar-item-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.sidebar-item-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #dbeef5;
  color: #1e4f66;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #f9fdff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
  background: #ffffff;
}

.field input.is-locked {
  background: #eef6f9;
  border-color: #b7d2de;
  color: #1f4f63;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #3a5f73 50%), linear-gradient(135deg, #3a5f73 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.col-3 {
  grid-column: span 3;
}

.col-4 {
  grid-column: span 4;
}

.col-5 {
  grid-column: span 5;
}

.col-12 {
  grid-column: span 12;
}

.history-action-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.history-action-row .btn {
  width: 100%;
  text-align: center;
}

.history-detail-btn {
  padding: 6px 12px;
  font-size: 12px;
}

.history-delete-btn {
  padding: 6px 12px;
  font-size: 12px;
}

.history-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-detail {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff, #f8fcff);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  color: var(--text);
}

.history-detail-title {
  font-size: 16px;
  font-weight: 800;
  color: #1d3557;
  margin-bottom: 8px;
}

.history-detail-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: #244556;
  margin-bottom: 8px;
}

.history-detail-meta {
  margin-bottom: 6px;
  line-height: 1.4;
}

.history-detail-divider {
  margin: 10px 0;
  height: 1px;
  background: #dbe9ef;
}

.history-checklist-list {
  margin: 0;
  padding-left: 18px;
}

.history-checklist-list li {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.history-checklist-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.history-checklist-status.done {
  background: #d9f6ef;
  color: #157766;
}

.history-checklist-status.pending {
  background: #f5f8fa;
  color: #5a7280;
}

.history-checklist-text {
  line-height: 1.4;
}

.history-empty-detail {
  font-style: italic;
  color: var(--muted);
}

.history-json-block {
  margin-top: 8px;
  background: #f5fafc;
  border: 1px solid #d7e7ef;
  border-radius: 8px;
  padding: 8px;
  max-height: 260px;
  overflow: auto;
  font-size: 11px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.mode-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.mode-info span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #114056;
  background: #d9edf6;
  border: 1px solid #c4deea;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 7px 16px rgba(17, 63, 85, 0.18);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.15);
}

.btn-blue {
  background: linear-gradient(115deg, #1d3557, #277da1);
  color: #ffffff;
}

.btn-gray {
  background: #d7e2e8;
  color: #244556;
}

.btn-green {
  background: linear-gradient(120deg, #2a9d8f, #0f8b8d);
  color: #ffffff;
}

.btn-red {
  background: linear-gradient(120deg, #c44536, #e76f51);
  color: #ffffff;
}

.btn-export {
  background: linear-gradient(120deg, #f4a261, #e76f51);
  color: #ffffff;
}

.finish-btn {
  margin-top: 10px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.stat {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 4px 10px rgba(16, 54, 73, 0.06);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
}

.progress-wrap {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #dbeaf0;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a9d8f, #1d3557);
  transition: width 0.25s ease;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 54, 73, 0.08);
}

.export-actions {
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  font-size: 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #edf5f9;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f7fbfe;
}

tr.checked {
  background: #e8f8f3;
}

.empty-row {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 16px 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-width: 100px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #f5f8fa;
  color: var(--muted);
}

.copyright-footer {
  margin-top: 40px;
  padding: 24px 20px;
  background: linear-gradient(110deg, #0f8b8d, #1d3557);
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright-footer p {
  margin: 0;
  font-weight: 500;
}

.status-pill.done {
  background: #d9f6ef;
  color: #157766;
}

.status-toggle {
  accent-color: var(--ok);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: linear-gradient(120deg, #17324e, #235b77);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(10, 24, 37, 0.28);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.popup-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: rgba(10, 24, 37, 0.52);
  backdrop-filter: blur(3px);
  z-index: 9999;
}

.popup-overlay[hidden] {
  display: none;
}

.warning-popup {
  width: min(370px, 100%);
  background: #ffffff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
  position: relative;
  animation: warningPopIn 220ms var(--ease-standard);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: #e53935;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.warning-icon {
  height: 150px;
  background: linear-gradient(135deg, #e53935, #f4511e);
  display: flex;
  justify-content: center;
  align-items: center;
}

.warning-symbol {
  width: 0;
  height: 0;
  border-left: 45px solid transparent;
  border-right: 45px solid transparent;
  border-bottom: 70px solid #ffffff;
  position: relative;
}

.warning-symbol::after {
  content: "!";
  position: absolute;
  left: -8px;
  top: 15px;
  color: #00a6c7;
  font-size: 45px;
  font-weight: 700;
}

.popup-content {
  background: #eaf6ff;
  padding: 25px 30px 30px;
  text-align: center;
}

.popup-content h2 {
  margin: 0 0 20px;
  color: #f15a32;
  font-size: 28px;
}

.popup-content p {
  margin: 0 auto 25px;
  color: #333333;
  font-size: 16px;
  line-height: 1.5;
}

.popup-field {
  margin-bottom: 20px;
  text-align: left;
}

.popup-field label {
  display: block;
  margin-bottom: 8px;
  color: #17324e;
  font-size: 13px;
  font-weight: 700;
}

.popup-field textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #c9dbe6;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.popup-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.btn-yes {
  background: #ffffff;
  color: #e53935;
}

.btn-no {
  background: #e53935;
  color: #ffffff;
  border: 2px solid #c62828;
}

.btn-yes:hover,
.btn-no:hover {
  filter: brightness(0.96);
}

@keyframes warningPopIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: max-width var(--motion-medium) var(--ease-standard);
}

.auth-card.auth-card-wide {
  max-width: 760px;
}

.auth-title {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.15;
}

.auth-subtitle {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  background: #e9f2f6;
  border: 1px solid #d2e4ec;
  border-radius: 12px;
  padding: 6px;
}

.auth-tab {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.is-active {
  border-color: #8bc7cc;
  background: linear-gradient(120deg, #ffffff, #f1fbfc);
  box-shadow: 0 6px 14px rgba(17, 97, 112, 0.16);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-inline-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -2px;
}

.auth-link-btn {
  border: none;
  background: transparent;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.auth-link-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

.auth-recovery {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #d2e4ec;
  border-radius: 16px;
  background: linear-gradient(160deg, #f8fdff, #eef8fb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-recovery-head h2 {
  margin: 0;
  font-size: 20px;
  color: var(--accent-2);
}

.auth-recovery-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.auth-recovery-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cde0ea;
  background: #ffffff;
}

.auth-recovery-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text);
}

.auth-recovery-row:last-child {
  margin-bottom: 0;
}

.auth-recovery-row strong {
  min-width: 86px;
  color: var(--muted);
}

.auth-recovery-footer {
  display: flex;
  justify-content: center;
}

.auth-form-register {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 8px;
}

.auth-form-register .field {
  margin-bottom: 0;
}

.auth-form-register .field-full {
  grid-column: 1 / -1;
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 72px;
}

.input-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid #cddde7;
  background: #eef6fa;
  color: #244556;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.input-toggle:hover {
  background: #e2f1f7;
}

.field-message {
  min-height: 16px;
  margin-top: 4px;
  font-size: 12px;
  color: #a23b2a;
}

.field input.has-error,
.field select.has-error,
.field textarea.has-error {
  border-color: #d46a58;
  box-shadow: 0 0 0 4px rgba(212, 106, 88, 0.18);
}

.auth-hidden {
  display: none;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.auth-remember input {
  accent-color: var(--accent);
}

.auth-message {
  min-height: 18px;
  font-size: 13px;
  color: var(--muted);
}

.auth-message.is-error {
  color: #a23b2a;
}

.auth-message.is-success {
  color: #157766;
}

.auth-form .btn.is-loading {
  opacity: 0.85;
  cursor: wait;
}

@media (max-width: 760px) {
  .auth-card.auth-card-wide {
    max-width: 520px;
  }

  .auth-form-register {
    grid-template-columns: 1fr;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shellCardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .layout-shell > .left-sidebar,
  .layout-shell > .panel,
  .layout-shell > .right-sidebar {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

@media (max-width: 820px) {
  header {
    padding: 20px 14px;
  }

  .container {
    padding: 18px 12px 26px;
  }

  .layout-shell {
    grid-template-columns: 1fr;
  }

  .left-sidebar {
    position: static;
    max-height: none;
  }

  .left-sidebar,
  .panel,
  .right-sidebar {
    padding: 14px;
  }

  .left-sidebar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* A retained transform (animation fill-mode) on the parent breaks touch scrolling of nested scrollers on Android/iOS */
  .layout-shell > .left-sidebar {
    animation: none;
    transition: none;
    transform: none;
  }

  /* Nested scroll containers are unreliable on mobile browsers; let the list flow with the page scroll instead */
  .gangguan-menu {
    display: flex;
    flex-direction: column;
    overflow: visible;
    max-height: none;
    padding-right: 0;
    touch-action: auto;
  }

  .gangguan-item {
    flex-shrink: 0;
    touch-action: manipulation;
  }

  .gangguan-item:hover {
    transform: none;
  }

  .right-sidebar {
    position: static;
  }

  .sidebar-menu {
    grid-template-columns: 1fr;
  }

  .col-3,
  .col-4,
  .col-5 {
    grid-column: span 12;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .history-action-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  .header-subtitle {
    font-size: 13px;
  }

  .sidebar-item-title {
    font-size: 14px;
  }

  .btn {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: none;
    background: transparent;
  }

  table {
    min-width: 0;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .table-wrap tbody tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    padding: 4px 8px;
  }

  .table-wrap tbody tr.checked {
    background: #e8f8f3;
  }

  .table-wrap td {
    border-bottom: 1px solid #ecf2f6;
    padding: 9px 4px;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .table-wrap td::before {
    content: attr(data-label);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
  }

  .table-wrap td:last-child {
    border-bottom: none;
  }

  .table-wrap td.empty-row {
    display: block;
    text-align: center;
    border-bottom: none;
    padding: 12px 4px;
  }

  .table-wrap td.empty-row::before {
    content: none;
  }

  .table-wrap td[data-label="Aksi"] .history-action-group {
    justify-content: flex-start;
  }

  .table-wrap td .status-toggle {
    justify-self: start;
  }

  .history-detail {
    padding: 10px;
    font-size: 11px;
  }
}
