/* ===== page title ===== */
.pagehead-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 0;
  position: relative;
}
.pagehead-wrap h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1c1b1a;
  margin: 0 0 18px;
}
.head-actions {
  position: absolute;
  right: 24px;
  top: 28px;
}
.quit-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border: 1px solid var(--danger);
  border-radius: 4px;
  color: var(--danger);
  font-size: 13px;
  background: #ffffff;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.quit-btn:hover {
  background: var(--danger);
  color: #ffffff;
}
.quit-btn:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.divider {
  max-width: 1232px;
  margin: 8px auto 0;
  padding: 0 24px;
}
.divider hr {
  border: 0;
  border-top: 1px dashed #cbd5e1;
  margin: 0;
}

.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 56px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
}
.side {
  background: #ffffff;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  padding: 8px 0;
  min-height: 480px;
}
.side a {
  display: block;
  padding: 14px 22px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid #f1f5f9;
}
.side a:last-child {
  border-bottom: 0;
}
.side a:hover {
  color: var(--accent);
}
.side a.is-active {
  color: var(--accent);
  font-weight: 500;
  background: var(--bg-blue);
  border-left: 3px solid var(--accent);
  padding-left: 19px;
}
.panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0 4px 4px 0;
  padding: 18px 22px 26px;
  min-height: 480px;
}

/* ===== table ===== */
.table-wrap {
  overflow-x: auto;
}
table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 980px;
}
table.list thead th {
  background: var(--bg-blue);
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 14px;
}
table.list tbody td {
  padding: 18px 12px;
  border-bottom: 1px dashed var(--border);
  color: #1c1b1a;
  vertical-align: middle;
}
table.list tbody tr:last-child td {
  border-bottom: 0;
}
table.list tbody tr:hover td {
  background: #fafbfd;
}
table.list .op {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
table.list .op a {
  font-size: 13px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--accent);
  color: var(--accent);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
table.list .op a:hover {
  background: var(--accent);
  color: #ffffff;
}
table.list .op a.danger {
  color: var(--danger);
  border-color: var(--danger);
}
table.list .op a.danger:hover {
  background: var(--danger);
  color: #ffffff;
}
table.list .op a.ghost {
  color: var(--muted);
  border-color: #94a3b8;
}
table.list .op a.ghost:hover {
  background: #475569;
  color: #ffffff;
}
table.list .op a.primary {
  background: var(--accent);
  color: #ffffff;
}
table.list .op a.primary:hover {
  background: var(--accent-hover);
}
table.list .op a.text-danger {
  color: var(--danger);
  border-color: transparent;
  padding-left: 8px;
  padding-right: 8px;
}
table.list .op a.text-danger:hover {
  background: transparent;
  color: #962a20;
  text-decoration: underline;
}

/* ===== pill ===== */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.5;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill.is-blue {
  background: rgba(35, 90, 142, 0.1);
  color: var(--accent);
}
.pill.is-green {
  background: rgba(31, 157, 85, 0.1);
  color: var(--success);
}
.pill.is-amber {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warn);
}
.pill.is-red {
  background: rgba(200, 57, 43, 0.1);
  color: var(--danger);
}
.pill.is-gray {
  background: #f3f4f6;
  color: #4b5563;
}

/* ===== pagination ===== */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 13px;
}
.pager button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--muted);
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}
.pager button:hover:not([disabled]) {
  border-color: var(--accent);
  color: var(--accent);
}
.pager button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-blue);
}
.pager button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== empty ===== */
.empty {
  padding: 80px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* ===== toasts ===== */
.toast {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c1b1a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.toast.is-show {
  opacity: 1;
}
.toast.is-error {
  background: var(--danger);
}
.toast.is-success {
  background: #2a7a3f;
}

/* ===== modal (cancel confirmation) ===== */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  z-index: 50;
}
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  padding: 56px 40px 32px;
  text-align: center;
  animation: modal-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .modal-card {
    animation: none;
  }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: #6b7280;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}
.modal h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #111827;
  margin: 0 0 36px;
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.btn {
  min-width: 120px;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.05s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: 2px solid #235a8e;
  outline-offset: 2px;
}
.btn-ghost {
  background: #fff;
  color: #235a8e;
  border-color: #235a8e;
}
.btn-ghost:hover {
  background: rgba(35, 90, 142, 0.1);
  border-color: #1a4670;
  color: #1a4670;
}
.btn-primary {
  background: #235a8e;
  color: #fff;
  border-color: #235a8e;
}
.btn-primary:hover {
  background: #1a4670;
  border-color: #1a4670;
}
.modal[hidden],
.scrim[hidden] {
  display: none;
}

/* ===== responsive ===== */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .side {
    border-right: 1px solid var(--border);
    border-radius: 4px 4px 0 0;
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
  }
  .side a {
    border-bottom: 1px solid #f1f5f9;
  }
  .side a.is-active {
    border-left: 0;
    border-bottom: 3px solid var(--accent);
    padding: 14px 22px 12px;
  }
  .panel {
    border-radius: 0 0 4px 4px;
  }
  .head-actions {
    position: static;
    margin-top: -36px;
    margin-bottom: 8px;
  }
}
@media (max-width: 560px) {
  .nav {
    display: none;
  }
  .header-right .me {
    display: none;
  }
  table.list thead th,
  table.list tbody td {
    padding: 10px 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
